avutil: add RGBA single-float precision packed formats

This commit is contained in:
Paul B Mahol 2022-09-14 14:13:06 +02:00
parent 63bb6d6a9b
commit 7bb0afc245
4 changed files with 44 additions and 0 deletions

View File

@ -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[] = {

View File

@ -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
};

View File

@ -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

View File

@ -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