summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2022-08-07 21:03:59 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2022-08-13 15:21:46 +0200
commite95b08a7dd85dc24daf3d77b730ad04ae24faaed (patch)
tree113731a951d058c9dcb28ca63ec9f92628a20023 /libavutil
parent9ca3b8b7cddcd44802cfb8377210a5ccf93184b6 (diff)
lavu/pixfmt: add packed RGBA float16 format
This is the default format of the Windows compositor and what DXGI Desktop Duplication will give you for any kind of HDR output.
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/pixdesc.c28
-rw-r--r--libavutil/pixfmt.h5
-rw-r--r--libavutil/version.h2
3 files changed, 34 insertions, 1 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index e078fd5320..f7558ff8b9 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2504,6 +2504,34 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
.flags = AV_PIX_FMT_FLAG_ALPHA,
},
+ [AV_PIX_FMT_RGBAF16BE] = {
+ .name = "rgbaf16be",
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 8, 0, 0, 16 }, /* R */
+ { 0, 8, 2, 0, 16 }, /* G */
+ { 0, 8, 4, 0, 16 }, /* B */
+ { 0, 8, 6, 0, 16 }, /* A */
+ },
+ .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB |
+ AV_PIX_FMT_FLAG_ALPHA | AV_PIX_FMT_FLAG_FLOAT,
+ },
+ [AV_PIX_FMT_RGBAF16LE] = {
+ .name = "rgbaf16le",
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 8, 0, 0, 16 }, /* R */
+ { 0, 8, 2, 0, 16 }, /* G */
+ { 0, 8, 4, 0, 16 }, /* B */
+ { 0, 8, 6, 0, 16 }, /* A */
+ },
+ .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA |
+ AV_PIX_FMT_FLAG_FLOAT,
+ },
};
static const char * const color_range_names[] = {
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 9d1fdaf82d..86c9bdefeb 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -369,6 +369,9 @@ enum AVPixelFormat {
AV_PIX_FMT_VUYA, ///< packed VUYA 4:4:4, 32bpp, VUYAVUYA...
+ AV_PIX_FMT_RGBAF16BE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian
+ AV_PIX_FMT_RGBAF16LE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, 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
};
@@ -466,6 +469,8 @@ enum AVPixelFormat {
#define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE)
#define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE)
+#define AV_PIX_FMT_RGBAF16 AV_PIX_FMT_NE(RGBAF16BE, RGBAF16LE)
+
/**
* Chromaticity coordinates of the source primaries.
* These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273.
diff --git a/libavutil/version.h b/libavutil/version.h
index f0a8b5c098..05661922b3 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -80,7 +80,7 @@
#define LIBAVUTIL_VERSION_MAJOR 57
#define LIBAVUTIL_VERSION_MINOR 33
-#define LIBAVUTIL_VERSION_MICRO 100
+#define LIBAVUTIL_VERSION_MICRO 101
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \