[Scummvm-cvs-logs] CVS: scummvm/common/scaler 2xsai.cpp,1.8,1.9 aspect.cpp,1.5,1.6 hq2x.cpp,1.15,1.16 hq2x.h,1.3,1.4 hq3x.cpp,1.13,1.14 hq3x.h,1.3,1.4 intern.h,1.15,1.16 thumbnail.cpp,1.2,1.3

Eugene Sandulenko sev at users.sourceforge.net
Sat Jul 30 14:14:56 CEST 2005


Update of /cvsroot/scummvm/scummvm/common/scaler
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9428/common/scaler

Modified Files:
	2xsai.cpp aspect.cpp hq2x.cpp hq2x.h hq3x.cpp hq3x.h intern.h 
	thumbnail.cpp 
Log Message:
Remove trailing whitespaces.


Index: 2xsai.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler/2xsai.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- 2xsai.cpp	1 Jan 2005 16:08:50 -0000	1.8
+++ 2xsai.cpp	30 Jul 2005 21:10:58 -0000	1.9
@@ -24,7 +24,7 @@
 
 
 
-static inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) { 
+static inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) {
 	const bool ac = (A==C);
 	const bool bc = (B==C);
 	const int x1 = ac;
@@ -51,7 +51,7 @@
 	const uint16 *bP;
 	uint16 *dP;
 	const uint32 nextlineSrc = srcPitch >> 1;
-	
+
 	while (height--) {
 		bP = (const uint16 *)srcPtr;
 		dP = (uint16 *)dstPtr;

Index: aspect.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler/aspect.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- aspect.cpp	1 Jan 2005 16:08:50 -0000	1.5
+++ aspect.cpp	30 Jul 2005 21:10:58 -0000	1.6
@@ -121,7 +121,7 @@
 
 	// Finally force the width to be even, since we blit 2 pixels at a time.
 	// While this means we may sometimes blit one column more than necessary,
-	// this should actually be faster than having the check for the 
+	// this should actually be faster than having the check for the
 	if (w & 1)
 		w++;
   #endif

Index: hq2x.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler/hq2x.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- hq2x.cpp	9 May 2005 21:21:18 -0000	1.15
+++ hq2x.cpp	30 Jul 2005 21:10:58 -0000	1.16
@@ -56,16 +56,16 @@
 }
 #else
 
-#include <sys/sysctl.h> 
+#include <sys/sysctl.h>
 
 static bool isAltiVecAvailable()  {
-	int selectors[2] = { CTL_HW, HW_VECTORUNIT }; 
-	int hasVectorUnit = 0; 
-	size_t length = sizeof(hasVectorUnit); 
-	int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); 
+	int selectors[2] = { CTL_HW, HW_VECTORUNIT };
+	int hasVectorUnit = 0;
+	size_t length = sizeof(hasVectorUnit);
+	int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
 	if ( 0 == error )
-		return hasVectorUnit != 0; 
-	return false; 
+		return hasVectorUnit != 0;
+	return false;
 }
 #endif
 #endif
@@ -140,7 +140,7 @@
 
 #ifdef HAS_ALTIVEC
 	#define USE_ALTIVEC	1
