void avfilter_draw_slice(AVFilterLink *link, int y, int h)

{

    uint8_t *src[4], *dst[4];

    int i, j, hsub, vsub;



    /* copy the slice if needed for permission reasons */

    if(link->srcpic) {

        avcodec_get_chroma_sub_sample(link->format, &hsub, &vsub);



        src[0] = link->srcpic-> data[0] + y * link->srcpic-> linesize[0];

        dst[0] = link->cur_pic->data[0] + y * link->cur_pic->linesize[0];

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

            if(link->srcpic->data[i]) {

                src[i] = link->srcpic-> data[i] + (y >> vsub) * link->srcpic-> linesize[i];

                dst[i] = link->cur_pic->data[i] + (y >> vsub) * link->cur_pic->linesize[i];

            } else

                src[i] = dst[i] = NULL;

        }

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

            memcpy(dst[0], src[0], link->cur_pic->linesize[0]);

            src[0] += link->srcpic ->linesize[0];

            dst[0] += link->cur_pic->linesize[0];

        }

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

            if(!src[i]) continue;



            for(j = 0; j < h >> vsub; j ++) {

                memcpy(dst[i], src[i], link->cur_pic->linesize[i]);

                src[i] += link->srcpic ->linesize[i];

                dst[i] += link->cur_pic->linesize[i];

            }

        }

    }



    if(!link_dpad(link).draw_slice)

        return;



    link_dpad(link).draw_slice(link, y, h);

}

void avfilter_draw_slice(AVFilterLink *link, int y, int h)

{

    uint8_t *src[4], *dst[4];

    int i, j, hsub, vsub;



    

    if(link->srcpic) {

        avcodec_get_chroma_sub_sample(link->format, &hsub, &vsub);



        src[0] = link->srcpic-> data[0] + y * link->srcpic-> linesize[0];

        dst[0] = link->cur_pic->data[0] + y * link->cur_pic->linesize[0];

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

            if(link->srcpic->data[i]) {

                src[i] = link->srcpic-> data[i] + (y >> vsub) * link->srcpic-> linesize[i];

                dst[i] = link->cur_pic->data[i] + (y >> vsub) * link->cur_pic->linesize[i];

            } else

                src[i] = dst[i] = NULL;

        }

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

            memcpy(dst[0], src[0], link->cur_pic->linesize[0]);

            src[0] += link->srcpic ->linesize[0];

            dst[0] += link->cur_pic->linesize[0];

        }

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

            if(!src[i]) continue;



            for(j = 0; j < h >> vsub; j ++) {

                memcpy(dst[i], src[i], link->cur_pic->linesize[i]);

                src[i] += link->srcpic ->linesize[i];

                dst[i] += link->cur_pic->linesize[i];

            }

        }

    }



    if(!link_dpad(link).draw_slice)

        return;



    link_dpad(link).draw_slice(link, y, h);

}

void FUNC_0(AVFilterLink *VAR_0, int VAR_1, int VAR_2)

{

    uint8_t *src[4], *dst[4];

    int VAR_3, VAR_4, VAR_5, VAR_6;



    

    if(VAR_0->srcpic) {

        avcodec_get_chroma_sub_sample(VAR_0->format, &VAR_5, &VAR_6);



        src[0] = VAR_0->srcpic-> data[0] + VAR_1 * VAR_0->srcpic-> linesize[0];

        dst[0] = VAR_0->cur_pic->data[0] + VAR_1 * VAR_0->cur_pic->linesize[0];

        for(VAR_3 = 1; VAR_3 < 4; VAR_3 ++) {

            if(VAR_0->srcpic->data[VAR_3]) {

                src[VAR_3] = VAR_0->srcpic-> data[VAR_3] + (VAR_1 >> VAR_6) * VAR_0->srcpic-> linesize[VAR_3];

                dst[VAR_3] = VAR_0->cur_pic->data[VAR_3] + (VAR_1 >> VAR_6) * VAR_0->cur_pic->linesize[VAR_3];

            } else

                src[VAR_3] = dst[VAR_3] = NULL;

        }

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

            memcpy(dst[0], src[0], VAR_0->cur_pic->linesize[0]);

            src[0] += VAR_0->srcpic ->linesize[0];

            dst[0] += VAR_0->cur_pic->linesize[0];

        }

        for(VAR_3 = 1; VAR_3 < 4; VAR_3 ++) {

            if(!src[VAR_3]) continue;



            for(VAR_4 = 0; VAR_4 < VAR_2 >> VAR_6; VAR_4 ++) {

                memcpy(dst[VAR_3], src[VAR_3], VAR_0->cur_pic->linesize[VAR_3]);

                src[VAR_3] += VAR_0->srcpic ->linesize[VAR_3];

                dst[VAR_3] += VAR_0->cur_pic->linesize[VAR_3];

            }

        }

    }



    if(!link_dpad(VAR_0).draw_slice)

        return;



    link_dpad(VAR_0).draw_slice(VAR_0, VAR_1, VAR_2);

}

void FUNC_0(AVFilterLink *VAR_0, int VAR_1, int VAR_2)
{ uint8_t *src[4], *dst[4]; int VAR_3, VAR_4, VAR_5, VAR_6; if(VAR_0->srcpic) { avcodec_get_chroma_sub_sample(VAR_0->format, &VAR_5, &VAR_6); src[0] = VAR_0->srcpic-> data[0] + VAR_1 * VAR_0->srcpic-> linesize[0]; dst[0] = VAR_0->cur_pic->data[0] + VAR_1 * VAR_0->cur_pic->linesize[0]; for(VAR_3 = 1; VAR_3 < 4; VAR_3 ++) { if(VAR_0->srcpic->data[VAR_3]) { src[VAR_3] = VAR_0->srcpic-> data[VAR_3] + (VAR_1 >> VAR_6) * VAR_0->srcpic-> linesize[VAR_3]; dst[VAR_3] = VAR_0->cur_pic->data[VAR_3] + (VAR_1 >> VAR_6) * VAR_0->cur_pic->linesize[VAR_3]; } else src[VAR_3] = dst[VAR_3] = NULL; } for(VAR_4 = 0; VAR_4 < VAR_2; VAR_4 ++) { memcpy(dst[0], src[0], VAR_0->cur_pic->linesize[0]); src[0] += VAR_0->srcpic ->linesize[0]; dst[0] += VAR_0->cur_pic->linesize[0]; } for(VAR_3 = 1; VAR_3 < 4; VAR_3 ++) { if(!src[VAR_3]) continue; for(VAR_4 = 0; VAR_4 < VAR_2 >> VAR_6; VAR_4 ++) { memcpy(dst[VAR_3], src[VAR_3], VAR_0->cur_pic->linesize[VAR_3]); src[VAR_3] += VAR_0->srcpic ->linesize[VAR_3]; dst[VAR_3] += VAR_0->cur_pic->linesize[VAR_3]; } } } if(!link_dpad(VAR_0).draw_slice)
return; link_dpad(VAR_0).draw_slice(VAR_0, VAR_1, VAR_2); }