changeset 34932:19212dea7a97

Add missing aequivalents for PIX_FMT_GRAY8A and PIX_FMT_GRAY16*.
author cehoyos
date Sun, 15 Jul 2012 20:27:13 +0000
parents ad37bf19d46a
children 83472bed2012
files codec-cfg.c fmt-conversion.c libmpcodecs/img_format.c libmpcodecs/img_format.h libmpcodecs/mp_image.c libmpcodecs/vf_scale.c m_option.c
diffstat 7 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/codec-cfg.c	Sun Jul 15 13:07:46 2012 +0000
+++ b/codec-cfg.c	Sun Jul 15 20:27:13 2012 +0000
@@ -200,7 +200,11 @@
     {"411P",        IMGFMT_411P},
     {"440P",        IMGFMT_440P},
     {"Y800",        IMGFMT_Y800},
+    {"Y8A",         IMGFMT_Y8A},
     {"Y8",          IMGFMT_Y8},
+    {"Y16",         IMGFMT_Y16},
+    {"Y16LE",       IMGFMT_Y16_LE},
+    {"Y16BE",       IMGFMT_Y16_BE},
 
     {"YUY2",        IMGFMT_YUY2},
     {"UYVY",        IMGFMT_UYVY},
--- a/fmt-conversion.c	Sun Jul 15 13:07:46 2012 +0000
+++ b/fmt-conversion.c	Sun Jul 15 20:27:13 2012 +0000
@@ -86,7 +86,10 @@
     {IMGFMT_444P14_BE,  PIX_FMT_YUV444P14BE},
     {IMGFMT_444P12_LE,  PIX_FMT_YUV444P12LE},
     {IMGFMT_444P12_BE,  PIX_FMT_YUV444P12BE},
+    {IMGFMT_Y8A,        PIX_FMT_GRAY8A},
 #endif
+    {IMGFMT_Y16_LE,  PIX_FMT_GRAY16LE},
+    {IMGFMT_Y16_BE,  PIX_FMT_GRAY16BE},
     {IMGFMT_YUY2,    PIX_FMT_YUYV422},
     {IMGFMT_UYVY,    PIX_FMT_UYVY422},
     {IMGFMT_NV12,    PIX_FMT_NV12},
--- a/libmpcodecs/img_format.c	Sun Jul 15 13:07:46 2012 +0000
+++ b/libmpcodecs/img_format.c	Sun Jul 15 20:27:13 2012 +0000
@@ -63,6 +63,9 @@
     case IMGFMT_CLPL:    return "Planar CLPL";
     case IMGFMT_Y800:    return "Planar Y800";
     case IMGFMT_Y8:      return "Planar Y8";
+    case IMGFMT_Y8A:     return "Planar Y8 with alpha";
+    case IMGFMT_Y16_LE:  return "Planar Y16 little-endian";
+    case IMGFMT_Y16_BE:  return "Planar Y16 big-endian";
     case IMGFMT_420P16_LE: return "Planar 420P 16-bit little-endian";
     case IMGFMT_420P16_BE: return "Planar 420P 16-bit big-endian";
     case IMGFMT_420P14_LE: return "Planar 420P 14-bit little-endian";
--- a/libmpcodecs/img_format.h	Sun Jul 15 13:07:46 2012 +0000
+++ b/libmpcodecs/img_format.h	Sun Jul 15 20:27:13 2012 +0000
@@ -124,6 +124,7 @@
 #define IMGFMT_Y8   0x20203859
 #define IMGFMT_NV12 0x3231564E
 #define IMGFMT_NV21 0x3132564E
+#define IMGFMT_Y16_LE 0x20363159
 
 /* unofficial Planar Formats, FIXME if official 4CC exists */
 #define IMGFMT_444P 0x50343434
@@ -131,7 +132,10 @@
 #define IMGFMT_411P 0x50313134
 #define IMGFMT_440P 0x50303434
 #define IMGFMT_HM12 0x32314D48
+#define IMGFMT_Y16_BE 0x59313620
 
+// Gray with alpha
+#define IMGFMT_Y8A 0x59320008
 // 4:2:0 planar with alpha
 #define IMGFMT_420A 0x41303234
 // 4:2:2 planar with alpha
@@ -185,6 +189,7 @@
 #define IMGFMT_420P12 IMGFMT_420P12_BE
 #define IMGFMT_420P10 IMGFMT_420P10_BE
 #define IMGFMT_420P9  IMGFMT_420P9_BE
+#define IMGFMT_Y16    IMGFMT_Y16_BE
 #define IMGFMT_IS_YUVP16_NE(fmt) IMGFMT_IS_YUVP16_BE(fmt)
 #else
 #define IMGFMT_444P16 IMGFMT_444P16_LE
@@ -202,6 +207,7 @@
 #define IMGFMT_420P12 IMGFMT_420P12_LE
 #define IMGFMT_420P10 IMGFMT_420P10_LE
 #define IMGFMT_420P9  IMGFMT_420P9_LE
+#define IMGFMT_Y16    IMGFMT_Y16_LE
 #define IMGFMT_IS_YUVP16_NE(fmt) IMGFMT_IS_YUVP16_LE(fmt)
 #endif
 
--- a/libmpcodecs/mp_image.c	Sun Jul 15 13:07:46 2012 +0000
+++ b/libmpcodecs/mp_image.c	Sun Jul 15 20:27:13 2012 +0000
@@ -189,12 +189,18 @@
     case IMGFMT_420P9_LE:
     case IMGFMT_420P9_BE:
         return;
+    case IMGFMT_Y16_LE:
+    case IMGFMT_Y16_BE:
+        mpi->bpp=16;
     case IMGFMT_Y800:
     case IMGFMT_Y8:
         /* they're planar ones, but for easier handling use them as packed */
         mpi->flags&=~MP_IMGFLAG_PLANAR;
         mpi->num_planes=1;
         return;
+    case IMGFMT_Y8A:
+        mpi->num_planes=2;
+        return;
     case IMGFMT_UYVY:
         mpi->flags|=MP_IMGFLAG_SWAPPED;
     case IMGFMT_YUY2:
--- a/libmpcodecs/vf_scale.c	Sun Jul 15 13:07:46 2012 +0000
+++ b/libmpcodecs/vf_scale.c	Sun Jul 15 20:27:13 2012 +0000
@@ -131,6 +131,9 @@
     IMGFMT_RGB12,
     IMGFMT_Y800,
     IMGFMT_Y8,
+    IMGFMT_Y8A,
+    IMGFMT_Y16_LE,
+    IMGFMT_Y16_BE,
     IMGFMT_BGR8,
     IMGFMT_RGB8,
     IMGFMT_BGR4,
--- a/m_option.c	Sun Jul 15 13:07:46 2012 +0000
+++ b/m_option.c	Sun Jul 15 20:27:13 2012 +0000
@@ -1125,6 +1125,9 @@
   {"hm12", IMGFMT_HM12},
   {"y800", IMGFMT_Y800},
   {"y8",   IMGFMT_Y8},
+  {"y8a",  IMGFMT_Y8A},
+  {"y16be", IMGFMT_Y16_BE},
+  {"y16le", IMGFMT_Y16_LE},
   {"nv12", IMGFMT_NV12},
   {"nv21", IMGFMT_NV21},
   {"bgr24", IMGFMT_BGR24},