-	
+
 	#define bitFormat 565
 	void HQ2x_565_Altivec(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
 		#include "common/scaler/hq2x.h"

Index: hq2x.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler/hq2x.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hq2x.h	1 Jan 2005 16:08:50 -0000	1.3
+++ hq2x.h	30 Jul 2005 21:10:58 -0000	1.4
@@ -33,7 +33,7 @@
 
 	const uint32 nextlineDst = dstPitch / sizeof(uint16);
 	uint16 *q = (uint16 *)dstPtr;
-	
+
 	//	 +----+----+----+
 	//	 |    |    |    |
 	//	 | w1 | w2 | w3 |
@@ -104,7 +104,7 @@
 			|    |    |    |    |
 			| w20| w21| w22| w23|
 			+----+----+----+----+
-			
+
 			In the previous loop iteration, w11 was the center point, and our
 			vectors contain the following data from the previous iteration:
 			vecYUV5555 = { w11, w11, w11, w11 }
@@ -124,14 +124,14 @@
 			vecYUV5555 = { vecYUV6789[0], vecYUV6789[0], vecYUV6789[0], vecYUV6789[0] }
 			vecYUV1234 = { vecYUV1234[1], vecYUV1234[2],  vTmp[1],  vTmp[0] }
 			vecYUV6789 = {  vTmp[2], vecYUV6789[2], vecYUV6789[3],  vTmp[3] }
-			
+
 			Beautiful, isn't it? :-)
 			*/
 
 			// Load the new values into a temporary vector (see above for an explanation)
 			const int tmpArr[4] = {YUV(4), YUV(3), YUV(6), YUV(9)};
 			vector signed char vTmp = *(const vector signed char *)tmpArr;
-			
+
 			// Next update the data vectors
 			vecYUV5555 = (vector signed char)vec_splat((vector unsigned int)vecYUV6789, 0);
 			vecYUV1234 = vec_perm(vecYUV1234, vTmp, vPermuteToV1234);
@@ -140,17 +140,17 @@
 			// Compute the absolute difference between the center point's YUV and the outer points
 			const vector signed char vDiff1 = vec_abs(vec_sub(vecYUV5555, vecYUV1234));
 			const vector signed char vDiff2 = vec_abs(vec_sub(vecYUV5555, vecYUV6789));
-			
+
 			// Compare the difference to the threshold (byte-wise)
 			const vector bool char vCmp1 = vec_cmpgt((vector unsigned char)vDiff1, vThreshold);
 			const vector bool char vCmp2 = vec_cmpgt((vector unsigned char)vDiff2, vThreshold);
-			
+
 			// Convert all non-zero (long) vector elements to 0xF...F, keep 0 at 0.
 			// Then and in the patter masks. The idea is that for 0 components, we get 0,
 			// while for the other components we get exactly the mask value.
 			const vector signed int vPattern1 = vec_and(vec_cmpgt((vector unsigned int)vCmp1, (vector unsigned int)0), vPatternMask1);
 			const vector signed int vPattern2 = vec_and(vec_cmpgt((vector unsigned int)vCmp2, (vector unsigned int)0), vPatternMask2);
-			
+
 			// Now sum up the components of all vectors. Since our pattern mask values
 			// are all "orthogonal", this is effectively the same as ORing them all
 			// together. In the end, the rightmost word of vSum contains the 'pattern'

Index: hq3x.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler/hq3x.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- hq3x.cpp	9 May 2005 21:21:19 -0000	1.13
+++ hq3x.cpp	30 Jul 2005 21:10:59 -0000	1.14
@@ -55,16 +55,16 @@
 }
 #else
 
-#include <sys/sysctl.h> 
+#include <sys/sysctl.h>
 
 static bool isAltiVecAvailable()  {
-	int selectors[2] = { CTL_HW, HW_VECTORUNIT }; 
-	int hasVectorUnit = 0; 
-	size_t length = sizeof(hasVectorUnit); 
-	int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); 
+	int selectors[2] = { CTL_HW, HW_VECTORUNIT };
+	int hasVectorUnit = 0;
+	size_t length = sizeof(hasVectorUnit);
+	int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
 	if ( 0 == error )
-		return hasVectorUnit != 0; 
-	return false; 
+		return hasVectorUnit != 0;
+	return false;
 }
 #endif
 #endif
@@ -141,7 +141,7 @@
 
 #ifdef HAS_ALTIVEC
 	#define USE_ALTIVEC	1
