[Ffmpeg-devel] New pixel formats

Michael Niedermayer michaelni
Wed Aug 23 23:27:40 CEST 2006


Hi

On Wed, Aug 23, 2006 at 11:16:12PM +0200, Luca Abeni wrote:
> 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

to follow current naming i suggest to s/Packed BGR/Packed RGB/


>     PIX_FMT_BGR8,       ///< Packed BGR        8bpp (1 byte per pixel)

Packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)


>     PIX_FMT_BGR4,       ///< Packed BGR        4bpp

Packed RGB 1:2:1,  4bpp, (msb)1B 2G 1R(lsb)


>     PIX_FMT_BGR4_BYTE,  ///< Packed BGR        4bpp, 1 pixel per byte

Packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)


>     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

Planar YUV 4:2:0, 12bpp, 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 ;-)

yes looks good except the cosmetics i suggested above


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list