[FFmpeg-cvslog] Add single precision planar RGB pixel formats

Vittorio Giovara git at videolan.org
Tue Aug 15 16:52:32 EEST 2017


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Fri Jul  7 17:42:57 2017 -0400| [14604087031d5cb93f8513a8835be67d72547b4a] | committer: Vittorio Giovara

Add single precision planar RGB pixel formats

Add a pixel format flag to identify this family.

Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>

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

 doc/APIchanges                   |  3 +++
 libavutil/pixdesc.c              | 54 ++++++++++++++++++++++++++++++++++++++++
 libavutil/pixdesc.h              |  6 +++++
 libavutil/pixfmt.h               |  7 ++++++
 libavutil/version.h              |  2 +-
 tests/ref/fate/sws-pixdesc-query | 20 +++++++++++++++
 6 files changed, 91 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index c82de684ab..7babf5babb 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2015-08-28
 
 API changes, most recent first:
 
+2017-08-08 - xxxxxxx - lavu 55.74.100 - pixdesc.h
+  Add AV_PIX_FMT_FLAG_FLOAT pixel format flag.
+
 2017-08-08 - xxxxxxx - lavu 55.72.100 - imgutils.h
   Add av_image_fill_black().
 
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 59587328ea..d45eae5772 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2183,6 +2183,60 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
         .name = "d3d11",
         .flags = AV_PIX_FMT_FLAG_HWACCEL,
     },
+    [AV_PIX_FMT_GBRPF32BE] = {
+        .name = "gbrpf32be",
+        .nb_components = 3,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 2, 4, 0, 0, 32, 3, 31, 1 },        /* R */
+            { 0, 4, 0, 0, 32, 3, 31, 1 },        /* G */
+            { 1, 4, 0, 0, 32, 3, 31, 1 },        /* B */
+        },
+        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
+                 AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT,
+    },
+    [AV_PIX_FMT_GBRPF32LE] = {
+        .name = "gbrpf32le",
+        .nb_components = 3,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 2, 4, 0, 0, 32, 3, 31, 1 },        /* R */
+            { 0, 4, 0, 0, 32, 3, 31, 1 },        /* G */
+            { 1, 4, 0, 0, 32, 3, 31, 1 },        /* B */
+        },
+        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_RGB,
+    },
+    [AV_PIX_FMT_GBRAPF32BE] = {
+        .name = "gbrapf32be",
+        .nb_components = 4,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 2, 4, 0, 0, 32, 3, 31, 1 },        /* R */
+            { 0, 4, 0, 0, 32, 3, 31, 1 },        /* G */
+            { 1, 4, 0, 0, 32, 3, 31, 1 },        /* B */
+            { 3, 4, 0, 0, 32, 3, 31, 1 },        /* A */
+        },
+        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
+                 AV_PIX_FMT_FLAG_ALPHA | AV_PIX_FMT_FLAG_RGB |
+                 AV_PIX_FMT_FLAG_FLOAT,
+    },
+    [AV_PIX_FMT_GBRAPF32LE] = {
+        .name = "gbrapf32le",
+        .nb_components = 4,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 2, 4, 0, 0, 32, 3, 31, 1 },        /* R */
+            { 0, 4, 0, 0, 32, 3, 31, 1 },        /* G */
+            { 1, 4, 0, 0, 32, 3, 31, 1 },        /* B */
+            { 3, 4, 0, 0, 32, 3, 31, 1 },        /* A */
+        },
+        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA |
+                 AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT,
+    },
 };
 #if FF_API_PLUS1_MINUS1
 FF_ENABLE_DEPRECATION_WARNINGS
diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h
index c3a6f27f49..b0ec81b81b 100644
--- a/libavutil/pixdesc.h
+++ b/libavutil/pixdesc.h
@@ -178,6 +178,12 @@ typedef struct AVPixFmtDescriptor {
 #define AV_PIX_FMT_FLAG_BAYER        (1 << 8)
 
 /**
+ * The pixel format contains IEEE-754 floating point values. Precision (double,
+ * single, or half) should be determined by the pixel size (64, 32, or 16 bits).
+ */
+#define AV_PIX_FMT_FLAG_FLOAT        (1 << 9)
+
+/**
  * Return the number of bits per pixel used by the pixel format
  * described by pixdesc. Note that this is not the same as the number
  * of bits per sample.
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index d4a39dcc01..6dd094376f 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -329,6 +329,11 @@ enum AVPixelFormat {
     AV_PIX_FMT_GRAY9BE,   ///<        Y        , 9bpp, big-endian
     AV_PIX_FMT_GRAY9LE,   ///<        Y        , 9bpp, little-endian
 
+    AV_PIX_FMT_GBRPF32BE,  ///< IEEE-754 single precision planar GBR 4:4:4,     96bpp, big-endian
+    AV_PIX_FMT_GBRPF32LE,  ///< IEEE-754 single precision planar GBR 4:4:4,     96bpp, little-endian
+    AV_PIX_FMT_GBRAPF32BE, ///< IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian
+    AV_PIX_FMT_GBRAPF32LE, ///< IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, 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
 };
 
@@ -393,6 +398,8 @@ enum AVPixelFormat {
 #define AV_PIX_FMT_BAYER_GBRG16 AV_PIX_FMT_NE(BAYER_GBRG16BE,    BAYER_GBRG16LE)
 #define AV_PIX_FMT_BAYER_GRBG16 AV_PIX_FMT_NE(BAYER_GRBG16BE,    BAYER_GRBG16LE)
 
+#define AV_PIX_FMT_GBRPF32    AV_PIX_FMT_NE(GBRPF32BE,  GBRPF32LE)
+#define AV_PIX_FMT_GBRAPF32   AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE)
 
 #define AV_PIX_FMT_YUVA420P9  AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
 #define AV_PIX_FMT_YUVA422P9  AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
diff --git a/libavutil/version.h b/libavutil/version.h
index 02461ae0b2..6e25b4690c 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -80,7 +80,7 @@
 
 
 #define LIBAVUTIL_VERSION_MAJOR  55
-#define LIBAVUTIL_VERSION_MINOR  73
+#define LIBAVUTIL_VERSION_MINOR  74
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index 9510b4ee0e..0adfdcaf98 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -112,11 +112,13 @@ isBE:
   gbrap10be
   gbrap12be
   gbrap16be
+  gbrapf32be
   gbrp10be
   gbrp12be
   gbrp14be
   gbrp16be
   gbrp9be
+  gbrpf32be
   gray10be
   gray12be
   gray16be
@@ -362,6 +364,8 @@ isRGB:
   gbrap12le
   gbrap16be
   gbrap16le
+  gbrapf32be
+  gbrapf32le
   gbrp
   gbrp10be
   gbrp10le
@@ -373,6 +377,8 @@ isRGB:
   gbrp16le
   gbrp9be
   gbrp9le
+  gbrpf32be
+  gbrpf32le
   rgb0
   rgb24
   rgb32
@@ -498,6 +504,8 @@ AnyRGB:
   gbrap12le
   gbrap16be
   gbrap16le
+  gbrapf32be
+  gbrapf32le
   gbrp
   gbrp10be
   gbrp10le
@@ -509,6 +517,8 @@ AnyRGB:
   gbrp16le
   gbrp9be
   gbrp9le
+  gbrpf32be
+  gbrpf32le
   monob
   monow
   rgb0
@@ -543,6 +553,8 @@ ALPHA:
   gbrap12le
   gbrap16be
   gbrap16le
+  gbrapf32be
+  gbrapf32le
   pal8
   rgb32
   rgb32_1
@@ -645,6 +657,8 @@ Planar:
   gbrap12le
   gbrap16be
   gbrap16le
+  gbrapf32be
+  gbrapf32le
   gbrp
   gbrp10be
   gbrp10le
@@ -656,6 +670,8 @@ Planar:
   gbrp16le
   gbrp9be
   gbrp9le
+  gbrpf32be
+  gbrpf32le
   nv12
   nv16
   nv20be
@@ -790,6 +806,8 @@ PlanarRGB:
   gbrap12le
   gbrap16be
   gbrap16le
+  gbrapf32be
+  gbrapf32le
   gbrp
   gbrp10be
   gbrp10le
@@ -801,6 +819,8 @@ PlanarRGB:
   gbrp16le
   gbrp9be
   gbrp9le
+  gbrpf32be
+  gbrpf32le
 
 usePal:
   bgr4_byte



More information about the ffmpeg-cvslog mailing list