[Ffmpeg-devel] New pixel formats

Luca Abeni lucabe72
Wed Aug 23 23:16:12 CEST 2006


Hi,

On Wed, 2006-08-23 at 11:29 +0200, Luca Abeni wrote:
[...]
> Thanks for the explaination. I am updating my patches according to it,
> and I'll probably post something this evening
ok, here is the list of pixel formats I propose to add:
    PIX_FMT_BGR32,      ///< Packed BGR 8:8:8, 32bpp, (msb)8A 8B 8G 8R(lsb), in cpu endianness
    PIX_FMT_BGR565,     ///< Packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), in cpu endianness
    PIX_FMT_BGR555,     ///< Packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in cpu endianness most significant bit to 1
    PIX_FMT_BGR8,       ///< Packed BGR        8bpp (1 byte per pixel)
    PIX_FMT_BGR4,       ///< Packed BGR        4bpp
    PIX_FMT_BGR4_BYTE,  ///< Packed BGR        4bpp, 1 pixel per byte
    PIX_FMT_RGB8,       ///< Packed RGB        8bpp (1 byte per pixel)
    PIX_FMT_RGB4,       ///< Packed RGB        4bpp
    PIX_FMT_RGB4_BYTE,  ///< Packed RGB        4bpp, 1 pixel per byte
    PIX_FMT_NV12,       ///< YUV420, 1 plane for Y and 1 for UV
    PIX_FMT_NV21,       ///< as above, but U and V bytes are swapped
(I hope I got the last two correctly, they are equivalent tp IMGFMT_NV12
and IMGFMT_NV21)

I will also need to introduce two other RGB and BGR 32bit formats, but I
have no good names for them. For the moment, I used
    PIX_FMT_RGB32_1,    ///< Packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in cpu endianness
    PIX_FMT_BGR32_1,    ///< Packed BGR 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in cpu endianness
(proposals for better names are welcome :) then, I propose something like
#ifdef WORDS_BIGENDIAN
#define PIX_FMT_RGBA PIX_FMT_RGB32_1
#define PIX_FMT_BGRA PIX_FMT_BGR32_1
#define PIX_FMT_ARGB PIX_FMT_RGB32
#define PIX_FMT_ABGR PIX_FMT_BGR32
#else
#define PIX_FMT_RGBA PIX_FMT_BGR32
#define PIX_FMT_BGRA PIX_FMT_RGB32
#define PIX_FMT_ARGB PIX_FMT_BGR32_1
#define PIX_FMT_ABGR PIX_FMT_RGB32_1
#endif

I hope I got everything right, this time ;-)


			Thanks,
				Luca





More information about the ffmpeg-devel mailing list