[FFmpeg-devel] [RFC] RGB32 / BGR32 ethernal bug

Stefano Sabatini stefano.sabatini-lala
Tue Jan 26 01:06:18 CET 2010


I, currently we have:
isRGB(RGB32   = LE:BGRA) == 1
isRGB(RGB32_1 = LE:ABGR) == 1

and similarly for isBGR(), this is the cause of an ethernal confusion
and frustration for who dares to takle the understanding of rgba
conversion code, my proposal is to change how the RGB stuff is dealt
and to use in the isRGB()/isBGRA() definitions something like:

#define isRGB(x)        (           \
           (x)==PIX_FMT_RGBA        \
        || (x)==PIX_FMT_ARGB        \
        ...

#define isBGR(x)        (           \
           (x)==PIX_FMT_BGRA        \
        || (x)==PIX_FMT_ABGR        \
        ...

which is also what the random sane person would expect, and to do the
necessary changes in the swscale code.

In attachment a sample of what could be used instead.

Note that all the endianess optimizations (which assume the reading of
each ARGB quadruplet like a single int) should still be possible with
the usual if HAVE_BE/LE ifdeffery.

Ideas / comments / flames?

Regards.
-- 
FFmpeg = Faithless and Freak Martial Powerful Enhancing Generator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-rgba-scaling.patch
Type: text/x-diff
Size: 5071 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100126/db685c46/attachment.patch>



More information about the ffmpeg-devel mailing list