[Mplayer-cvslog] CVS: main/postproc rgb2rgb_template.c,1.70,1.71

Alex Beregszaszi syncmail at mplayerhq.hu
Tue Sep 21 19:23:51 CEST 2004


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/main/postproc
In directory mail:/var2/tmp/cvs-serv7258

Modified Files:
	rgb2rgb_template.c 
Log Message:
lot of bigendian fixes

Index: rgb2rgb_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb_template.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- rgb2rgb_template.c	10 Aug 2004 20:23:58 -0000	1.70
+++ rgb2rgb_template.c	21 Sep 2004 17:23:49 -0000	1.71
@@ -6,6 +6,7 @@
  *               Software YUV to RGB convertor
  *  Written by Nick Kurshev.
  *  palette & yuv & runtime cpu stuff by Michael (michaelni at gmx.at) (under GPL)
+ *  lot of big-endian byteorder fixes by Alex Beregszaszi
  */
 
 #include <stddef.h>
@@ -102,10 +103,17 @@
 #endif
   while(s < end)
   {
+#ifdef WORDS_BIGENDIAN
+    *dest++ = 0;
+    *dest++ = *s++;
+    *dest++ = *s++;
+    *dest++ = *s++;
+#else
     *dest++ = *s++;
     *dest++ = *s++;
     *dest++ = *s++;
     *dest++ = 0;
+#endif
   }
 }
 
@@ -179,10 +187,17 @@
 #endif
   while(s < end)
   {
+#ifdef WORDS_BIGENDIAN
+    s++;
+    *dest++ = *s++;
+    *dest++ = *s++;
+    *dest++ = *s++;
+#else
     *dest++ = *s++;
     *dest++ = *s++;
     *dest++ = *s++;
     s++;
+#endif
   }
 }
 
@@ -388,6 +403,7 @@
 #endif
 	while(s < end)
 	{
+		// FIXME on bigendian
 		const int src= *s; s += 4;
 		*d++ = ((src&0xFF)>>3) + ((src&0xFC00)>>5) + ((src&0xF80000)>>8);
 //		*d++ = ((src>>3)&0x1F) + ((src>>5)&0x7E0) + ((src>>8)&0xF800);
@@ -450,6 +466,7 @@
 #endif
 	while(s < end)
 	{
+		// FIXME on bigendian
 		const int src= *s; s += 4;
 		*d++ = ((src&0xF8)<<8) + ((src&0xFC00)>>5) + ((src&0xF80000)>>19);
 	}
@@ -546,6 +563,7 @@
 #endif
 	while(s < end)
 	{
+		// FIXME on bigendian
 		const int src= *s; s += 4;
 		*d++ = ((src&0xFF)>>3) + ((src&0xF800)>>6) + ((src&0xF80000)>>9);
 	}
@@ -607,6 +625,7 @@
 #endif
 	while(s < end)
 	{
+		// FIXME on bigendian
 		const int src= *s; s += 4;
 		*d++ = ((src&0xF8)<<7) + ((src&0xF800)>>6) + ((src&0xF80000)>>19);
 	}
@@ -1233,11 +1252,19 @@
 //FIXME this is very likely wrong for bigendian (and the following converters too)
 		register uint16_t bgr;
 		bgr = *s++;
+#ifdef WORDS_BIGENDIAN
+		*d++ = 0;
+		*d++ = (bgr&0x1F)<<3;
+		*d++ = (bgr&0x3E0)>>2;
+		*d++ = (bgr&0x7C00)>>7;
+#else
 		*d++ = (bgr&0x1F)<<3;
 		*d++ = (bgr&0x3E0)>>2;
 		*d++ = (bgr&0x7C00)>>7;
 		*d++ = 0;
 #endif
+
+#endif
 	}
 }
 
@@ -1299,10 +1326,17 @@
 	{
 		register uint16_t bgr;
 		bgr = *s++;
+#ifdef WORDS_BIGENDIAN
+		*d++ = 0;
+		*d++ = (bgr&0x1F)<<3;
+		*d++ = (bgr&0x7E0)>>3;
+		*d++ = (bgr&0xF800)>>8;
+#else
 		*d++ = (bgr&0x1F)<<3;
 		*d++ = (bgr&0x7E0)>>3;
 		*d++ = (bgr&0xF800)>>8;
 		*d++ = 0;
+#endif
 	}
 }
 




More information about the MPlayer-cvslog mailing list