[MPlayer-dev-eng] [PATCH] bigendian fix for rgb2rgb_template.c

Diego Biurrun diego at biurrun.de
Sat Mar 19 18:36:38 CET 2005


Hi!

Passing on some patches I received from Rene Rebe at CeBIT.

Diego
-------------- next part --------------

Fixes rgb32to16 convertion for at I think all platforms since the int8
cast should never have worked. Tested on PowerPC anf fixes the black GUI
to show the content.

  - Rene Rebe <rene at exactcode.de>

--- MPlayer-1.0pre6a/postproc/rgb2rgb_template.c	2004-10-21 13:55:20.000000000 +0200
+++ MPlayer-1.0pre6a-fixed/postproc/rgb2rgb_template.c	2005-03-08 14:25:44.000000000 +0100
@@ -403,10 +404,8 @@
 #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);
+		register int rgb = *(uint32_t*)s; s += 4;
+		*d++ = ((rgb&0xFF)>>3) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>8);
 	}
 }
 


More information about the MPlayer-dev-eng mailing list