static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,

                                        int w, int h)

{

    FlipContext *flip = link->dst->priv;

    int i;



    AVFilterBufferRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],

                                                       perms, w, h);



    for (i = 0; i < 4; i ++) {

        int vsub = i == 1 || i == 2 ? flip->vsub : 0;



        if (picref->data[i]) {

            picref->data[i] += ((h >> vsub)-1) * picref->linesize[i];

            picref->linesize[i] = -picref->linesize[i];

        }

    }



    return picref;

}

static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,

                                        int w, int h)

{

    FlipContext *flip = link->dst->priv;

    int i;



    AVFilterBufferRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],

                                                       perms, w, h);



    for (i = 0; i < 4; i ++) {

        int vsub = i == 1 || i == 2 ? flip->vsub : 0;



        if (picref->data[i]) {

            picref->data[i] += ((h >> vsub)-1) * picref->linesize[i];

            picref->linesize[i] = -picref->linesize[i];

        }

    }



    return picref;

}

static AVFilterBufferRef *FUNC_0(AVFilterLink *link, int perms,

                                        int w, int h)

{

    FlipContext *flip = link->dst->priv;

    int VAR_0;



    AVFilterBufferRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],

                                                       perms, w, h);



    for (VAR_0 = 0; VAR_0 < 4; VAR_0 ++) {

        int VAR_1 = VAR_0 == 1 || VAR_0 == 2 ? flip->VAR_1 : 0;



        if (picref->data[VAR_0]) {

            picref->data[VAR_0] += ((h >> VAR_1)-1) * picref->linesize[VAR_0];

            picref->linesize[VAR_0] = -picref->linesize[VAR_0];

        }

    }



    return picref;

}

static AVFilterBufferRef *FUNC_0(AVFilterLink *link, int perms,
int w, int h)
{ FlipContext *flip = link->dst->priv; int VAR_0; AVFilterBufferRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],
perms, w, h); for (VAR_0 = 0; VAR_0 < 4; VAR_0 ++) { int VAR_1 = VAR_0 == 1 || VAR_0 == 2 ? flip->VAR_1 : 0; if (picref->data[VAR_0]) { picref->data[VAR_0] += ((h >> VAR_1)-1) * picref->linesize[VAR_0]; picref->linesize[VAR_0] = -picref->linesize[VAR_0]; } } return picref; }