[Ffmpeg-devel] Re: pixel format names in swscale

Michael Niedermayer michaelni
Fri Mar 24 12:51:50 CET 2006


Hi

On Fri, Mar 24, 2006 at 12:28:29PM +0100, Michel Bardiaux wrote:
> Luca Abeni wrote:
> > Hi Baptiste,
> > 
> > On Fri, 2006-03-24 at 09:58 +0100, Baptiste COUDURIER wrote:
> > 
> >>Luca Abeni wrote:
> >>
> >>>Hi,
> >>>
> >>>which stile of pixel format name should we pass to sws_getContext()?
> >>>ffmpeg style (PIX_FMT_*) or mplayer style (IMGFMT_*)?
> > 
> > [...]
> > 
> >>IMHO it would be better to use ffmpeg style. Also, future libavfilter
> >>will need those definitions, it might be the time to create another header.
> > 
> > Yes, this would be my preference too... I think moving enum PixelFormat
> > to avutil.h would be the best option, but an additional header would
> > probably be ok too.
> 
> Just a suggestion on the side: would this not be a good time to change
> the definition of RGBA32 from endian-dependent to strict byte order,

no

> i.e. have RGBA32 and ABGR32 (maybe ARGB32 and BGRA32 would be useful
> too). 

supporting all 4 RGBA formats is fine if someone submits a patch


> Currently, img_convert is not able to convert directly to the
> pixel formats necessary for many X-servers. Since the internal format is
> YUV is most of the code, the amount of impacted source might not be
> catastrophic. Of course an RGBA32NATIVE could still be kept.

if anyone wants then:
1. renaming PIX_FMT_RGBA32 to PIX_FMT_ARGB32 (the name really is wrong 
nomatter how you look at it)
2.
PIX_FMT_ARGB32,    ///< Packed pixel, 4 bytes per pixel, (msb)ARGB(lsb), stored in cpu endianness
PIX_FMT_ABGR32,    ///< Packed pixel, 4 bytes per pixel, (msb)ABGR(lsb), stored in cpu endianness
PIX_FMT_RGBA32,    ///< Packed pixel, 4 bytes per pixel, (msb)RGBA(lsb), stored in cpu endianness
PIX_FMT_BGRA32,    ///< Packed pixel, 4 bytes per pixel, (msb)BGRA(lsb), stored in cpu endianness


#ifdef WORDS_BIGENDIAN
#define PIX_IMG_ARGB PIX_FMT_ARGB32
#define PIX_IMG_ABGR PIX_FMT_ABGR32
#define PIX_IMG_RGBA PIX_FMT_RGBA32
#define PIX_IMG_BGRA PIX_FMT_BGRA32
#else
#define PIX_IMG_BGRA PIX_FMT_ARGB32
#define PIX_IMG_RGBA PIX_FMT_ABGR32
#define PIX_IMG_ABGR PIX_FMT_RGBA32
#define PIX_IMG_ARGB PIX_FMT_BGRA32
#endif


[...]
-- 
Michael





More information about the ffmpeg-devel mailing list