static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)

{

    AVFilterContext *ctx = inlink->dst;

    SeparateFieldsContext *sf = ctx->priv;

    AVFilterLink *outlink = ctx->outputs[0];

    AVFrame *second;

    int i, ret;



    inpicref->height = outlink->h;

    inpicref->interlaced_frame = 0;



    second = av_frame_clone(inpicref);

    if (!second)

        return AVERROR(ENOMEM);



    for (i = 0; i < sf->nb_planes; i++) {

        if (!inpicref->top_field_first)

            inpicref->data[i] = inpicref->data[i] + inpicref->linesize[i];

        else

            second->data[i] = second->data[i] + second->linesize[i];

        inpicref->linesize[i] *= 2;

        second->linesize[i]   *= 2;

    }



    inpicref->pts = outlink->frame_count * sf->ts_unit;

    ret = ff_filter_frame(outlink, inpicref);

    if (ret < 0)

        return ret;



    second->pts = outlink->frame_count * sf->ts_unit;

    return ff_filter_frame(outlink, second);

}

static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)

{

    AVFilterContext *ctx = inlink->dst;

    SeparateFieldsContext *sf = ctx->priv;

    AVFilterLink *outlink = ctx->outputs[0];

    AVFrame *second;

    int i, ret;



    inpicref->height = outlink->h;

    inpicref->interlaced_frame = 0;



    second = av_frame_clone(inpicref);

    if (!second)

        return AVERROR(ENOMEM);



    for (i = 0; i < sf->nb_planes; i++) {

        if (!inpicref->top_field_first)

            inpicref->data[i] = inpicref->data[i] + inpicref->linesize[i];

        else

            second->data[i] = second->data[i] + second->linesize[i];

        inpicref->linesize[i] *= 2;

        second->linesize[i]   *= 2;

    }



    inpicref->pts = outlink->frame_count * sf->ts_unit;

    ret = ff_filter_frame(outlink, inpicref);

    if (ret < 0)

        return ret;



    second->pts = outlink->frame_count * sf->ts_unit;

    return ff_filter_frame(outlink, second);

}

    if (ret < 0)
static int FUNC_0(AVFilterLink *VAR_0, AVFrame *VAR_1)

{

    AVFilterContext *ctx = VAR_0->dst;

    SeparateFieldsContext *sf = ctx->priv;

    AVFilterLink *outlink = ctx->outputs[0];

    AVFrame *second;

    int VAR_2, VAR_3;



    VAR_1->height = outlink->h;

    VAR_1->interlaced_frame = 0;



    second = av_frame_clone(VAR_1);

    if (!second)

        return AVERROR(ENOMEM);



    for (VAR_2 = 0; VAR_2 < sf->nb_planes; VAR_2++) {

        if (!VAR_1->top_field_first)

            VAR_1->data[VAR_2] = VAR_1->data[VAR_2] + VAR_1->linesize[VAR_2];

        else

            second->data[VAR_2] = second->data[VAR_2] + second->linesize[VAR_2];

        VAR_1->linesize[VAR_2] *= 2;

        second->linesize[VAR_2]   *= 2;

    }



    VAR_1->pts = outlink->frame_count * sf->ts_unit;

    VAR_3 = ff_filter_frame(outlink, VAR_1);

    if (VAR_3 < 0)

        return VAR_3;



    second->pts = outlink->frame_count * sf->ts_unit;

    return ff_filter_frame(outlink, second);

}

static int FUNC_0(AVFilterLink *VAR_0, AVFrame *VAR_1)
{ AVFilterContext *ctx = VAR_0->dst; SeparateFieldsContext *sf = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; AVFrame *second; int VAR_2, VAR_3; VAR_1->height = outlink->h; VAR_1->interlaced_frame = 0; second = av_frame_clone(VAR_1); if (!second)
return AVERROR(ENOMEM); for (VAR_2 = 0; VAR_2 < sf->nb_planes; VAR_2++) { if (!VAR_1->top_field_first)
VAR_1->data[VAR_2] = VAR_1->data[VAR_2] + VAR_1->linesize[VAR_2]; else
second->data[VAR_2] = second->data[VAR_2] + second->linesize[VAR_2]; VAR_1->linesize[VAR_2] *= 2; second->linesize[VAR_2]   *= 2; } VAR_1->pts = outlink->frame_count * sf->ts_unit; VAR_3 = ff_filter_frame(outlink, VAR_1); if (VAR_3 < 0)
return VAR_3; second->pts = outlink->frame_count * sf->ts_unit; return ff_filter_frame(outlink, second); }