[FFmpeg-devel] [PATCH] libavfilter: yadif pix_fmt priority

Robert Nagy ronag89 at gmail.com
Sun Dec 4 11:44:47 CET 2011


Warning, handwritten patch.

Problem: yuv420p is prioritized over yuv422p and yuv444p even though
conversion to the higher quality formats is more appropriate, e.g.
currently the graph will auto insert before the yadif filter the conversion
uyvy422 -> yuv420p, instead of uyvy422 -> yuv422p.

Reverse the pixel format listing of these formats. *I'm not sure this patch
solves the problem.*

static int query_formats(AVFilterContext *ctx)
{
    static const enum PixelFormat pix_fmts[] = {
-        PIX_FMT_YUV420P,
-        PIX_FMT_YUV422P,
-        PIX_FMT_YUV444P,
+       PIX_FMT_YUV444P,
+       PIX_FMT_YUV422P,
+       PIX_FMT_YUV420P,
         PIX_FMT_YUV410P,
         PIX_FMT_YUV411P,
         PIX_FMT_GRAY8,
-        PIX_FMT_YUVJ420P,
-        PIX_FMT_YUVJ422P,
-        PIX_FMT_YUVJ444P,
+       PIX_FMT_YUVJ444P,
+       PIX_FMT_YUVJ422P,
+       PIX_FMT_YUVJ420P,
         AV_NE( PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE ),
         PIX_FMT_YUV440P,
         PIX_FMT_YUVJ440P,
-        AV_NE( PIX_FMT_YUV420P16BE, PIX_FMT_YUV420P16LE ),
-        AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ),
-        AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ),
+       AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ),
+       AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ),
+       AV_NE( PIX_FMT_YUV420P16BE, PIX_FMT_YUV420P16LE ),
         PIX_FMT_YUVA420P,
         PIX_FMT_NONE
    };

    avfilter_set_common_pixel_formats(ctx,
avfilter_make_format_list(pix_fmts));

    return 0;
}


More information about the ffmpeg-devel mailing list