[FFmpeg-cvslog] pixfmt: Add GRAY12

Luca Barbato git at videolan.org
Fri Mar 31 00:19:46 EEST 2017


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Thu Nov  3 16:03:54 2016 +0100| [7471352f1915813cda725ce624607d84b5a3a61c] | committer: Luca Barbato

pixfmt: Add GRAY12

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7471352f1915813cda725ce624607d84b5a3a61c
---

 doc/APIchanges      |  3 +++
 libavutil/pixdesc.c | 22 ++++++++++++++++++++++
 libavutil/pixfmt.h  |  4 ++++
 libavutil/version.h |  2 +-
 4 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 735b947..6e0d27d 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil:     2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxxxxxx - lavu 55.28.0 - pixfmt.h
+  Add AV_PIX_FMT_GRAY12(LE/BE).
+
 2016-xx-xx - xxxxxxx - lavu 55.27.0 - hwcontext.h
   Add av_hwframe_map() and associated AV_HWFRAME_MAP_* flags.
   Add av_hwframe_ctx_create_derived().
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 7987f29..db90229 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -493,6 +493,27 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
         },
         .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
     },
+    [AV_PIX_FMT_GRAY12BE] = {
+        .name = "gray12be",
+        .nb_components = 1,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 0, 2, 0, 0, 12, 1, 11, 1 },       /* Y */
+        },
+        .flags = AV_PIX_FMT_FLAG_BE,
+        .alias = "y12be",
+    },
+    [AV_PIX_FMT_GRAY12LE] = {
+        .name = "gray12le",
+        .nb_components = 1,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 0, 2, 0, 0, 12, 1, 11, 1 },       /* Y */
+        },
+        .alias = "y12le",
+    },
     [AV_PIX_FMT_GRAY16BE] = {
         .name = "gray16be",
         .nb_components = 1,
@@ -1950,6 +1971,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
     case AV_PIX_FMT_ ## fmt ## LE: return AV_PIX_FMT_ ## fmt ## BE
 
     switch (pix_fmt) {
+    PIX_FMT_SWAP_ENDIANNESS(GRAY12);
     PIX_FMT_SWAP_ENDIANNESS(GRAY16);
     PIX_FMT_SWAP_ENDIANNESS(YA16);
     PIX_FMT_SWAP_ENDIANNESS(RGB48);
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 0bee724..5a7b78a 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -245,6 +245,9 @@ enum AVPixelFormat {
     AV_PIX_FMT_GBRAP12BE,  ///< planar GBR 4:4:4:4 48bpp, big-endian
     AV_PIX_FMT_GBRAP12LE,  ///< planar GBR 4:4:4:4 48bpp, little-endian
 
+    AV_PIX_FMT_GRAY12BE,  ///<        Y        , 12bpp, big-endian
+    AV_PIX_FMT_GRAY12LE,  ///<        Y        , 12bpp, little-endian
+
     AV_PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
 };
 
@@ -259,6 +262,7 @@ enum AVPixelFormat {
 #define AV_PIX_FMT_BGR32   AV_PIX_FMT_NE(ABGR, RGBA)
 #define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB)
 
+#define AV_PIX_FMT_GRAY12 AV_PIX_FMT_NE(GRAY12BE, GRAY12LE)
 #define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
 #define AV_PIX_FMT_YA16   AV_PIX_FMT_NE(YA16BE,   YA16LE)
 #define AV_PIX_FMT_RGB48  AV_PIX_FMT_NE(RGB48BE,  RGB48LE)
diff --git a/libavutil/version.h b/libavutil/version.h
index 9287a0b..95aea2f 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,7 +54,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 55
-#define LIBAVUTIL_VERSION_MINOR 27
+#define LIBAVUTIL_VERSION_MINOR 28
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list