-	
+
 	#define bitFormat 565
 	void HQ3x_565_Altivec(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
 		#include "common/scaler/hq3x.h"

Index: hq3x.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler/hq3x.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hq3x.h	1 Jan 2005 16:08:50 -0000	1.3
+++ hq3x.h	30 Jul 2005 21:10:59 -0000	1.4
@@ -27,7 +27,7 @@
  */
 
 	register int  w1, w2, w3, w4, w5, w6, w7, w8, w9;
- 
+
 	const uint32 nextlineSrc = srcPitch / sizeof(uint16);
 	const uint16 *p = (const uint16 *)srcPtr;
 
@@ -49,7 +49,7 @@
 #ifdef USE_ALTIVEC
 	// The YUV threshold.
 	static const vector unsigned char vThreshold = (vector unsigned char)((vector unsigned int)0x00300706);
-	
+
 	// Bit pattern mask.
 	static const vector signed int vPatternMask1 = (vector signed int)(0x01,0x02,0x04,0x08);
 	static const vector signed int vPatternMask2 = (vector signed int)(0x10,0x20,0x40,0x80);
@@ -105,7 +105,7 @@
 			|    |    |    |    |
 			| w20| w21| w22| w23|
 			+----+----+----+----+
-			
+
 			In the previous loop iteration, w11 was the center point, and our
 			vectors contain the following data from the previous iteration:
 			vecYUV5555 = { w11, w11, w11, w11 }
@@ -125,14 +125,14 @@
 			vecYUV5555 = { vecYUV6789[0], vecYUV6789[0], vecYUV6789[0], vecYUV6789[0] }
 			vecYUV1234 = { vecYUV1234[1], vecYUV1234[2],  vTmp[1],  vTmp[0] }
 			vecYUV6789 = {  vTmp[2], vecYUV6789[2], vecYUV6789[3],  vTmp[3] }
-			
+
 			Beautiful, isn't it? :-)
 			*/
 
 			// Load the new values into a temporary vector (see above for an explanation)
 			const int tmpArr[4] = {YUV(4), YUV(3), YUV(6), YUV(9)};
 			vector signed char vTmp = *(const vector signed char *)tmpArr;
-			
+
 			// Next update the data vectors
 			vecYUV5555 = (vector signed char)vec_splat((vector unsigned int)vecYUV6789, 0);
 			vecYUV1234 = vec_perm(vecYUV1234, vTmp, vPermuteToV1234);
@@ -141,17 +141,17 @@
 			// Compute the absolute difference between the center point's YUV and the outer points
 			const vector signed char vDiff1 = vec_abs(vec_sub(vecYUV5555, vecYUV1234));
 			const vector signed char vDiff2 = vec_abs(vec_sub(vecYUV5555, vecYUV6789));
-			
+
 			// Compare the difference to the threshold (byte-wise)
 			const vector bool char vCmp1 = vec_cmpgt((vector unsigned char)vDiff1, vThreshold);
 			const vector bool char vCmp2 = vec_cmpgt((vector unsigned char)vDiff2, vThreshold);
-			
+
 			// Convert all non-zero (long) vector elements to 0xF...F, keep 0 at 0.
 			// Then and in the patter masks. The idea is that for 0 components, we get 0,
 			// while for the other components we get exactly the mask value.
 			const vector signed int vPattern1 = vec_and(vec_cmpgt((vector unsigned int)vCmp1, (vector unsigned int)0), vPatternMask1);
 			const vector signed int vPattern2 = vec_and(vec_cmpgt((vector unsigned int)vCmp2, (vector unsigned int)0), vPatternMask2);
-			
+
 			// Now sum up the components of all vectors. Since our pattern mask values
 			// are all "orthogonal", this is effectively the same as ORing them all
 			// together. In the end, the rightmost word of vSum contains the 'pattern'

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler/intern.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- intern.h	24 Jun 2005 15:22:38 -0000	1.15
+++ intern.h	30 Jul 2005 21:10:59 -0000	1.16
@@ -121,23 +121,23 @@
 	static const int trY   = 0x00300000;
 	static const int trU   = 0x00000700;
 	static const int trV   = 0x00000006;
-	
+
 	int diff;
 	int mask;
-	
+
 	diff = ((yuv1 & Ymask) - (yuv2 & Ymask));
-	mask = diff >> 31; // -1 if value < 0, 0 otherwise 
-	diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value 
+	mask = diff >> 31; // -1 if value < 0, 0 otherwise
+	diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value
 	if (diff > trY) return true;
 
 	diff = ((yuv1 & Umask) - (yuv2 & Umask));
-	mask = diff >> 31; // -1 if value < 0, 0 otherwise 
-	diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value 
+	mask = diff >> 31; // -1 if value < 0, 0 otherwise
+	diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value
 	if (diff > trU) return true;
 
 	diff = ((yuv1 & Vmask) - (yuv2 & Vmask));
-	mask = diff >> 31; // -1 if value < 0, 0 otherwise 
-	diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value 
+	mask = diff >> 31; // -1 if value < 0, 0 otherwise
+	diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value
 	if (diff > trV) return true;
 
 	return false;

Index: thumbnail.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler/thumbnail.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- thumbnail.cpp	24 Jun 2005 15:22:39 -0000	1.2
+++ thumbnail.cpp	30 Jul 2005 21:10:59 -0000	1.3
@@ -31,11 +31,11 @@
 uint16 quadBlockInterpolate(const uint8* src, uint32 srcPitch) {
 	uint16 colorx1y1 = *(((const uint16*)src));
 	uint16 colorx2y1 = *(((const uint16*)src) + 1);
-	
+
 	uint16 colorx1y2 = *(((const uint16*)(src + srcPitch)));
 	uint16 colorx2y2 = *(((const uint16*)(src + srcPitch)) + 1);
-	
-	return Q_INTERPOLATE<bitFormat>(colorx1y1, colorx2y1, colorx1y2, colorx2y2);			
+
+	return Q_INTERPOLATE<bitFormat>(colorx1y1, colorx2y1, colorx1y2, colorx2y2);
 }
 
 template<int bitFormat>
@@ -62,7 +62,7 @@
 			uint16 downleft = quadBlockInterpolate<bitFormat>(src + srcPitch * 2 + 2 * x, srcPitch);
 			uint16 downright = quadBlockInterpolate<bitFormat>(src + srcPitch * 2 + 2 * (x + 2), srcPitch);
 
-			*((uint16*)dstPtr) = Q_INTERPOLATE<bitFormat>(upleft, upright, downleft, downright);			
+			*((uint16*)dstPtr) = Q_INTERPOLATE<bitFormat>(upleft, upright, downleft, downright);
 		}
 		dstPtr += (dstPitch - 2 * width / 4);
 		src += 4 * srcPitch;
