avutil: add RGBF16 pix_fmt

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Martin Schitter 2024-10-14 10:33:11 +02:00 committed by Michael Niedermayer
parent c72a5c486a
commit c993a91bea
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
5 changed files with 45 additions and 1 deletions

View File

@ -2630,6 +2630,31 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{ 0, 4, 0, 0, 8 }, /* V */
},
},
[AV_PIX_FMT_RGBF16BE] = {
.name = "rgbf16be",
.nb_components = 3,
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
{ 0, 6, 0, 0, 16 }, /* R */
{ 0, 6, 2, 0, 16 }, /* G */
{ 0, 6, 4, 0, 16 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB |
AV_PIX_FMT_FLAG_FLOAT,
},
[AV_PIX_FMT_RGBF16LE] = {
.name = "rgbf16le",
.nb_components = 3,
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
{ 0, 6, 0, 0, 16 }, /* R */
{ 0, 6, 2, 0, 16 }, /* G */
{ 0, 6, 4, 0, 16 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT
},
[AV_PIX_FMT_RGBAF16BE] = {
.name = "rgbaf16be",
.nb_components = 4,

View File

@ -448,6 +448,9 @@ enum AVPixelFormat {
AV_PIX_FMT_V30XBE, ///< packed VYUX 4:4:4 like XV30, 32bpp, (msb)10V 10Y 10U 2X(lsb), big-endian
AV_PIX_FMT_V30XLE, ///< packed VYUX 4:4:4 like XV30, 32bpp, (msb)10V 10Y 10U 2X(lsb), little-endian
AV_PIX_FMT_RGBF16BE, ///< IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., big-endian
AV_PIX_FMT_RGBF16LE, ///< IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., 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
};
@ -553,6 +556,7 @@ 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_RGBF16 AV_PIX_FMT_NE(RGBF16BE, RGBF16LE)
#define AV_PIX_FMT_RGBAF16 AV_PIX_FMT_NE(RGBAF16BE, RGBAF16LE)
#define AV_PIX_FMT_RGBF32 AV_PIX_FMT_NE(RGBF32BE, RGBF32LE)

View File

@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 59
#define LIBAVUTIL_VERSION_MINOR 42
#define LIBAVUTIL_VERSION_MINOR 43
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

View File

@ -274,6 +274,8 @@ uyva planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0
vyu444 planes: 1, linesizes: 192 0 0 0, plane_sizes: 9216 0 0 0, plane_offsets: 0 0 0, total_size: 9216
v30xbe planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
v30xle planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
rgbf16be planes: 1, linesizes: 384 0 0 0, plane_sizes: 18432 0 0 0, plane_offsets: 0 0 0, total_size: 18432
rgbf16le planes: 1, linesizes: 384 0 0 0, plane_sizes: 18432 0 0 0, plane_offsets: 0 0 0, total_size: 18432
image_fill_black tests
yuv420p total_size: 4608, black_unknown_crc: 0xd00f6cc6, black_tv_crc: 0xd00f6cc6, black_pc_crc: 0x234969af
@ -495,3 +497,5 @@ uyva total_size: 12288, black_unknown_crc: 0xdd657297, black_tv_cr
vyu444 total_size: 9216, black_unknown_crc: 0x575e6fb1, black_tv_crc: 0x575e6fb1, black_pc_crc: 0x16564599
v30xbe total_size: 12288, black_unknown_crc: 0x7108457c, black_tv_crc: 0x7108457c, black_pc_crc: 0xdefcbbe0
v30xle total_size: 12288, black_unknown_crc: 0xf5b3c795, black_tv_crc: 0xf5b3c795, black_pc_crc: 0x0b56173c
rgbf16be total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
rgbf16le total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000

View File

@ -23,6 +23,8 @@ is16BPS:
rgba64le
rgbaf16be
rgbaf16le
rgbf16be
rgbf16le
ya16be
ya16le
yuv420p16be
@ -181,6 +183,7 @@ isBE:
rgba64be
rgbaf16be
rgbaf32be
rgbf16be
rgbf32be
v30xbe
x2bgr10be
@ -544,6 +547,8 @@ isRGB:
rgbaf16le
rgbaf32be
rgbaf32le
rgbf16be
rgbf16le
rgbf32be
rgbf32le
x2bgr10be
@ -702,6 +707,8 @@ AnyRGB:
rgbaf16le
rgbaf32be
rgbaf32le
rgbf16be
rgbf16le
rgbf32be
rgbf32le
x2bgr10be
@ -827,6 +834,8 @@ Packed:
rgbaf16le
rgbaf32be
rgbaf32le
rgbf16be
rgbf16le
rgbf32be
rgbf32le
uyva
@ -1031,6 +1040,8 @@ PackedRGB:
rgbaf16le
rgbaf32be
rgbaf32le
rgbf16be
rgbf16le
rgbf32be
rgbf32le
x2bgr10be