changeset 29608:ff34398b14b1

Make 16bit YUV formats compatible with NE avcodec_get_pix_fmt(). Patch by Lars T¸«£uber <lars <dot> taeuber <at> gmx <dot> net>.
author ramiro
date Sat, 05 Sep 2009 23:33:11 +0000
parents 5a46b1a05a32
children 9b0c934c78b5
files libswscale/swscale.c libswscale/swscale_internal.h libswscale/swscale_template.c
diffstat 3 files changed, 54 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/swscale.c	Sat Sep 05 08:48:48 2009 +0000
+++ b/libswscale/swscale.c	Sat Sep 05 23:33:11 2009 +0000
@@ -136,12 +136,12 @@
         || (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 @@
         || (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 @@
         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 @@
         *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 @@
         *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;
--- a/libswscale/swscale_internal.h	Sat Sep 05 08:48:48 2009 +0000
+++ b/libswscale/swscale_internal.h	Sat Sep 05 23:33:11 2009 +0000
@@ -302,12 +302,12 @@
         || (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 @@
     )
 #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     \
--- a/libswscale/swscale_template.c	Sat Sep 05 08:48:48 2009 +0000
+++ b/libswscale/swscale_template.c	Sat Sep 05 23:33:11 2009 +0000
@@ -2914,12 +2914,12 @@
         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 @@
     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;