aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-09-14 14:13:06 +0200
committerPaul B Mahol <onemda@gmail.com>2022-09-25 18:34:48 +0200
commit7bb0afc245d093b065b849461a5e0361050df512 (patch)
tree31fa93af4fbd27bf34f6194cc7ee35c803c6e3dd
parent63bb6d6a9b64f78e0cfbbc008947c9e0bf2fc409 (diff)
downloadffmpeg-7bb0afc245d093b065b849461a5e0361050df512.tar.gz
avutil: add RGBA single-float precision packed formats
-rw-r--r--libavutil/pixdesc.c28
-rw-r--r--libavutil/pixfmt.h3
-rw-r--r--tests/ref/fate/imgutils2
-rw-r--r--tests/ref/fate/sws-pixdesc-query11
4 files changed, 44 insertions, 0 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 248d5f29cd..bfba414167 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2661,6 +2661,34 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT,
},
+ [AV_PIX_FMT_RGBAF32BE] = {
+ .name = "rgbaf32be",
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 16, 0, 0, 32 }, /* R */
+ { 0, 16, 4, 0, 32 }, /* G */
+ { 0, 16, 8, 0, 32 }, /* B */
+ { 0, 16, 12, 0, 32 }, /* A */
+ },
+ .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB |
+ AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_ALPHA,
+ },
+ [AV_PIX_FMT_RGBAF32LE] = {
+ .name = "rgbaf32le",
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 16, 0, 0, 32 }, /* R */
+ { 0, 16, 4, 0, 32 }, /* G */
+ { 0, 16, 8, 0, 32 }, /* B */
+ { 0, 16, 12, 0, 32 }, /* A */
+ },
+ .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT |
+ AV_PIX_FMT_FLAG_ALPHA,
+ },
};
static const char * const color_range_names[] = {
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 3c34d73e2c..f8b3c0514f 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -389,6 +389,9 @@ enum AVPixelFormat {
AV_PIX_FMT_RGBF32BE, ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian
AV_PIX_FMT_RGBF32LE, ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-endian
+ AV_PIX_FMT_RGBAF32BE, ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian
+ AV_PIX_FMT_RGBAF32LE, ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., 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
};
diff --git a/tests/ref/fate/imgutils b/tests/ref/fate/imgutils
index 8ad5615ed8..e79ec7e4b3 100644
--- a/tests/ref/fate/imgutils
+++ b/tests/ref/fate/imgutils
@@ -260,3 +260,5 @@ xv36be planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0
xv36le planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576
rgbf32be planes: 1, linesizes: 768 0 0 0, plane_sizes: 36864 0 0 0, plane_offsets: 0 0 0, total_size: 36864
rgbf32le planes: 1, linesizes: 768 0 0 0, plane_sizes: 36864 0 0 0, plane_offsets: 0 0 0, total_size: 36864
+rgbaf32be planes: 1, linesizes: 1024 0 0 0, plane_sizes: 49152 0 0 0, plane_offsets: 0 0 0, total_size: 49152
+rgbaf32le planes: 1, linesizes: 1024 0 0 0, plane_sizes: 49152 0 0 0, plane_offsets: 0 0 0, total_size: 49152
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index e850d52d12..14156a383c 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -169,6 +169,7 @@ isBE:
rgb565be
rgba64be
rgbaf16be
+ rgbaf32be
rgbf32be
x2bgr10be
x2rgb10be
@@ -510,6 +511,8 @@ isRGB:
rgba64le
rgbaf16be
rgbaf16le
+ rgbaf32be
+ rgbaf32le
rgbf32be
rgbf32le
x2bgr10be
@@ -664,6 +667,8 @@ AnyRGB:
rgba64le
rgbaf16be
rgbaf16le
+ rgbaf32be
+ rgbaf32le
rgbf32be
rgbf32le
x2bgr10be
@@ -694,6 +699,8 @@ ALPHA:
rgba64le
rgbaf16be
rgbaf16le
+ rgbaf32be
+ rgbaf32le
vuya
ya16be
ya16le
@@ -780,6 +787,8 @@ Packed:
rgba64le
rgbaf16be
rgbaf16le
+ rgbaf32be
+ rgbaf32le
rgbf32be
rgbf32le
uyvy422
@@ -972,6 +981,8 @@ PackedRGB:
rgba64le
rgbaf16be
rgbaf16le
+ rgbaf32be
+ rgbaf32le
rgbf32be
rgbf32le
x2bgr10be