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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Jan 27 02:29:23 CET 2009


Revision: 36088
          http://scummvm.svn.sourceforge.net/scummvm/?rev=36088&view=rev
Author:   fingolfin
Date:     2009-01-27 01:29:22 +0000 (Tue, 27 Jan 2009)

Log Message:
-----------
Removed interpolate16_2 and interpolate16_3

Modified Paths:
--------------
    scummvm/trunk/graphics/scaler/2xsai.cpp
    scummvm/trunk/graphics/scaler/hq2x_i386.asm
    scummvm/trunk/graphics/scaler/hq3x_i386.asm
    scummvm/trunk/graphics/scaler/intern.h

Modified: scummvm/trunk/graphics/scaler/2xsai.cpp
===================================================================
--- scummvm/trunk/graphics/scaler/2xsai.cpp	2009-01-27 01:23:04 UTC (rev 36087)
+++ scummvm/trunk/graphics/scaler/2xsai.cpp	2009-01-27 01:29:22 UTC (rev 36088)
@@ -46,9 +46,9 @@
 	return rmap[y][x];
 }
 
-#define interpolate_1_1		interpolate16_2<bitFormat, 1, 1>
-#define interpolate_3_1		interpolate16_2<bitFormat, 3, 1>
-#define interpolate_6_1_1	interpolate16_3<bitFormat, 6, 1, 1>
+#define interpolate_1_1		interpolate16_1_1<Graphics::ColorMasks<bitFormat> >
+#define interpolate_3_1		interpolate16_3_1<Graphics::ColorMasks<bitFormat> >
+#define interpolate_6_1_1	interpolate16_6_1_1<Graphics::ColorMasks<bitFormat> >
 #define interpolate_1_1_1_1	interpolate32_1_1_1_1<bitFormat>
 
 template<int bitFormat>

Modified: scummvm/trunk/graphics/scaler/hq2x_i386.asm
===================================================================
--- scummvm/trunk/graphics/scaler/hq2x_i386.asm	2009-01-27 01:23:04 UTC (rev 36087)
+++ scummvm/trunk/graphics/scaler/hq2x_i386.asm	2009-01-27 01:29:22 UTC (rev 36088)
@@ -148,7 +148,7 @@
     mov %1,dx
 %endmacro
 
-; interpolate16_3<bitFormat,2,1,1>
+; interpolate16_2_1_1
 ; Mix three pixels with weight 2, 1, and 1, respectively: (c1*2+c2+c3)/4;
 %macro Interp2 4
     mov edx,%3
@@ -166,7 +166,7 @@
     mov %1,dx
 %endmacro
 
-; interpolate16_3<bitFormat,5,2,1>
+; interpolate16_5_2_1
 ; Mix three pixels with weight 5, 2, and 1, respectively: (c1*5+c2*2+c3)/8;
 %macro Interp6 3
 	; Unpack eax to ecx and multiply by 5
@@ -212,7 +212,7 @@
     mov %1,  dx
 %endmacro
 
-; interpolate16_3<bitFormat,6,1,1>
+; interpolate16_6_1_1
 ; Mix three pixels with weight 6, 1, and 1, respectively: (c1*6+c2+c3)/8;
 %macro Interp7 3
 	; Unpack eax to ecx and multiply by 6
@@ -258,7 +258,7 @@
     mov %1,  dx
 %endmacro
 
-; interpolate16_3<bitFormat,2,3,3>
+; interpolate16_2_3_3
 ; Mix three pixels with weight 2, 3, and 3, respectively: (c1*2+(c2+c3)*3)/8;
 %macro Interp9 3
 	; unpack c2
@@ -305,7 +305,7 @@
     mov %1,  dx
 %endmacro
 
-; interpolate16_3<bitFormat,14,1,1>
+; interpolate16_14_1_1
 ; Mix three pixels with weight 14, 1, and 1, respectively: (c1*14+c2+c3)/16;
 %macro Interp10 3
 	; Unpack eax to ecx and multiply by 14

