[MPlayer-dev-eng] [PATCH] RGB/BGR big-endian fixes

Diego Biurrun diego at biurrun.de
Thu Feb 9 11:13:28 CET 2006


On Thu, Feb 09, 2006 at 02:14:36AM -0500, Alan Curry wrote:
> Diego Biurrun writes the following:
> >
> >>   mplayer -vo x11 -vf format=bgr24,scale movie.avi
> >>   mplayer -vo x11 -vf format=rgb24,scale movie.avi
> >> 
> >> both produce wrong colors while vo_xv is fine.  This problem is not
> >> caused by this patch, though, it was present before.  Disabling AltiVec
> >> does not make a difference.
> >
> >I tested some more with vo_png, vo_jpeg, vo_pnm and vo_tga.  vo_tga and
> >rgb24 create a blue picture, but this occurs with and without the patch.
> >Everything else is fine.
> 
> There are several non-altivec-related big-endian bugs in rgb2rgb.c and
> rgb2rgb_template.c, which probably explains these color problems. Red and
> blue can be reversed, or in a 32 bit format the 8 unused/alpha bits can be on
> the wrong side of the other 24 bits. Exactly which kind of color permutation
> you get depends on what depth your X server is running in.
> 
> Here's a patch that will hopefully fix those problems. I haven't tested any
> of the 16bpp-or-less formats, but the 24bpp and 32bpp ones are Definitely
> Good (ready the brown paper bag...)

This patch fixes both bgr16 and rgb24 with vo_x11.

Michael, OK to commit?

> vo_tga is still broken. I still haven't taken a serious look at it.

Please do, you're doing excellent work so far :)

Diego




More information about the MPlayer-dev-eng mailing list