[MPlayer-dev-eng] [PATCH] Bigendian rgb32tobgr

Samuel Kleiner kleiner at cd.chalmers.se
Fri Apr 25 18:30:35 CEST 2003


Hi,

This 5-line patch fixes -vop rgb2bgr=swap to work on bigendian(sparc is
all I can test)

/Samuel
-------------- next part --------------
Index: main/postproc/rgb2rgb_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb_template.c,v
retrieving revision 1.63
diff -u -r1.63 rgb2rgb_template.c
--- main/postproc/rgb2rgb_template.c	18 Feb 2003 19:22:34 -0000	1.63
+++ main/postproc/rgb2rgb_template.c	25 Apr 2003 15:02:25 -0000
@@ -1351,9 +1351,15 @@
 	unsigned num_pixels = src_size >> 2;
 	for(i=0; i<num_pixels; i++)
 	{
-		dst[4*i + 0] = src[4*i + 2];
-		dst[4*i + 1] = src[4*i + 1];
-		dst[4*i + 2] = src[4*i + 0];
+#ifdef WORDS_BIGENDIAN  
+	  dst[4*i + 1] = src[4*i + 3];
+	  dst[4*i + 2] = src[4*i + 2];
+	  dst[4*i + 3] = src[4*i + 1];
+#else
+	  dst[4*i + 0] = src[4*i + 2];
+	  dst[4*i + 1] = src[4*i + 1];
+	  dst[4*i + 2] = src[4*i + 0];
+#endif
 	}
 #endif
 }


More information about the MPlayer-dev-eng mailing list