static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)

{

    AVFilterLink *outlink = inlink->dst->outputs[0];

    AVFilterBufferRef *outpicref = NULL;

    int ret = 0;



    if (inpicref->perms & AV_PERM_PRESERVE) {

        outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE,

                                        outlink->w, outlink->h);

        if (!outpicref)

            return AVERROR(ENOMEM);



        avfilter_copy_buffer_ref_props(outpicref, inpicref);

        outpicref->video->w = outlink->w;

        outpicref->video->h = outlink->h;

    } else {

        outpicref = avfilter_ref_buffer(inpicref, ~0);

        if (!outpicref)

            return AVERROR(ENOMEM);

    }



    ret = ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));

    if (ret < 0) {

        avfilter_unref_bufferp(&outpicref);

        return ret;

    }



    outlink->out_buf = outpicref;

    return 0;

}

static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)

{

    AVFilterLink *outlink = inlink->dst->outputs[0];

    AVFilterBufferRef *outpicref = NULL;

    int ret = 0;



    if (inpicref->perms & AV_PERM_PRESERVE) {

        outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE,

                                        outlink->w, outlink->h);

        if (!outpicref)

            return AVERROR(ENOMEM);



        avfilter_copy_buffer_ref_props(outpicref, inpicref);

        outpicref->video->w = outlink->w;

        outpicref->video->h = outlink->h;

    } else {

        outpicref = avfilter_ref_buffer(inpicref, ~0);

        if (!outpicref)

            return AVERROR(ENOMEM);

    }



    ret = ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));

    if (ret < 0) {

        avfilter_unref_bufferp(&outpicref);

        return ret;

    }



    outlink->out_buf = outpicref;

    return 0;

}

static int FUNC_0(AVFilterLink *VAR_0, AVFilterBufferRef *VAR_1)

{

    AVFilterLink *outlink = VAR_0->dst->outputs[0];

    AVFilterBufferRef *outpicref = NULL;

    int VAR_2 = 0;



    if (VAR_1->perms & AV_PERM_PRESERVE) {

        outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE,

                                        outlink->w, outlink->h);

        if (!outpicref)

            return AVERROR(ENOMEM);



        avfilter_copy_buffer_ref_props(outpicref, VAR_1);

        outpicref->video->w = outlink->w;

        outpicref->video->h = outlink->h;

    } else {

        outpicref = avfilter_ref_buffer(VAR_1, ~0);

        if (!outpicref)

            return AVERROR(ENOMEM);

    }



    VAR_2 = ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));

    if (VAR_2 < 0) {

        avfilter_unref_bufferp(&outpicref);

        return VAR_2;

    }



    outlink->out_buf = outpicref;

    return 0;

}

static int FUNC_0(AVFilterLink *VAR_0, AVFilterBufferRef *VAR_1)
{ AVFilterLink *outlink = VAR_0->dst->outputs[0]; AVFilterBufferRef *outpicref = NULL; int VAR_2 = 0; if (VAR_1->perms & AV_PERM_PRESERVE) { outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE,
outlink->w, outlink->h); if (!outpicref)
return AVERROR(ENOMEM); avfilter_copy_buffer_ref_props(outpicref, VAR_1); outpicref->video->w = outlink->w; outpicref->video->h = outlink->h; } else { outpicref = avfilter_ref_buffer(VAR_1, ~0); if (!outpicref)
return AVERROR(ENOMEM); } VAR_2 = ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0)); if (VAR_2 < 0) { avfilter_unref_bufferp(&outpicref); return VAR_2; } outlink->out_buf = outpicref; return 0; }