[MPlayer-cvslog] r33451 - in trunk: codec-cfg.c etc/codecs.conf fmt-conversion.c libmpcodecs/img_format.c libmpcodecs/img_format.h libmpcodecs/mp_image.c libmpcodecs/vf_scale.c m_option.c

cehoyos subversion at mplayerhq.hu
Tue May 10 10:42:53 CEST 2011


Author: cehoyos
Date: Tue May 10 10:42:52 2011
New Revision: 33451

Log:
Support displaying of 9- and 10-bit pixel formats,
as used by v210 and H264.

Patch by Arne Bochem, arneb D mp a ccan D de

Modified:
   trunk/codec-cfg.c
   trunk/etc/codecs.conf
   trunk/fmt-conversion.c
   trunk/libmpcodecs/img_format.c
   trunk/libmpcodecs/img_format.h
   trunk/libmpcodecs/mp_image.c
   trunk/libmpcodecs/vf_scale.c
   trunk/m_option.c

Modified: trunk/codec-cfg.c
==============================================================================
--- trunk/codec-cfg.c	Mon May  9 20:47:27 2011	(r33450)
+++ trunk/codec-cfg.c	Tue May 10 10:42:52 2011	(r33451)
@@ -179,7 +179,10 @@ static const struct {
     {"420P16BE", IMGFMT_420P16_BE},
     {"444P16", IMGFMT_444P16},
     {"422P16", IMGFMT_422P16},
+    {"422P10", IMGFMT_422P10},
     {"420P16", IMGFMT_420P16},
+    {"420P10", IMGFMT_420P10},
+    {"420P9", IMGFMT_420P9},
     {"420A",  IMGFMT_420A},
     {"444P",  IMGFMT_444P},
     {"422P",  IMGFMT_422P},

Modified: trunk/etc/codecs.conf
==============================================================================
--- trunk/etc/codecs.conf	Mon May  9 20:47:27 2011	(r33450)
+++ trunk/etc/codecs.conf	Tue May 10 10:42:52 2011	(r33451)
@@ -1064,7 +1064,7 @@ videocodec ffh264
   format 0x10000005
   driver ffmpeg
   dll h264
-  out YV12,I420,IYUV
+  out YV12,I420,IYUV,420P10,420P9
 
 videocodec ffh264vdpau
   info "FFmpeg H.264 (VDPAU)"
@@ -3003,7 +3003,7 @@ videocodec ffv210
   fourcc v210
   driver ffmpeg
   dll v210
-  out 422P16
+  out 422P10
 
 videocodec qtcine
   info "cinewave uncompressed 10-bit codec"

Modified: trunk/fmt-conversion.c
==============================================================================
--- trunk/fmt-conversion.c	Mon May  9 20:47:27 2011	(r33450)
+++ trunk/fmt-conversion.c	Tue May 10 10:42:52 2011	(r33451)
@@ -76,8 +76,14 @@ static const struct {
 
     {IMGFMT_420P16_LE,  PIX_FMT_YUV420P16LE},
     {IMGFMT_420P16_BE,  PIX_FMT_YUV420P16BE},
+    {IMGFMT_420P10_LE,  PIX_FMT_YUV420P10LE},
+    {IMGFMT_420P10_BE,  PIX_FMT_YUV420P10BE},
+    {IMGFMT_420P9_LE,   PIX_FMT_YUV420P9LE},
+    {IMGFMT_420P9_BE,   PIX_FMT_YUV420P9BE},
     {IMGFMT_422P16_LE,  PIX_FMT_YUV422P16LE},
     {IMGFMT_422P16_BE,  PIX_FMT_YUV422P16BE},
+    {IMGFMT_422P10_LE,  PIX_FMT_YUV422P10LE},
+    {IMGFMT_422P10_BE,  PIX_FMT_YUV422P10BE},
     {IMGFMT_444P16_LE,  PIX_FMT_YUV444P16LE},
     {IMGFMT_444P16_BE,  PIX_FMT_YUV444P16BE},
 

Modified: trunk/libmpcodecs/img_format.c
==============================================================================
--- trunk/libmpcodecs/img_format.c	Mon May  9 20:47:27 2011	(r33450)
+++ trunk/libmpcodecs/img_format.c	Tue May 10 10:42:52 2011	(r33451)
@@ -59,8 +59,14 @@ const char *vo_format_name(int format)
     case IMGFMT_Y8: return "Planar Y8";
     case IMGFMT_420P16_LE: return "Planar 420P 16-bit little-endian";
     case IMGFMT_420P16_BE: return "Planar 420P 16-bit big-endian";
+    case IMGFMT_420P10_LE: return "Planar 420P 10-bit little-endian";
+    case IMGFMT_420P10_BE: return "Planar 420P 10-bit big-endian";
+    case IMGFMT_420P9_LE: return "Planar 420P 9-bit little-endian";
+    case IMGFMT_420P9_BE: return "Planar 420P 9-bit big-endian";
     case IMGFMT_422P16_LE: return "Planar 422P 16-bit little-endian";
     case IMGFMT_422P16_BE: return "Planar 422P 16-bit big-endian";
+    case IMGFMT_422P10_LE: return "Planar 422P 10-bit little-endian";
+    case IMGFMT_422P10_BE: return "Planar 422P 10-bit big-endian";
     case IMGFMT_444P16_LE: return "Planar 444P 16-bit little-endian";
     case IMGFMT_444P16_BE: return "Planar 444P 16-bit big-endian";
     case IMGFMT_420A: return "Planar 420P with alpha";
@@ -116,6 +122,10 @@ int mp_get_chroma_shift(int format, int 
     switch (format) {
     case IMGFMT_420P16_LE:
     case IMGFMT_420P16_BE:
+    case IMGFMT_420P10_LE:
+    case IMGFMT_420P10_BE:
+    case IMGFMT_420P9_LE:
+    case IMGFMT_420P9_BE:
         bpp_factor = 2;
     case IMGFMT_420A:
     case IMGFMT_I420:
@@ -138,6 +148,8 @@ int mp_get_chroma_shift(int format, int 
         break;
     case IMGFMT_422P16_LE:
     case IMGFMT_422P16_BE:
+    case IMGFMT_422P10_LE:
+    case IMGFMT_422P10_BE:
         bpp_factor = 2;
     case IMGFMT_422P:
         xs = 1;

Modified: trunk/libmpcodecs/img_format.h
==============================================================================
--- trunk/libmpcodecs/img_format.h	Mon May  9 20:47:27 2011	(r33450)
+++ trunk/libmpcodecs/img_format.h	Tue May 10 10:42:52 2011	(r33451)
@@ -125,22 +125,34 @@
 #define IMGFMT_444P16_BE 0x34343451
 #define IMGFMT_422P16_LE 0x51323234
 #define IMGFMT_422P16_BE 0x34323251
+#define IMGFMT_422P10_LE 0x52323234
+#define IMGFMT_422P10_BE 0x34323252
 #define IMGFMT_420P16_LE 0x51303234
 #define IMGFMT_420P16_BE 0x34323051
+#define IMGFMT_420P10_LE 0x52303234
+#define IMGFMT_420P10_BE 0x34323052
+#define IMGFMT_420P9_LE 0x53303234
+#define IMGFMT_420P9_BE 0x34323053
 #if HAVE_BIGENDIAN
 #define IMGFMT_444P16 IMGFMT_444P16_BE
 #define IMGFMT_422P16 IMGFMT_422P16_BE
+#define IMGFMT_422P10 IMGFMT_422P10_BE
 #define IMGFMT_420P16 IMGFMT_420P16_BE
+#define IMGFMT_420P10 IMGFMT_420P10_BE
+#define IMGFMT_420P9 IMGFMT_420P9_BE
 #define IMGFMT_IS_YUVP16_NE(fmt) IMGFMT_IS_YUVP16_BE(fmt)
 #else
 #define IMGFMT_444P16 IMGFMT_444P16_LE
 #define IMGFMT_422P16 IMGFMT_422P16_LE
+#define IMGFMT_422P10 IMGFMT_422P10_LE
 #define IMGFMT_420P16 IMGFMT_420P16_LE
+#define IMGFMT_420P10 IMGFMT_420P10_LE
+#define IMGFMT_420P9 IMGFMT_420P9_LE
 #define IMGFMT_IS_YUVP16_NE(fmt) IMGFMT_IS_YUVP16_LE(fmt)
 #endif
 
-#define IMGFMT_IS_YUVP16_LE(fmt) (((fmt  ^ IMGFMT_420P16_LE) & 0xff0000ff) == 0)
-#define IMGFMT_IS_YUVP16_BE(fmt) (((fmt  ^ IMGFMT_420P16_BE) & 0xff0000ff) == 0)
+#define IMGFMT_IS_YUVP16_LE(fmt) (((fmt - 0x51000034) & 0xfc0000ff) == 0)
+#define IMGFMT_IS_YUVP16_BE(fmt) (((fmt - 0x34000051) & 0xff0000fc) == 0)
 #define IMGFMT_IS_YUVP16(fmt)    (IMGFMT_IS_YUVP16_LE(fmt) || IMGFMT_IS_YUVP16_BE(fmt))
 
 /* Packed YUV Formats */

Modified: trunk/libmpcodecs/mp_image.c
==============================================================================
--- trunk/libmpcodecs/mp_image.c	Mon May  9 20:47:27 2011	(r33450)
+++ trunk/libmpcodecs/mp_image.c	Tue May 10 10:42:52 2011	(r33451)
@@ -147,8 +147,14 @@ void mp_image_setfmt(mp_image_t* mpi,uns
     case IMGFMT_444P16_BE:
     case IMGFMT_422P16_LE:
     case IMGFMT_422P16_BE:
+    case IMGFMT_422P10_LE:
+    case IMGFMT_422P10_BE:
     case IMGFMT_420P16_LE:
     case IMGFMT_420P16_BE:
+    case IMGFMT_420P10_LE:
+    case IMGFMT_420P10_BE:
+    case IMGFMT_420P9_LE:
+    case IMGFMT_420P9_BE:
         return;
     case IMGFMT_Y800:
     case IMGFMT_Y8:

Modified: trunk/libmpcodecs/vf_scale.c
==============================================================================
--- trunk/libmpcodecs/vf_scale.c	Mon May  9 20:47:27 2011	(r33450)
+++ trunk/libmpcodecs/vf_scale.c	Tue May 10 10:42:52 2011	(r33451)
@@ -71,10 +71,16 @@ static const unsigned int outfmt_list[]=
     IMGFMT_422P,
     IMGFMT_422P16_LE,
     IMGFMT_422P16_BE,
+    IMGFMT_422P10_LE,
+    IMGFMT_422P10_BE,
     IMGFMT_YV12,
     IMGFMT_I420,
     IMGFMT_420P16_LE,
     IMGFMT_420P16_BE,
+    IMGFMT_420P10_LE,
+    IMGFMT_420P10_BE,
+    IMGFMT_420P9_LE,
+    IMGFMT_420P9_BE,
     IMGFMT_420A,
     IMGFMT_IYUV,
     IMGFMT_YVU9,

Modified: trunk/m_option.c
==============================================================================
--- trunk/m_option.c	Mon May  9 20:47:27 2011	(r33450)
+++ trunk/m_option.c	Tue May 10 10:42:52 2011	(r33451)
@@ -1054,11 +1054,20 @@ static struct {
   {"444p16be", IMGFMT_444P16_BE},
   {"422p16le", IMGFMT_422P16_LE},
   {"422p16be", IMGFMT_422P16_BE},
+  {"422p10le", IMGFMT_422P10_LE},
+  {"422p10be", IMGFMT_422P10_BE},
   {"420p16le", IMGFMT_420P16_LE},
   {"420p16be", IMGFMT_420P16_BE},
+  {"420p10le", IMGFMT_420P10_LE},
+  {"420p10be", IMGFMT_420P10_BE},
+  {"420p9le", IMGFMT_420P9_LE},
+  {"420p9be", IMGFMT_420P9_BE},
   {"444p16", IMGFMT_444P16},
   {"422p16", IMGFMT_422P16},
+  {"422p10", IMGFMT_422P10},
   {"420p16", IMGFMT_420P16},
+  {"420p10", IMGFMT_420P10},
+  {"420p9", IMGFMT_420P9},
   {"420a", IMGFMT_420A},
   {"444p", IMGFMT_444P},
   {"422p", IMGFMT_422P},


More information about the MPlayer-cvslog mailing list