[Scummvm-cvs-logs] SF.net SVN: scummvm:[46750] scummvm/trunk

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Wed Dec 30 16:29:52 CET 2009


Revision: 46750
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46750&view=rev
Author:   mthreepwood
Date:     2009-12-30 15:29:52 +0000 (Wed, 30 Dec 2009)

Log Message:
-----------
Use the special Cinepak YUV2RGB function in the Cinepak decoder. This makes the Riven videos match up with the backgrounds better. Thanks, Torbjorn\!

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/video/cinepak.cpp
    scummvm/trunk/graphics/conversion.h

Modified: scummvm/trunk/engines/mohawk/video/cinepak.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/video/cinepak.cpp	2009-12-30 15:24:16 UTC (rev 46749)
+++ scummvm/trunk/engines/mohawk/video/cinepak.cpp	2009-12-30 15:29:52 UTC (rev 46750)
@@ -33,7 +33,7 @@
 namespace Mohawk {
 	
 #define PUT_PIXEL(offset, lum, u, v) \
-	Graphics::YUV2RGB(lum, u, v, r, g, b); \
+	Graphics::CPYUV2RGB(lum, u, v, r, g, b); \
 	if (_pixelFormat.bytesPerPixel == 2) \
 		*((uint16 *)_curFrame.surface->pixels + offset) = _pixelFormat.RGBToColor(r, g, b); \
 	else \

Modified: scummvm/trunk/graphics/conversion.h
===================================================================
--- scummvm/trunk/graphics/conversion.h	2009-12-30 15:24:16 UTC (rev 46749)
+++ scummvm/trunk/graphics/conversion.h	2009-12-30 15:29:52 UTC (rev 46750)
@@ -45,6 +45,13 @@
 	v = CLIP<int>( ((r * 512) >> 10) - ((g * 429) >> 10) - ((b *  83) >> 10) + 128, 0, 255);
 }
 
+/** Converting a color from YUV to RGB colorspace, Cinepak style. */
+inline static void CPYUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) {
+	r = CLIP<int>(y + 2 * (v - 128), 0, 255);
+	g = CLIP<int>(y - (u - 128) / 2 - (v - 128), 0, 255);
+	b = CLIP<int>(y + 2 * (u - 128), 0, 255);
+}
+
 // TODO: generic YUV to RGB blit
 
 /**


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list