[MPlayer-dev-eng] altivec patch 4/5: RGB/BGR confusion

Michael Niedermayer michaelni at gmx.at
Wed Feb 8 12:41:54 CET 2006


Hi

On Tue, Feb 07, 2006 at 05:54:56AM -0500, Alan Curry wrote:
> This patch corrects RGB vs. BGR confusion in yuv2rgb_altivec.c
> 
> First, the macros vec_mstrgb24 and vec_mstbgr24 each do the opposite of what
> they say. (Although it's hard to be sure what they were intended to do since
> the arguments are named "x0,x1,x2" rather than "r,g,b").
> vec_mstrgb24(r,g,b,ptr) actually generates output conforming to IMGFMT_BGR24,
> and vice versa. To fix this, I have simply switched the names.
> 
> The next one is even weirder. Look at these 2 macros, before my patch:
> 
>   #define out_rgb24(a,b,c,ptr) vec_mstrgb24(a,b,c,ptr)
>   #define out_bgr24(a,b,c,ptr) vec_mstbgr24(c,b,a,ptr)
> 
> Regardless of whether vec_mstrgb24 and vec_mstbgr24 are named correctly or
> not, they are definitely opposites of each other. So how does out_bgr24
> compare to out_rgb24? It is reversed in 2 ways: the a,b,c arguments are
> reversed and the opposite vec_mst* macro is called. Those 2 reversals cancel
> each other and out_bgr24 actually does the exact same thing as out_rgb24.
> (Before this patch, they both generate output conforming to IMGFMT_BGR24.)
> 
> This can be easily seen in the output of -vo jpeg, in which blue and red are
> reversed.

patch ok if colors are ok with rgb24/bgr24 on all -vo's which work on the
ppc developers machine

[...]

-- 
Michael




More information about the MPlayer-dev-eng mailing list