[FFmpeg-devel] [PATCH] turn off deinterlace if not supported by avpicture_deinterlace

Maksym Veremeyenko verem
Mon Oct 19 09:06:31 CEST 2009


Michael Niedermayer ???????(??):
> On Sun, Oct 18, 2009 at 07:53:12PM +0300, Maksym Veremeyenko wrote:
>> Hi,
>>
>> Attached patch turn off deinterlace flag is avpicture_deinterlace do not 
>> support given pixel format. Try to avoid message error "Deinterlacing 
>> failed\n" for each frame.
> 
> deinterlace should not fail, thats a bug
from imgconvert.c:
[...]
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
                           enum PixelFormat pix_fmt, int width, int height)
{
     int i;

     if (pix_fmt != PIX_FMT_YUV420P &&
         pix_fmt != PIX_FMT_YUV422P &&
         pix_fmt != PIX_FMT_YUV444P &&
         pix_fmt != PIX_FMT_YUV411P &&
         pix_fmt != PIX_FMT_GRAY8)
         return -1;
[...]
it's seen that video supplied with PIX_FMT_YUVJ422P not supported. in my 
case video recorded by digital photo camera. Also there are could be 
other...

may be it has a sense to add support of PIX_FMT_YUVJ422P if it similar 
to PIX_FMT_YUV422P:

Index: libavcodec/imgconvert.c
===================================================================
--- libavcodec/imgconvert.c	(revision 20263)
+++ libavcodec/imgconvert.c	(working copy)
@@ -1627,6 +1627,7 @@
      int i;

      if (pix_fmt != PIX_FMT_YUV420P &&
+        pix_fmt != PIX_FMT_YUVJ422P &&
          pix_fmt != PIX_FMT_YUV422P &&
          pix_fmt != PIX_FMT_YUV444P &&
          pix_fmt != PIX_FMT_YUV411P &&
@@ -1642,6 +1643,7 @@
                  width >>= 1;
                  height >>= 1;
                  break;
+            case PIX_FMT_YUVJ422P:
              case PIX_FMT_YUV422P:
                  width >>= 1;
                  break;


-- 
________________________________________
Maksym Veremeyenko



More information about the ffmpeg-devel mailing list