static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)

{

    YADIFContext *s = ctx->priv;

    ThreadData *td  = arg;

    int refs = s->cur->linesize[td->plane];

    int df = (s->csp->comp[td->plane].depth_minus1 + 8) / 8;

    int pix_3 = 3 * df;

    int slice_h = td->h / nb_jobs;

    int slice_start = jobnr * slice_h;

    int slice_end   = (jobnr == nb_jobs - 1) ? td->h : (jobnr + 1) * slice_h;

    int y;



    /* filtering reads 3 pixels to the left/right; to avoid invalid reads,

     * we need to call the c variant which avoids this for border pixels

     */

    for (y = slice_start; y < slice_end; y++) {

        if ((y ^ td->parity) & 1) {

            uint8_t *prev = &s->prev->data[td->plane][y * refs];

            uint8_t *cur  = &s->cur ->data[td->plane][y * refs];

            uint8_t *next = &s->next->data[td->plane][y * refs];

            uint8_t *dst  = &td->frame->data[td->plane][y * td->frame->linesize[td->plane]];

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

            s->filter_line(dst + pix_3, prev + pix_3, cur + pix_3,

                           next + pix_3, td->w - 6,

                           y + 1 < td->h ? refs : -refs,

                           y ? -refs : refs,

                           td->parity ^ td->tff, mode);

            s->filter_edges(dst, prev, cur, next, td->w,

                            y + 1 < td->h ? refs : -refs,

                            y ? -refs : refs,

                            td->parity ^ td->tff, mode);

        } else {

            memcpy(&td->frame->data[td->plane][y * td->frame->linesize[td->plane]],

                   &s->cur->data[td->plane][y * refs], td->w * df);

        }

    }

    return 0;

}

static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)

{

    YADIFContext *s = ctx->priv;

    ThreadData *td  = arg;

    int refs = s->cur->linesize[td->plane];

    int df = (s->csp->comp[td->plane].depth_minus1 + 8) / 8;

    int pix_3 = 3 * df;

    int slice_h = td->h / nb_jobs;

    int slice_start = jobnr * slice_h;

    int slice_end   = (jobnr == nb_jobs - 1) ? td->h : (jobnr + 1) * slice_h;

    int y;



    





    for (y = slice_start; y < slice_end; y++) {

        if ((y ^ td->parity) & 1) {

            uint8_t *prev = &s->prev->data[td->plane][y * refs];

            uint8_t *cur  = &s->cur ->data[td->plane][y * refs];

            uint8_t *next = &s->next->data[td->plane][y * refs];

            uint8_t *dst  = &td->frame->data[td->plane][y * td->frame->linesize[td->plane]];

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

            s->filter_line(dst + pix_3, prev + pix_3, cur + pix_3,

                           next + pix_3, td->w - 6,

                           y + 1 < td->h ? refs : -refs,

                           y ? -refs : refs,

                           td->parity ^ td->tff, mode);

            s->filter_edges(dst, prev, cur, next, td->w,

                            y + 1 < td->h ? refs : -refs,

                            y ? -refs : refs,

                            td->parity ^ td->tff, mode);

        } else {

            memcpy(&td->frame->data[td->plane][y * td->frame->linesize[td->plane]],

                   &s->cur->data[td->plane][y * refs], td->w * df);

        }

    }

    return 0;

}

                           next + pix_3, td->w - 6,
static int FUNC_0(AVFilterContext *VAR_0, void *VAR_1, int VAR_2, int VAR_3)

{

    YADIFContext *s = VAR_0->priv;

    ThreadData *td  = VAR_1;

    int VAR_4 = s->cur->linesize[td->plane];

    int VAR_5 = (s->csp->comp[td->plane].depth_minus1 + 8) / 8;

    int VAR_6 = 3 * VAR_5;

    int VAR_7 = td->h / VAR_3;

    int VAR_8 = VAR_2 * VAR_7;

    int VAR_9   = (VAR_2 == VAR_3 - 1) ? td->h : (VAR_2 + 1) * VAR_7;

    int VAR_10;



    





    for (VAR_10 = VAR_8; VAR_10 < VAR_9; VAR_10++) {

        if ((VAR_10 ^ td->parity) & 1) {

            uint8_t *prev = &s->prev->data[td->plane][VAR_10 * VAR_4];

            uint8_t *cur  = &s->cur ->data[td->plane][VAR_10 * VAR_4];

            uint8_t *next = &s->next->data[td->plane][VAR_10 * VAR_4];

            uint8_t *dst  = &td->frame->data[td->plane][VAR_10 * td->frame->linesize[td->plane]];

            int     VAR_11  = VAR_10 == 1 || VAR_10 + 2 == td->h ? 2 : s->VAR_11;

            s->filter_line(dst + VAR_6, prev + VAR_6, cur + VAR_6,

                           next + VAR_6, td->w - 6,

                           VAR_10 + 1 < td->h ? VAR_4 : -VAR_4,

                           VAR_10 ? -VAR_4 : VAR_4,

                           td->parity ^ td->tff, VAR_11);

            s->filter_edges(dst, prev, cur, next, td->w,

                            VAR_10 + 1 < td->h ? VAR_4 : -VAR_4,

                            VAR_10 ? -VAR_4 : VAR_4,

                            td->parity ^ td->tff, VAR_11);

        } else {

            memcpy(&td->frame->data[td->plane][VAR_10 * td->frame->linesize[td->plane]],

                   &s->cur->data[td->plane][VAR_10 * VAR_4], td->w * VAR_5);

        }

    }

    return 0;

}

static int FUNC_0(AVFilterContext *VAR_0, void *VAR_1, int VAR_2, int VAR_3)
{ YADIFContext *s = VAR_0->priv; ThreadData *td  = VAR_1; int VAR_4 = s->cur->linesize[td->plane]; int VAR_5 = (s->csp->comp[td->plane].depth_minus1 + 8) / 8; int VAR_6 = 3 * VAR_5; int VAR_7 = td->h / VAR_3; int VAR_8 = VAR_2 * VAR_7; int VAR_9   = (VAR_2 == VAR_3 - 1) ? td->h : (VAR_2 + 1) * VAR_7; int VAR_10; for (VAR_10 = VAR_8; VAR_10 < VAR_9; VAR_10++) { if ((VAR_10 ^ td->parity) & 1) { uint8_t *prev = &s->prev->data[td->plane][VAR_10 * VAR_4]; uint8_t *cur  = &s->cur ->data[td->plane][VAR_10 * VAR_4]; uint8_t *next = &s->next->data[td->plane][VAR_10 * VAR_4]; uint8_t *dst  = &td->frame->data[td->plane][VAR_10 * td->frame->linesize[td->plane]]; int     VAR_11  = VAR_10 == 1 || VAR_10 + 2 == td->h ? 2 : s->VAR_11; s->filter_line(dst + VAR_6, prev + VAR_6, cur + VAR_6,
next + VAR_6, td->w - 6,
VAR_10 + 1 < td->h ? VAR_4 : -VAR_4,
VAR_10 ? -VAR_4 : VAR_4,
td->parity ^ td->tff, VAR_11); s->filter_edges(dst, prev, cur, next, td->w,
VAR_10 + 1 < td->h ? VAR_4 : -VAR_4,
VAR_10 ? -VAR_4 : VAR_4,
td->parity ^ td->tff, VAR_11); } else { memcpy(&td->frame->data[td->plane][VAR_10 * td->frame->linesize[td->plane]],
&s->cur->data[td->plane][VAR_10 * VAR_4], td->w * VAR_5); } } return 0; }