[vlc-devel] [PATCH] avcodec: Add mapping for 12-bit GBR

Kieran Kunhya kieran618 at googlemail.com
Sat Feb 27 22:53:17 CET 2016


There's no specific version of libavutil corresponding to the FFmpeg-only
addition of GBRP12 so use the same one as XYZ

Untested but should work
---
 modules/codec/avcodec/chroma.c | 5 ++++-
 src/misc/fourcc.c              | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/chroma.c b/modules/codec/avcodec/chroma.c
index f1d9b41..13fe9bf 100644
--- a/modules/codec/avcodec/chroma.c
+++ b/modules/codec/avcodec/chroma.c
@@ -140,8 +140,11 @@ static const struct
     {VLC_CODEC_GBR_PLANAR_10L, AV_PIX_FMT_GBRP10LE, 0, 0, 0 },
     {VLC_CODEC_GBR_PLANAR_10B, AV_PIX_FMT_GBRP10BE, 0, 0, 0 },
 
-    /* XYZ */
 #if LIBAVUTIL_VERSION_CHECK(52, 10, 0, 25, 100)
+    {VLC_CODEC_GBR_PLANAR_12L, AV_PIX_FMT_GBRP12LE, 0, 0, 0 },
+    {VLC_CODEC_GBR_PLANAR_12B, AV_PIX_FMT_GBRP12BE, 0, 0, 0 },
+
+    /* XYZ */
     {VLC_CODEC_XYZ12, AV_PIX_FMT_XYZ12, 0xfff0, 0xfff0, 0xfff0},
 #endif
     { 0, 0, 0, 0, 0 }
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 84cd034..c11382d 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -594,6 +594,8 @@ static const struct
         VLC_CODEC_GBR_PLANAR_9B },             PLANAR_16(3, 1, 1, 9) },
     { { VLC_CODEC_GBR_PLANAR_10L,
         VLC_CODEC_GBR_PLANAR_10B },            PLANAR_16(3, 1, 1, 10) },
+    { { VLC_CODEC_GBR_PLANAR_12L,
+        VLC_CODEC_GBR_PLANAR_12B },            PLANAR_16(3, 1, 1, 12) },
 
     { { VLC_CODEC_I420_10L,
         VLC_CODEC_I420_10B },                  PLANAR_16(3, 2, 2, 10) },
-- 
1.9.1



More information about the vlc-devel mailing list