[Scummvm-cvs-logs] CVS: scummvm/common scaler.cpp,1.42,1.43 scaler.h,1.17,1.18

Max Horn fingolfin at users.sourceforge.net
Sat Sep 27 14:21:02 CEST 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv27307

Modified Files:
	scaler.cpp scaler.h 
Log Message:
added hq2x scaler (no, I am not going to add hq4x anytime soon. It would be another 4-5000 lines of code, and scaler.cpp already takes far too long to compile. Maybe we should seperate the scalers into several files in common/scaler/ ?)

Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- scaler.cpp	27 Sep 2003 18:09:50 -0000	1.42
+++ scaler.cpp	27 Sep 2003 21:19:17 -0000	1.43
@@ -266,10 +266,8 @@
 			colorA2 = *(bP + 2 * nextlineSrc + 1);
 
 			// --------------------------------------
-			if (color5 != color3)
-			{
-				if (color2 == color6)
-				{
+			if (color5 != color3) {
+				if (color2 == color6) {
 					product1b = product2a = color2;
 					if ((color1 == color2) || (color6 == colorB2)) {
[...1961 lines suppressed...]
 #define PIXEL22_4   *(q+2+nextlineDst2) = interpolate16<2,7,7>(w[5], w[6], w[8]);
 #define PIXEL22_5   *(q+2+nextlineDst2) = interpolate16<1,1>(w[6], w[8]);
 #define PIXEL22_C   *(q+2+nextlineDst2) = w[5];
-
-static inline bool diffYUV(int yuv1, int yuv2) {
-	static const  int   Ymask = 0x00FF0000;
-	static const  int   Umask = 0x0000FF00;
-	static const  int   Vmask = 0x000000FF;
-	static const  int   trY   = 0x00300000;
-	static const  int   trU   = 0x00000700;
-	static const  int   trV   = 0x00000006;
-
-	return
-	  ( ( ABS((yuv1 & Ymask) - (yuv2 & Ymask)) > trY ) ||
-	    ( ABS((yuv1 & Umask) - (yuv2 & Umask)) > trU ) ||
-	    ( ABS((yuv1 & Vmask) - (yuv2 & Vmask)) > trV ) );
-}
 
 void HQ3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
 	int  w[10];

Index: scaler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- scaler.h	21 Sep 2003 17:05:07 -0000	1.17
+++ scaler.h	27 Sep 2003 21:19:17 -0000	1.18
@@ -40,6 +40,7 @@
 DECLARE_SCALER(Normal3x);
 DECLARE_SCALER(TV2x);
 DECLARE_SCALER(DotMatrix);
+DECLARE_SCALER(HQ2x);
 DECLARE_SCALER(HQ3x);
 
 FORCEINLINE int real2Aspect(int y) {
@@ -63,9 +64,10 @@
 	GFX_SUPEREAGLE = 5,
 	GFX_ADVMAME2X = 6,
 	GFX_ADVMAME3X = 7,
-	GFX_HQ3X = 8,
-	GFX_TV2X = 9,
-	GFX_DOTMATRIX = 10,
+	GFX_HQ2X = 8,
+	GFX_HQ3X = 9,
+	GFX_TV2X = 10,
+	GFX_DOTMATRIX = 11,
 
 	GFX_BILINEAR = 12,    // OpenGL backend
 	





More information about the Scummvm-git-logs mailing list