static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void **bufp)

{

    AVCodecContext *dec;

    AVPicture *picture2;

    AVPicture picture_tmp;

    uint8_t *buf = 0;



    dec = ist->st->codec;



    /* deinterlace : must be done before any resize */

    if (FF_API_DEINTERLACE && do_deinterlace) {

        int size;



        /* create temporary picture */

        size = avpicture_get_size(dec->pix_fmt, dec->width, dec->height);

        if (size < 0)

            return;

        buf  = av_malloc(size);

        if (!buf)

            return;



        picture2 = &picture_tmp;

        avpicture_fill(picture2, buf, dec->pix_fmt, dec->width, dec->height);



        if (avpicture_deinterlace(picture2, picture,

                                 dec->pix_fmt, dec->width, dec->height) < 0) {

            /* if error, do not deinterlace */

            av_log(NULL, AV_LOG_WARNING, "Deinterlacing failed\n");

            av_free(buf);

            buf = NULL;

            picture2 = picture;

        }

    } else {

        picture2 = picture;

    }



    if (picture != picture2)

        *picture = *picture2;

    *bufp = buf;

}

static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void **bufp)

{

    AVCodecContext *dec;

    AVPicture *picture2;

    AVPicture picture_tmp;

    uint8_t *buf = 0;



    dec = ist->st->codec;



    

    if (FF_API_DEINTERLACE && do_deinterlace) {

        int size;



        

        size = avpicture_get_size(dec->pix_fmt, dec->width, dec->height);

        if (size < 0)

            return;

        buf  = av_malloc(size);

        if (!buf)

            return;



        picture2 = &picture_tmp;

        avpicture_fill(picture2, buf, dec->pix_fmt, dec->width, dec->height);



        if (avpicture_deinterlace(picture2, picture,

                                 dec->pix_fmt, dec->width, dec->height) < 0) {

            

            av_log(NULL, AV_LOG_WARNING, "Deinterlacing failed\n");

            av_free(buf);

            buf = NULL;

            picture2 = picture;

        }

    } else {

        picture2 = picture;

    }



    if (picture != picture2)

        *picture = *picture2;

    *bufp = buf;

}

static void FUNC_0(InputStream *VAR_0, AVPicture *VAR_1, void **VAR_2)

{

    AVCodecContext *dec;

    AVPicture *picture2;

    AVPicture picture_tmp;

    uint8_t *buf = 0;



    dec = VAR_0->st->codec;



    

    if (FF_API_DEINTERLACE && do_deinterlace) {

        int VAR_3;



        

        VAR_3 = avpicture_get_size(dec->pix_fmt, dec->width, dec->height);

        if (VAR_3 < 0)

            return;

        buf  = av_malloc(VAR_3);

        if (!buf)

            return;



        picture2 = &picture_tmp;

        avpicture_fill(picture2, buf, dec->pix_fmt, dec->width, dec->height);



        if (avpicture_deinterlace(picture2, VAR_1,

                                 dec->pix_fmt, dec->width, dec->height) < 0) {

            

            av_log(NULL, AV_LOG_WARNING, "Deinterlacing failed\n");

            av_free(buf);

            buf = NULL;

            picture2 = VAR_1;

        }

    } else {

        picture2 = VAR_1;

    }



    if (VAR_1 != picture2)

        *VAR_1 = *picture2;

    *VAR_2 = buf;

}

static void FUNC_0(InputStream *VAR_0, AVPicture *VAR_1, void **VAR_2)
{ AVCodecContext *dec; AVPicture *picture2; AVPicture picture_tmp; uint8_t *buf = 0; dec = VAR_0->st->codec; if (FF_API_DEINTERLACE && do_deinterlace) { int VAR_3; VAR_3 = avpicture_get_size(dec->pix_fmt, dec->width, dec->height); if (VAR_3 < 0)
return; buf  = av_malloc(VAR_3); if (!buf)
return; picture2 = &picture_tmp; avpicture_fill(picture2, buf, dec->pix_fmt, dec->width, dec->height); if (avpicture_deinterlace(picture2, VAR_1,
dec->pix_fmt, dec->width, dec->height) < 0) { av_log(NULL, AV_LOG_WARNING, "Deinterlacing failed\n"); av_free(buf); buf = NULL; picture2 = VAR_1; } } else { picture2 = VAR_1; } if (VAR_1 != picture2)
*VAR_1 = *picture2; *VAR_2 = buf; }