int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,

                          enum AVPixelFormat pix_fmt, int width, int height)

{

    int i;



    if (pix_fmt != AV_PIX_FMT_YUV420P &&

        pix_fmt != AV_PIX_FMT_YUVJ420P &&

        pix_fmt != AV_PIX_FMT_YUV422P &&

        pix_fmt != AV_PIX_FMT_YUVJ422P &&

        pix_fmt != AV_PIX_FMT_YUV444P &&

        pix_fmt != AV_PIX_FMT_YUV411P &&

        pix_fmt != AV_PIX_FMT_GRAY8)

        return -1;

    if ((width & 3) != 0 || (height & 3) != 0)

        return -1;



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

        if (i == 1) {

            switch(pix_fmt) {

            case AV_PIX_FMT_YUVJ420P:

            case AV_PIX_FMT_YUV420P:

                width >>= 1;

                height >>= 1;

                break;

            case AV_PIX_FMT_YUV422P:

            case AV_PIX_FMT_YUVJ422P:

                width >>= 1;

                break;

            case AV_PIX_FMT_YUV411P:

                width >>= 2;

                break;

            default:

                break;

            }

            if (pix_fmt == AV_PIX_FMT_GRAY8) {

                break;

            }

        }

        if (src == dst) {

            deinterlace_bottom_field_inplace(dst->data[i], dst->linesize[i],

                                 width, height);

        } else {

            deinterlace_bottom_field(dst->data[i],dst->linesize[i],

                                        src->data[i], src->linesize[i],

                                        width, height);

        }

    }

    emms_c();

    return 0;

}

int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,

                          enum AVPixelFormat pix_fmt, int width, int height)

{

    int i;



    if (pix_fmt != AV_PIX_FMT_YUV420P &&

        pix_fmt != AV_PIX_FMT_YUVJ420P &&

        pix_fmt != AV_PIX_FMT_YUV422P &&

        pix_fmt != AV_PIX_FMT_YUVJ422P &&

        pix_fmt != AV_PIX_FMT_YUV444P &&

        pix_fmt != AV_PIX_FMT_YUV411P &&

        pix_fmt != AV_PIX_FMT_GRAY8)

        return -1;

    if ((width & 3) != 0 || (height & 3) != 0)

        return -1;



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

        if (i == 1) {

            switch(pix_fmt) {

            case AV_PIX_FMT_YUVJ420P:

            case AV_PIX_FMT_YUV420P:

                width >>= 1;

                height >>= 1;

                break;

            case AV_PIX_FMT_YUV422P:

            case AV_PIX_FMT_YUVJ422P:

                width >>= 1;

                break;

            case AV_PIX_FMT_YUV411P:

                width >>= 2;

                break;

            default:

                break;

            }

            if (pix_fmt == AV_PIX_FMT_GRAY8) {

                break;

            }

        }

        if (src == dst) {

            deinterlace_bottom_field_inplace(dst->data[i], dst->linesize[i],

                                 width, height);

        } else {

            deinterlace_bottom_field(dst->data[i],dst->linesize[i],

                                        src->data[i], src->linesize[i],

                                        width, height);

        }

    }

    emms_c();

    return 0;

}

int FUNC_0(AVPicture *VAR_0, const AVPicture *VAR_1,

                          enum AVPixelFormat VAR_2, int VAR_3, int VAR_4)

{

    int VAR_5;



    if (VAR_2 != AV_PIX_FMT_YUV420P &&

        VAR_2 != AV_PIX_FMT_YUVJ420P &&

        VAR_2 != AV_PIX_FMT_YUV422P &&

        VAR_2 != AV_PIX_FMT_YUVJ422P &&

        VAR_2 != AV_PIX_FMT_YUV444P &&

        VAR_2 != AV_PIX_FMT_YUV411P &&

        VAR_2 != AV_PIX_FMT_GRAY8)

        return -1;

    if ((VAR_3 & 3) != 0 || (VAR_4 & 3) != 0)

        return -1;



    for(VAR_5=0;VAR_5<3;VAR_5++) {

        if (VAR_5 == 1) {

            switch(VAR_2) {

            case AV_PIX_FMT_YUVJ420P:

            case AV_PIX_FMT_YUV420P:

                VAR_3 >>= 1;

                VAR_4 >>= 1;

                break;

            case AV_PIX_FMT_YUV422P:

            case AV_PIX_FMT_YUVJ422P:

                VAR_3 >>= 1;

                break;

            case AV_PIX_FMT_YUV411P:

                VAR_3 >>= 2;

                break;

            default:

                break;

            }

            if (VAR_2 == AV_PIX_FMT_GRAY8) {

                break;

            }

        }

        if (VAR_1 == VAR_0) {

            deinterlace_bottom_field_inplace(VAR_0->data[VAR_5], VAR_0->linesize[VAR_5],

                                 VAR_3, VAR_4);

        } else {

            deinterlace_bottom_field(VAR_0->data[VAR_5],VAR_0->linesize[VAR_5],

                                        VAR_1->data[VAR_5], VAR_1->linesize[VAR_5],

                                        VAR_3, VAR_4);

        }

    }

    emms_c();

    return 0;

}

int FUNC_0(AVPicture *VAR_0, const AVPicture *VAR_1,
enum AVPixelFormat VAR_2, int VAR_3, int VAR_4)
{ int VAR_5; if (VAR_2 != AV_PIX_FMT_YUV420P &&
VAR_2 != AV_PIX_FMT_YUVJ420P &&
VAR_2 != AV_PIX_FMT_YUV422P &&
VAR_2 != AV_PIX_FMT_YUVJ422P &&
VAR_2 != AV_PIX_FMT_YUV444P &&
VAR_2 != AV_PIX_FMT_YUV411P &&
VAR_2 != AV_PIX_FMT_GRAY8)
return -1; if ((VAR_3 & 3) != 0 || (VAR_4 & 3) != 0)
return -1; for(VAR_5=0;VAR_5<3;VAR_5++) { if (VAR_5 == 1) { switch(VAR_2) { case AV_PIX_FMT_YUVJ420P:
case AV_PIX_FMT_YUV420P:
VAR_3 >>= 1; VAR_4 >>= 1; break; case AV_PIX_FMT_YUV422P:
case AV_PIX_FMT_YUVJ422P:
VAR_3 >>= 1; break; case AV_PIX_FMT_YUV411P:
VAR_3 >>= 2; break; default:
break; } if (VAR_2 == AV_PIX_FMT_GRAY8) { break; } } if (VAR_1 == VAR_0) { deinterlace_bottom_field_inplace(VAR_0->data[VAR_5], VAR_0->linesize[VAR_5],
VAR_3, VAR_4); } else { deinterlace_bottom_field(VAR_0->data[VAR_5],VAR_0->linesize[VAR_5],
VAR_1->data[VAR_5], VAR_1->linesize[VAR_5],
VAR_3, VAR_4); } } emms_c(); return 0; }