static void filter(AVFilterContext *ctx, AVFilterBufferRef *dstpic,

                   int parity, int tff)

{

    YADIFContext *yadif = ctx->priv;

    int y, i;



    for (i = 0; i < yadif->csp->nb_components; i++) {

        int w = dstpic->video->w;

        int h = dstpic->video->h;

        int refs = yadif->cur->linesize[i];

        int df = (yadif->csp->comp[i].depth_minus1 + 8) / 8;



        if (i == 1 || i == 2) {

        /* Why is this not part of the per-plane description thing? */

            w >>= yadif->csp->log2_chroma_w;

            h >>= yadif->csp->log2_chroma_h;

        }



        for (y = 0; y < h; y++) {

            if ((y ^ parity) & 1) {

                uint8_t *prev = &yadif->prev->data[i][y*refs];

                uint8_t *cur  = &yadif->cur ->data[i][y*refs];

                uint8_t *next = &yadif->next->data[i][y*refs];

                uint8_t *dst  = &dstpic->data[i][y*dstpic->linesize[i]];

                int     mode  = y==1 || y+2==h ? 2 : yadif->mode;

                yadif->filter_line(dst, prev, cur, next, w, y+1<h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);

            } else {

                memcpy(&dstpic->data[i][y*dstpic->linesize[i]],

                       &yadif->cur->data[i][y*refs], w*df);

            }

        }

    }



    emms_c();

}

static void filter(AVFilterContext *ctx, AVFilterBufferRef *dstpic,

                   int parity, int tff)

{

    YADIFContext *yadif = ctx->priv;

    int y, i;



    for (i = 0; i < yadif->csp->nb_components; i++) {

        int w = dstpic->video->w;

        int h = dstpic->video->h;

        int refs = yadif->cur->linesize[i];

        int df = (yadif->csp->comp[i].depth_minus1 + 8) / 8;



        if (i == 1 || i == 2) {

        

            w >>= yadif->csp->log2_chroma_w;

            h >>= yadif->csp->log2_chroma_h;

        }



        for (y = 0; y < h; y++) {

            if ((y ^ parity) & 1) {

                uint8_t *prev = &yadif->prev->data[i][y*refs];

                uint8_t *cur  = &yadif->cur ->data[i][y*refs];

                uint8_t *next = &yadif->next->data[i][y*refs];

                uint8_t *dst  = &dstpic->data[i][y*dstpic->linesize[i]];

                int     mode  = y==1 || y+2==h ? 2 : yadif->mode;

                yadif->filter_line(dst, prev, cur, next, w, y+1<h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);

            } else {

                memcpy(&dstpic->data[i][y*dstpic->linesize[i]],

                       &yadif->cur->data[i][y*refs], w*df);

            }

        }

    }



    emms_c();

}

static void FUNC_0(AVFilterContext *VAR_0, AVFilterBufferRef *VAR_1,

                   int VAR_2, int VAR_3)

{

    YADIFContext *yadif = VAR_0->priv;

    int VAR_4, VAR_5;



    for (VAR_5 = 0; VAR_5 < yadif->csp->nb_components; VAR_5++) {

        int w = VAR_1->video->w;

        int h = VAR_1->video->h;

        int refs = yadif->cur->linesize[VAR_5];

        int df = (yadif->csp->comp[VAR_5].depth_minus1 + 8) / 8;



        if (VAR_5 == 1 || VAR_5 == 2) {

        

            w >>= yadif->csp->log2_chroma_w;

            h >>= yadif->csp->log2_chroma_h;

        }



        for (VAR_4 = 0; VAR_4 < h; VAR_4++) {

            if ((VAR_4 ^ VAR_2) & 1) {

                uint8_t *prev = &yadif->prev->data[VAR_5][VAR_4*refs];

                uint8_t *cur  = &yadif->cur ->data[VAR_5][VAR_4*refs];

                uint8_t *next = &yadif->next->data[VAR_5][VAR_4*refs];

                uint8_t *dst  = &VAR_1->data[VAR_5][VAR_4*VAR_1->linesize[VAR_5]];

                int     mode  = VAR_4==1 || VAR_4+2==h ? 2 : yadif->mode;

                yadif->filter_line(dst, prev, cur, next, w, VAR_4+1<h ? refs : -refs, VAR_4 ? -refs : refs, VAR_2 ^ VAR_3, mode);

            } else {

                memcpy(&VAR_1->data[VAR_5][VAR_4*VAR_1->linesize[VAR_5]],

                       &yadif->cur->data[VAR_5][VAR_4*refs], w*df);

            }

        }

    }



    emms_c();

}

static void FUNC_0(AVFilterContext *VAR_0, AVFilterBufferRef *VAR_1,
int VAR_2, int VAR_3)
{ YADIFContext *yadif = VAR_0->priv; int VAR_4, VAR_5; for (VAR_5 = 0; VAR_5 < yadif->csp->nb_components; VAR_5++) { int w = VAR_1->video->w; int h = VAR_1->video->h; int refs = yadif->cur->linesize[VAR_5]; int df = (yadif->csp->comp[VAR_5].depth_minus1 + 8) / 8; if (VAR_5 == 1 || VAR_5 == 2) { w >>= yadif->csp->log2_chroma_w; h >>= yadif->csp->log2_chroma_h; } for (VAR_4 = 0; VAR_4 < h; VAR_4++) { if ((VAR_4 ^ VAR_2) & 1) { uint8_t *prev = &yadif->prev->data[VAR_5][VAR_4*refs]; uint8_t *cur  = &yadif->cur ->data[VAR_5][VAR_4*refs]; uint8_t *next = &yadif->next->data[VAR_5][VAR_4*refs]; uint8_t *dst  = &VAR_1->data[VAR_5][VAR_4*VAR_1->linesize[VAR_5]]; int     mode  = VAR_4==1 || VAR_4+2==h ? 2 : yadif->mode; yadif->filter_line(dst, prev, cur, next, w, VAR_4+1<h ? refs : -refs, VAR_4 ? -refs : refs, VAR_2 ^ VAR_3, mode); } else { memcpy(&VAR_1->data[VAR_5][VAR_4*VAR_1->linesize[VAR_5]],
&yadif->cur->data[VAR_5][VAR_4*refs], w*df); } } } emms_c(); }