[Scummvm-cvs-logs] SF.net SVN: scummvm:[36075] scummvm/trunk/graphics/scaler/intern.h

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Jan 26 17:45:21 CET 2009


Revision: 36075
          http://scummvm.svn.sourceforge.net/scummvm/?rev=36075&view=rev
Author:   fingolfin
Date:     2009-01-26 16:45:21 +0000 (Mon, 26 Jan 2009)

Log Message:
-----------
Slightly improved interpolate32_1_1

Modified Paths:
--------------
    scummvm/trunk/graphics/scaler/intern.h

Modified: scummvm/trunk/graphics/scaler/intern.h
===================================================================
--- scummvm/trunk/graphics/scaler/intern.h	2009-01-26 16:39:05 UTC (rev 36074)
+++ scummvm/trunk/graphics/scaler/intern.h	2009-01-26 16:45:21 UTC (rev 36075)
@@ -40,12 +40,13 @@
 
 /**
  * Interpolate two 16 bit pixel *pairs* at once with equal weights 1.
- * In particular, A and B can contain two pixels/each in the upper
- * and lower halves.
+ * In particular, p1 and p2 can contain two pixels each in the upper
+ * and lower halves. Requires only 5 operations!
+ * See <http://www.slack.net/~ant/info/rgb_mixing.html> for details on how this works.
  */
 template<int bitFormat>
-static inline uint32 interpolate32_1_1(uint32 A, uint32 B) {
-	return (((A & kHighBitsMask) + (B & kHighBitsMask)) >> 1) + (A & B & kLowBitsMask);
+static inline uint32 interpolate32_1_1(uint32 p1, uint32 p2) {
+	return (p1 + p2 - ((p1 ^ p2) & kLowBitsMask)) >> 1; 
 }
 
 /**


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