[FFmpeg-devel] Endianness of palette
Mats Peterson
matsp888 at yahoo.com
Sun Feb 28 11:33:18 CET 2016
On 02/28/2016 11:31 AM, Reimar Döffinger wrote:
> On 28.02.2016, at 11:19, Mats Peterson <matsp888-at-yahoo.com at ffmpeg.org> wrote:
>> From libavutil/pixfmt.h:
>>
>> * @note
>> * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
>> * color is put together as:
>> * (A << 24) | (R << 16) | (G << 8) | B
>> * This is stored as BGRA on little-endian CPU architectures and ARGB on
>> * big-endian CPUs.
>>
>>
>> This is not quite true, and you said yourself that the palette isn't stored in a host-specific order, Michael, since one has to use AV_RL32() to get the palette entries correctly on a big-endian machine. Itt is stored BGRA, in that order, in memory, as far as I understand.
>
> 1) pixfmt.h applies to AVFrame not AVPacket really, it can be a bit confusing for raw formats that way though
Ah, OK. In any case I have noticed that you have to use AV_RL32() on a
big-endian machine to get the palette entries from the *packets* (sided
data or appended) in the right order.
Mats
More information about the ffmpeg-devel
mailing list