[FFmpeg-devel] [PATCH 2/7] lavu/pixfmt: add AV_PIX_FMT_RGB32

James Almer jamrial at gmail.com
Sat Oct 12 01:09:02 EEST 2024


On 10/10/2024 3:58 AM, Lynne via ffmpeg-devel wrote:
> On 10/10/2024 07:32, Lynne wrote:
>> ---
>>   libavutil/pixdesc.c | 24 ++++++++++++++++++++++++
>>   libavutil/pixfmt.h  |  4 ++++
>>   2 files changed, 28 insertions(+)
>>
>> diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
>> index 7174989072..a741d9bcb7 100644
>> --- a/libavutil/pixdesc.c
>> +++ b/libavutil/pixdesc.c
>> @@ -2775,6 +2775,30 @@ 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_RGB32BE] = {
>> +        .name = "rgb32be",
>> +        .nb_components = 3,
>> +        .log2_chroma_w = 0,
>> +        .log2_chroma_h = 0,
>> +        .comp = {
>> +            { 0, 12, 0, 0, 32 },       /* R */
>> +            { 0, 12, 4, 0, 32 },       /* G */
>> +            { 0, 12, 8, 0, 32 },       /* B */
>> +        },
>> +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
>> +    },
>> +    [AV_PIX_FMT_RGB32LE] = {
>> +        .name = "rgb32le",
>> +        .nb_components = 3,
>> +        .log2_chroma_w = 0,
>> +        .log2_chroma_h = 0,
>> +        .comp = {
>> +            { 0, 12, 0, 0, 32 },       /* R */
>> +            { 0, 12, 4, 0, 32 },       /* G */
>> +            { 0, 12, 8, 0, 32 },       /* B */
>> +        },
>> +        .flags = AV_PIX_FMT_FLAG_RGB,
>> +    },
>>       [AV_PIX_FMT_RGBAF32BE] = {
>>           .name = "rgbaf32be",
>>           .nb_components = 4,
>> diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
>> index af06d8dcac..99a78304bf 100644
>> --- a/libavutil/pixfmt.h
>> +++ b/libavutil/pixfmt.h
>> @@ -451,6 +451,9 @@ enum AVPixelFormat {
>>       AV_PIX_FMT_RGBA32BE,    ///< packed RGBA 32:32:32:32, 128bpp, 
>> RGBARGBA..., big-endian
>>       AV_PIX_FMT_RGBA32LE,    ///< packed RGBA 32:32:32:32, 128bpp, 
>> RGBARGBA..., little-endian
>> +    AV_PIX_FMT_RGB32BE,     ///< packed RGBA 32:32:32, 96bpp, 
>> RGBRGB..., big-endian
>> +    AV_PIX_FMT_RGB32LE,     ///< packed RGBA 32:32:32, 96bpp, 
>> 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
>>   };
>> @@ -560,6 +563,7 @@ enum AVPixelFormat {
>>   #define AV_PIX_FMT_RGBF32     AV_PIX_FMT_NE(RGBF32BE, RGBF32LE)
>>   #define AV_PIX_FMT_RGBAF32    AV_PIX_FMT_NE(RGBAF32BE, RGBAF32LE)
>> +#define AV_PIX_FMT_RGB32      AV_PIX_FMT_NE(RGB32BE, RGB32LE)
>>   #define AV_PIX_FMT_RGBA32     AV_PIX_FMT_NE(RGBA32BE, RGBA32LE)
>>   /**
> 
> Ignore this patch, it doesn't exist.

Patch 5/7 depends on it, so you'd need to drop it too.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241011/46c24b23/attachment.sig>


More information about the ffmpeg-devel mailing list