[FFmpeg-cvslog] r29650 - in trunk/libswscale: swscale.c swscale_internal.h swscale_template.c

ramiro subversion
Sun Sep 6 01:33:11 CEST 2009


Author: ramiro
Date: Sun Sep  6 01:33:11 2009
New Revision: 29650

Log:
Make 16bit YUV formats compatible with NE avcodec_get_pix_fmt().
Patch by Lars T?uber <lars <dot> taeuber <at> gmx <dot> net>.

Modified:
   trunk/libswscale/swscale.c
   trunk/libswscale/swscale_internal.h
   trunk/libswscale/swscale_template.c

Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c	Sat Sep  5 10:48:48 2009	(r29649)
+++ trunk/libswscale/swscale.c	Sun Sep  6 01:33:11 2009	(r29650)
@@ -136,12 +136,12 @@ unsigned swscale_version(void)
         || (x)==PIX_FMT_YUV440P     \
         || (x)==PIX_FMT_MONOWHITE   \
         || (x)==PIX_FMT_MONOBLACK   \
-        || (x)==PIX_FMT_YUV420PLE   \
-        || (x)==PIX_FMT_YUV422PLE   \
-        || (x)==PIX_FMT_YUV444PLE   \
-        || (x)==PIX_FMT_YUV420PBE   \
-        || (x)==PIX_FMT_YUV422PBE   \
-        || (x)==PIX_FMT_YUV444PBE   \
+        || (x)==PIX_FMT_YUV420P16LE   \
+        || (x)==PIX_FMT_YUV422P16LE   \
+        || (x)==PIX_FMT_YUV444P16LE   \
+        || (x)==PIX_FMT_YUV420P16BE   \
+        || (x)==PIX_FMT_YUV422P16BE   \
+        || (x)==PIX_FMT_YUV444P16BE   \
     )
 #define isSupportedOut(x)   (       \
            (x)==PIX_FMT_YUV420P     \
@@ -160,12 +160,12 @@ unsigned swscale_version(void)
         || (x)==PIX_FMT_GRAY8       \
         || (x)==PIX_FMT_YUV410P     \
         || (x)==PIX_FMT_YUV440P     \
-        || (x)==PIX_FMT_YUV420PLE   \
-        || (x)==PIX_FMT_YUV422PLE   \
-        || (x)==PIX_FMT_YUV444PLE   \
-        || (x)==PIX_FMT_YUV420PBE   \
-        || (x)==PIX_FMT_YUV422PBE   \
-        || (x)==PIX_FMT_YUV444PBE   \
+        || (x)==PIX_FMT_YUV420P16LE   \
+        || (x)==PIX_FMT_YUV422P16LE   \
+        || (x)==PIX_FMT_YUV444P16LE   \
+        || (x)==PIX_FMT_YUV420P16BE   \
+        || (x)==PIX_FMT_YUV422P16BE   \
+        || (x)==PIX_FMT_YUV444P16BE   \
     )
 #define isPacked(x)         (       \
            (x)==PIX_FMT_PAL8        \
@@ -459,18 +459,18 @@ const char *sws_format_name(enum PixelFo
         return "vdpau_wmv3";
     case PIX_FMT_VDPAU_VC1:
         return "vdpau_vc1";
-    case PIX_FMT_YUV420PLE:
-        return "yuv420ple";
-    case PIX_FMT_YUV422PLE:
-        return "yuv422ple";
-    case PIX_FMT_YUV444PLE:
-        return "yuv444ple";
-    case PIX_FMT_YUV420PBE:
-        return "yuv420pbe";
-    case PIX_FMT_YUV422PBE:
-        return "yuv422pbe";
-    case PIX_FMT_YUV444PBE:
-        return "yuv444pbe";
+    case PIX_FMT_YUV420P16LE:
+        return "yuv420p16le";
+    case PIX_FMT_YUV422P16LE:
+        return "yuv422p16le";
+    case PIX_FMT_YUV444P16LE:
+        return "yuv444p16le";
+    case PIX_FMT_YUV420P16BE:
+        return "yuv420p16be";
+    case PIX_FMT_YUV422P16BE:
+        return "yuv422p16be";
+    case PIX_FMT_YUV444P16BE:
+        return "yuv444p16be";
     default:
         return "Unknown format";
     }
