[MPlayer-dev-eng] Little/Big endian problem - SPARC

Mark Gjøl cyrax at b0rken.dk
Thu Aug 19 16:27:28 CEST 2004


... Ok, let's try again. I'm (now) using the daily cvs snapshot of
mplayer (that would be 20040819). When using mplayer 1.0pre4 I get the
correct colors after applying the patch (in reverse, actually, the file
were as the patch said they should be, but the other way around it
worked) pasted below. This seems to have already been done, yet the
output I get is wrong:

mplayer 1.0pre4: http://www.student.dtu.dk/~s011269/bgr.png
mplayer cvs    : http://www.student.dtu.dk/~s011269/rgb.png

The output from mplayer -v can be found here:
http://www.student.dtu.dk/~s011269/verbose.txt
http://www.student.dtu.dk/~s011269/error.txt

I was told to try the switch -vf rgb2bgr, but all that produced was the
message:

Could not find matching colorspace - retrying with -vf scale...

The patch:

Index: yuv2rgb.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/yuv2rgb.c,v
retrieving revision 1.22
retrieving revision 1.21
diff -u -r1.22 -r1.21
--- yuv2rgb.c   27 Dec 2003 19:54:59 -0000      1.22
+++ yuv2rgb.c   1 May 2003 19:14:27 -0000       1.21
@@ -642,8 +642,8 @@
 
 int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation)
 {  
-    const int isRgb = IMGFMT_IS_RGB(c->dstFormat);
-    const int bpp = isRgb?IMGFMT_RGB_DEPTH(c->dstFormat):IMGFMT_BGR_DEPTH(c->dstFormat);
+    const int bpp= c->dstFormat&0xFF;
+    const int isRgb= (c->dstFormat>>24) != 'R';
     int i;
     uint8_t table_Y[1024];
     uint32_t *table_32 = 0;

--------------------------

Greets...

On Thu, Aug 19, 2004 at 03:44:55PM +0200, Michael Niedermayer wrote:
> On Thursday 19 August 2004 15:19, Mark Gjøl wrote:
> > I'm compiling mplayer on a Solaris/SPARC machine, but I'm getting the
> > wrong colors. I had this problem before (see
> > http://www1.mplayerhq.hu/pipermail/mplayer-dev-eng/2004-January/023540.html
> >), but it was fixed by a patch working on postproc/yuv2rgb.c... This patch,
> > however, doesn't work on mplayer 1.0pre5, as the colors stay wrong.
> use cvs, read and follow bugreports.html, send screenshoots, tell us what 
> patch u are talking about, or dont be surprised if someone answers in the 
> same generic way that a change to a file fixes it ...
-- 
// Mark Gjøl
I find the whole business of religion profoundly interesting. But it does mystify me that otherwise intelligent people take it seriously.
 - Douglas Adams
-- http://b0rken.dk




More information about the MPlayer-dev-eng mailing list