[Ffmpeg-devel] New pixel formats
Tue Aug 22 11:56:20 CEST 2006
On Sun, 2006-08-20 at 16:45 +0200, Luca Abeni wrote:
> I'll rewrite a (hopefully) more correct conversion table, and I'll post
> it together with some comments.
Ok, before doing that I need to fully understand the "RGBA vs ARGB vs
BGRA vs ABGR" thing...
So, I read the comment about RGB32 in avutil.h, and I understand that
RGB32 is stored as BGRA on little endian architectures and ARGB on big
In fact, I see
#define PIX_FMT_BGRA PIX_FMT_NONE
#define PIX_FMT_ARGB PIX_FMT_RGB32
#define PIX_FMT_BGRA PIX_FMT_RGB32
#define PIX_FMT_ARGB PIX_FMT_NONE
which is ok according to the comment. So, we can add PIX_FMT_BGR32, and
change the PIX_FMT_NONE above in PIX_FMT_BGR32, right?
Then, we need to add other two formats (any suggestions about good names
for them?) and to define PIX_FMT_RGBA and PIX_FMT_ABGR to them according
to the endianess... Is this correct?
But then I looked at mplayer/libmpcodecs/img_format.h, and I see:
#define IMGFMT_ABGR IMGFMT_RGB32
#define IMGFMT_BGRA (IMGFMT_RGB32|64)
#define IMGFMT_ARGB IMGFMT_BGR32
#define IMGFMT_RGBA (IMGFMT_BGR32|64)
#define IMGFMT_ABGR (IMGFMT_BGR32|64)
#define IMGFMT_BGRA IMGFMT_BGR32
#define IMGFMT_ARGB (IMGFMT_RGB32|64)
#define IMGFMT_RGBA IMGFMT_RGB32
which seems to contraddict the definitions in avutil.h: on big endian
architectures, is ARGB equivalent to BGR32 (as in img_format.h), or to
RGB32 (as in avutil.h)?
Or maybe the two files use different naming conventions?
Or am I misunderstanding something?
More information about the ffmpeg-devel