Modified: scummvm/trunk/graphics/scaler/hq3x_i386.asm
===================================================================
--- scummvm/trunk/graphics/scaler/hq3x_i386.asm	2009-01-27 01:23:04 UTC (rev 36087)
+++ scummvm/trunk/graphics/scaler/hq3x_i386.asm	2009-01-27 01:29:22 UTC (rev 36088)
@@ -131,7 +131,7 @@
 %%fin:
 %endmacro
 
-; interpolate16_2<bitFormat,3,1>
+; interpolate16_3_1
 ; Mix two pixels with weight 3 and 1, respectively: (c1*3+c2)/4;
 %macro Interp1 3
     mov edx,%2
@@ -147,7 +147,7 @@
     mov %1,dx
 %endmacro
 
-; interpolate16_3<bitFormat,2,1,1>
+; interpolate16_2_1_1
 ; Mix three pixels with weight 2, 1, and 1, respectively: (c1*2+c2+c3)/4;
 %macro Interp2 4
     mov edx,%3
@@ -165,7 +165,7 @@
     mov %1,dx
 %endmacro
 
-; interpolate16_2<bitFormat,7,1>
+; interpolate16_7_1
 ; Mix two pixels with weight 7 and 1, respectively: (c1*7+c2)/8;
 %macro Interp3 2
 	; ((p1&kLowBitsMask)<<2)
@@ -204,7 +204,7 @@
     mov %1,dx
 %endmacro
 
-; interpolate16_3<bitFormat,2,7,7>
+; interpolate16_2_7_7
 ; Mix three pixels with weight 2, 7, and 7, respectively: (c1*2+(c2+c3)*7)/16;
 %macro Interp4 3
 	; unpack c2
@@ -251,7 +251,7 @@
     mov %1,  dx
 %endmacro
 
-; interpolate16_2<bitFormat,1,1>
+; interpolate16_1_1
 ; Mix two pixels with weight 1 and 1, respectively: (c1+c2)/2;
 %macro Interp5 3
     mov edx,%2

Modified: scummvm/trunk/graphics/scaler/intern.h
===================================================================
--- scummvm/trunk/graphics/scaler/intern.h	2009-01-27 01:23:04 UTC (rev 36087)
+++ scummvm/trunk/graphics/scaler/intern.h	2009-01-27 01:29:22 UTC (rev 36088)
@@ -77,29 +77,6 @@
 }
 
 /**
- * Interpolate two 16 bit pixels with the weights specified in the template
- * parameters.
- * @note w1 and w2 must sum up to 2, 4, 8 or 16.
- */
-template<int bitFormat, int w1, int w2>
-static inline uint16 interpolate16_2(uint16 p1, uint16 p2) {
-	return ((((p1 & redblueMask) * w1 + (p2 & redblueMask) * w2) / (w1 + w2)) & redblueMask) |
-	       ((((p1 & greenMask) * w1 + (p2 & greenMask) * w2) / (w1 + w2)) & greenMask);
-}
-
-/**
- * Interpolate three 16 bit pixels with the weights specified in the template
- * parameters.
- * @note w1, w2 and w3 must sum up to 2, 4, 8 or 16.
- */
-template<int bitFormat, int w1, int w2, int w3>
-static inline uint16 interpolate16_3(uint16 p1, uint16 p2, uint16 p3) {
-	return ((((p1 & redblueMask) * w1 + (p2 & redblueMask) * w2 + (p3 & redblueMask) * w3) / (w1 + w2 + w3)) & redblueMask) |
-		   ((((p1 & greenMask) * w1 + (p2 & greenMask) * w2 + (p3 & greenMask) * w3) / (w1 + w2 + w3)) & greenMask);
-}
-
-
-/**
  * Interpolate two 16 bit pixels with weights 1 and 1, i.e., (p1+p2)/2.
  * See <http://www.slack.net/~ant/info/rgb_mixing.html> for details on how this works.
  */


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