@@ -73,9 +73,9 @@
 	// only 1/2 and 1/4 downscale supported
 	if (width != 320 && width != 640)
 		return;
-	
+
 	int downScaleMode = (width == 320) ? 2 : 4;
-	
+
 	if (downScaleMode == 2) {
 		if (gBitFormat == 565)
 			createThumbnail_2<565>(src, srcPitch, dstPtr, dstPitch, width, height);
@@ -93,74 +93,74 @@
 /**
  * Copies the current screen contents to a new surface, using RGB565 format.
  * WARNING: surf->free() must be called by the user to avoid leaking.
- * 
+ *
  * @param surf		the surfce to store the data in it
  */
 static bool grabScreen565(Graphics::Surface *surf) {
 	Graphics::Surface screen;
 	if (!g_system->grabRawScreen(&screen))
 		return false;
-	
+
 	assert(screen.bytesPerPixel == 1 && screen.pixels != 0);
-	
+
 	byte palette[256 * 4];
 	g_system->grabPalette(&palette[0], 0, 256);
-	
+
 	surf->create(screen.w, screen.h, 2);
-	
+
 	for (uint y = 0; y < screen.h; ++y) {
 		for (uint x = 0; x < screen.w; ++x) {
 			byte r, g, b;
 			r = palette[((uint8*)screen.pixels)[y * screen.pitch + x] * 4];
 			g = palette[((uint8*)screen.pixels)[y * screen.pitch + x] * 4 + 1];
 			b = palette[((uint8*)screen.pixels)[y * screen.pitch + x] * 4 + 2];
-			
+
 			((uint16*)surf->pixels)[y * surf->w + x] = (((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F);
 		}
 	}
-	
+
 	screen.free();
 	return true;
 }
 
 bool createThumbnailFromScreen(Graphics::Surface* surf) {
 	assert(surf);
-	
+
 	int screenWidth = g_system->getWidth();
 	int screenHeight = g_system->getHeight();
-	
+
 	Graphics::Surface screen;
 
 	if (!grabScreen565(&screen))
 		return false;
 
 	uint16 width = screenWidth;
-	
+
 	if (screenWidth < 320) {
 		// Special case to handle MM NES (uses a screen width of 256)
 		width = 320;
-		
+
 		// center MM NES screen
 		Graphics::Surface newscreen;
 		newscreen.create(width, screen.h, screen.bytesPerPixel);
-		
+
 		uint8 *dst = (uint8*)newscreen.getBasePtr((320 - screenWidth) / 2, 0);
 		uint8 *src = (uint8*)screen.getBasePtr(0, 0);
 		uint16 height = screen.h;
-		
+
 		while (height--) {
 			memcpy(dst, src, screen.pitch);
 			dst += newscreen.pitch;
 			src += screen.pitch;
 		}
-		
+
 		screen.free();
 		screen = newscreen;
 	} else if (screenWidth == 720) {
 		// Special case to handle Hercules mode
 		width = 640;
 		screenHeight = 400;
-		
+
 		// cut off menu and so on..
 		Graphics::Surface newscreen;
 		newscreen.create(width, 400, screen.bytesPerPixel);
@@ -177,16 +177,16 @@
 		screen.free();
 		screen = newscreen;
 	}
-	
+
 	uint16 newHeight = !(screenHeight % 240) ? kThumbnailHeight2 : kThumbnailHeight1;
-	
+
 	int gBitFormatBackUp = gBitFormat;
 	gBitFormat = 565;
 	surf->create(kThumbnailWidth, newHeight, sizeof(uint16));
-	createThumbnail((const uint8*)screen.pixels, width * sizeof(uint16), (uint8*)surf->pixels, surf->pitch, width, screenHeight);	
+	createThumbnail((const uint8*)screen.pixels, width * sizeof(uint16), (uint8*)surf->pixels, surf->pitch, width, screenHeight);
 	gBitFormat = gBitFormatBackUp;
-	
+
 	screen.free();
-	
+
 	return true;
 }





More information about the Scummvm-git-logs mailing list