@@ -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
@@ -178,6 +178,11 @@ typedef struct AVPixFmtDescriptor {
#define AV_PIX_FMT_FLAG_BAYER (1 << 8)
/**
+ * The pixel format contains IEEE-754 single precision floating point values.
+ */
+#define AV_PIX_FMT_FLAG_FLOAT (1 << 10)
+
+/**
* 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.
@@ -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 GBR 4:4:4:4, 128bpp, big-endian
+ AV_PIX_FMT_GBRAPF32LE, ///< IEEE-754 single precision planar GBR 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)
@@ -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
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> --- libavutil/pixdesc.c | 54 ++++++++++++++++++++++++++++++++++++++++ libavutil/pixdesc.h | 5 ++++ libavutil/pixfmt.h | 7 ++++++ tests/ref/fate/sws-pixdesc-query | 20 +++++++++++++++ 4 files changed, 86 insertions(+)