@@ -2371,8 +2371,8 @@ static void getSubSampleFactors(int *h, 
         *v=0;
         break;
     case PIX_FMT_YUV420P:
-    case PIX_FMT_YUV420PLE:
-    case PIX_FMT_YUV420PBE:
+    case PIX_FMT_YUV420P16LE:
+    case PIX_FMT_YUV420P16BE:
     case PIX_FMT_YUVA420P:
     case PIX_FMT_GRAY16BE:
     case PIX_FMT_GRAY16LE:
@@ -2391,14 +2391,14 @@ static void getSubSampleFactors(int *h, 
         *v=2;
         break;
     case PIX_FMT_YUV444P:
-    case PIX_FMT_YUV444PLE:
-    case PIX_FMT_YUV444PBE:
+    case PIX_FMT_YUV444P16LE:
+    case PIX_FMT_YUV444P16BE:
         *h=0;
         *v=0;
         break;
     case PIX_FMT_YUV422P:
-    case PIX_FMT_YUV422PLE:
-    case PIX_FMT_YUV422PBE:
+    case PIX_FMT_YUV422P16LE:
+    case PIX_FMT_YUV422P16BE:
         *h=1;
         *v=0;
         break;

Modified: trunk/libswscale/swscale_internal.h
==============================================================================
--- trunk/libswscale/swscale_internal.h	Sat Sep  5 10:48:48 2009	(r29649)
+++ trunk/libswscale/swscale_internal.h	Sun Sep  6 01:33:11 2009	(r29650)
@@ -302,12 +302,12 @@ const char *sws_format_name(enum PixelFo
         || (x)==PIX_FMT_GRAY16LE    \
         || (x)==PIX_FMT_RGB48BE     \
         || (x)==PIX_FMT_RGB48LE     \
-        || (x)==PIX_FMT_YUV420PLE   \
-        || (x)==PIX_FMT_YUV422PLE   \
-        || (x)==PIX_FMT_YUV444PLE   \
-        || (x)==PIX_FMT_YUV420PBE   \
-        || (x)==PIX_FMT_YUV422PBE   \
-        || (x)==PIX_FMT_YUV444PBE   \
+        || (x)==PIX_FMT_YUV420P16LE   \
+        || (x)==PIX_FMT_YUV422P16LE   \
+        || (x)==PIX_FMT_YUV444P16LE   \
+        || (x)==PIX_FMT_YUV420P16BE   \
+        || (x)==PIX_FMT_YUV422P16BE   \
+        || (x)==PIX_FMT_YUV444P16BE   \
     )
 #define isBE(x) ((x)&1)
 #define isPlanar8YUV(x) (           \
@@ -323,12 +323,12 @@ const char *sws_format_name(enum PixelFo
     )
 #define isPlanarYUV(x)  (           \
         isPlanar8YUV(x)             \
-        || (x)==PIX_FMT_YUV420PLE   \
-        || (x)==PIX_FMT_YUV422PLE   \
-        || (x)==PIX_FMT_YUV444PLE   \
-        || (x)==PIX_FMT_YUV420PBE   \
-        || (x)==PIX_FMT_YUV422PBE   \
-        || (x)==PIX_FMT_YUV444PBE   \
+        || (x)==PIX_FMT_YUV420P16LE   \
+        || (x)==PIX_FMT_YUV422P16LE   \
+        || (x)==PIX_FMT_YUV444P16LE   \
+        || (x)==PIX_FMT_YUV420P16BE   \
+        || (x)==PIX_FMT_YUV422P16BE   \
+        || (x)==PIX_FMT_YUV444P16BE   \
     )
 #define isYUV(x)        (           \
            (x)==PIX_FMT_UYVY422     \

Modified: trunk/libswscale/swscale_template.c
==============================================================================
--- trunk/libswscale/swscale_template.c	Sat Sep  5 10:48:48 2009	(r29649)
+++ trunk/libswscale/swscale_template.c	Sun Sep  6 01:33:11 2009	(r29650)
@@ -2914,12 +2914,12 @@ static void RENAME(sws_init_swScale)(Sws
         case PIX_FMT_PAL8     :
         case PIX_FMT_BGR4_BYTE:
         case PIX_FMT_RGB4_BYTE: c->hcscale_internal = palToUV; break;
-        case PIX_FMT_YUV420PBE:
-        case PIX_FMT_YUV422PBE:
-        case PIX_FMT_YUV444PBE: c->hcscale_internal = RENAME(BEToUV); break;
-        case PIX_FMT_YUV420PLE:
-        case PIX_FMT_YUV422PLE:
-        case PIX_FMT_YUV444PLE: c->hcscale_internal = RENAME(LEToUV); break;
+        case PIX_FMT_YUV420P16BE:
+        case PIX_FMT_YUV422P16BE:
+        case PIX_FMT_YUV444P16BE: c->hcscale_internal = RENAME(BEToUV); break;
+        case PIX_FMT_YUV420P16LE:
+        case PIX_FMT_YUV422P16LE:
+        case PIX_FMT_YUV444P16LE: c->hcscale_internal = RENAME(LEToUV); break;
     }
     if (c->chrSrcHSubSample) {
         switch(srcFormat) {
@@ -2957,14 +2957,14 @@ static void RENAME(sws_init_swScale)(Sws
     c->hascale_internal = NULL;
     switch (srcFormat) {
     case PIX_FMT_YUYV422  :
-    case PIX_FMT_YUV420PBE:
-    case PIX_FMT_YUV422PBE:
-    case PIX_FMT_YUV444PBE:
+    case PIX_FMT_YUV420P16BE:
+    case PIX_FMT_YUV422P16BE:
+    case PIX_FMT_YUV444P16BE:
     case PIX_FMT_GRAY16BE : c->hyscale_internal = RENAME(yuy2ToY); break;
     case PIX_FMT_UYVY422  :
-    case PIX_FMT_YUV420PLE:
-    case PIX_FMT_YUV422PLE:
-    case PIX_FMT_YUV444PLE:
+    case PIX_FMT_YUV420P16LE:
+    case PIX_FMT_YUV422P16LE:
+    case PIX_FMT_YUV444P16LE:
     case PIX_FMT_GRAY16LE : c->hyscale_internal = RENAME(uyvyToY); break;
     case PIX_FMT_BGR24    : c->hyscale_internal = RENAME(bgr24ToY); break;
     case PIX_FMT_BGR565   : c->hyscale_internal = bgr16ToY; break;



More information about the ffmpeg-cvslog mailing list