[Scummvm-cvs-logs] SF.net SVN: scummvm:[36049] scummvm/trunk/graphics
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sun Jan 25 05:29:26 CET 2009
Revision: 36049
http://scummvm.svn.sourceforge.net/scummvm/?rev=36049&view=rev
Author: fingolfin
Date: 2009-01-25 04:29:25 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
Renamed lowBits -> kLowBitsMask and highBits -> kHighBitsMask
Modified Paths:
--------------
scummvm/trunk/graphics/colormasks.h
scummvm/trunk/graphics/scaler/intern.h
scummvm/trunk/graphics/scaler.cpp
Modified: scummvm/trunk/graphics/colormasks.h
===================================================================
--- scummvm/trunk/graphics/colormasks.h 2009-01-25 01:58:16 UTC (rev 36048)
+++ scummvm/trunk/graphics/colormasks.h 2009-01-25 04:29:25 UTC (rev 36049)
@@ -56,7 +56,7 @@
appropriate data).
- The highBits / lowBits / qhighBits / qlowBits are special values that are
+ The kHighBitsMask / kLowBitsMask / qhighBits / qlowBits are special values that are
used in the super-optimized interpolation functions in scaler/intern.h
and scaler/aspect.cpp. Currently they are only available in 555 and 565 mode.
To be specific: They pack the masks for two 16 bit pixels at once. The pixels
@@ -70,8 +70,8 @@
template<>
struct ColorMasks<565> {
enum {
- highBits = 0xF7DEF7DE,
- lowBits = 0x08210821,
+ kHighBitsMask = 0xF7DEF7DE,
+ kLowBitsMask = 0x08210821,
qhighBits = 0xE79CE79C,
qlowBits = 0x18631863,
@@ -88,21 +88,21 @@
kGreenShift = kBlueBits,
kBlueShift = 0,
- kAlphaMask = ((1 << kAlphaBits) - 1) << kAlphaShift,
- kRedMask = ((1 << kRedBits) - 1) << kRedShift,
- kGreenMask = ((1 << kGreenBits) - 1) << kGreenShift,
- kBlueMask = ((1 << kBlueBits) - 1) << kBlueShift,
+ kAlphaMask = ((1 << kAlphaBits) - 1) << kAlphaShift,
+ kRedMask = ((1 << kRedBits) - 1) << kRedShift,
+ kGreenMask = ((1 << kGreenBits) - 1) << kGreenShift,
+ kBlueMask = ((1 << kBlueBits) - 1) << kBlueShift,
- kRedBlueMask = kRedMask | kBlueMask
-
+ kRedBlueMask = kRedMask | kBlueMask,
+ kLowBits = (1 << kRedShift) | (1 << kGreenShift) | (1 << kBlueShift)
};
};
template<>
struct ColorMasks<555> {
enum {
- highBits = 0x7BDE7BDE,
- lowBits = 0x04210421,
+ kHighBitsMask = 0x7BDE7BDE,
+ kLowBitsMask = 0x04210421,
qhighBits = 0x739C739C,
qlowBits = 0x0C630C63,
@@ -124,7 +124,8 @@
kGreenMask = ((1 << kGreenBits) - 1) << kGreenShift,
kBlueMask = ((1 << kBlueBits) - 1) << kBlueShift,
- kRedBlueMask = kRedMask | kBlueMask
+ kRedBlueMask = kRedMask | kBlueMask,
+ kLowBits = (1 << kRedShift) | (1 << kGreenShift) | (1 << kBlueShift)
};
};
Modified: scummvm/trunk/graphics/scaler/intern.h
===================================================================
--- scummvm/trunk/graphics/scaler/intern.h 2009-01-25 01:58:16 UTC (rev 36048)
+++ scummvm/trunk/graphics/scaler/intern.h 2009-01-25 04:29:25 UTC (rev 36049)
@@ -30,8 +30,8 @@
#include "graphics/colormasks.h"
-#define highBits Graphics::ColorMasks<bitFormat>::highBits
-#define lowBits Graphics::ColorMasks<bitFormat>::lowBits
+#define kHighBitsMask Graphics::ColorMasks<bitFormat>::kHighBitsMask
+#define kLowBitsMask Graphics::ColorMasks<bitFormat>::kLowBitsMask
#define qhighBits Graphics::ColorMasks<bitFormat>::qhighBits
#define qlowBits Graphics::ColorMasks<bitFormat>::qlowBits
#define redblueMask Graphics::ColorMasks<bitFormat>::kRedBlueMask
@@ -45,7 +45,7 @@
*/
template<int bitFormat>
static inline uint32 interpolate32_1_1(uint32 A, uint32 B) {
- return (((A & highBits) >> 1) + ((B & highBits) >> 1) + (A & B & lowBits));
+ return (((A & kHighBitsMask) + (B & kHighBitsMask)) >> 1) + (A & B & kLowBitsMask);
}
/**
@@ -99,55 +99,6 @@
}
-template<int bitFormat>
-static inline unsigned interpolate16_3_1(unsigned c1, unsigned c2) {
- const unsigned lowbits=(((c1<<1)&(lowBits<<1))+(c1&qlowBits)+(c2&qlowBits))&qlowBits;
- return ((c1*3+c2) - lowbits) >> 2;
-}
-
-template<int bitFormat>
-static inline unsigned interpolate16_2_1_1(unsigned c1, unsigned c2, unsigned c3) {
- c1<<=1;
- const unsigned lowbits=((c1&(lowBits<<1))+(c2&qlowBits)+(c3&qlowBits))&qlowBits;
- return ((c1+c2+c3) - lowbits) >> 2;
-}
-
-template<int bitFormat>
-static inline unsigned interpolate16_1_1(unsigned c1, unsigned c2) {
- return ( c1+c2 - ((c1^c2)&lowBits) ) >> 1;
-}
-
-template<int bitFormat>
-static inline unsigned interpolate16_5_2_1(unsigned c1, unsigned c2, unsigned c3) {
- c2<<=1;
- const unsigned lowbits=( ((c1<<2)&(lowBits<<2))+(c1&0x1CE7)+(c2&0x18C6)+(c3&0x1CE7) ) & 0x1CE7;
- return ((c1*5+c2+c3) - lowbits) >> 3;
-}
-
-template<int bitFormat>
-static inline unsigned interpolate16_6_1_1(unsigned c1, unsigned c2, unsigned c3) {
- const unsigned lowbits=(((((c1<<1)&(lowBits<<1))+(c1&qlowBits))<<1)+(c2&0x1CE7)+(c3&0x1CE7))&0x1CE7;
- return ((c1*6+c2+c3) - lowbits) >> 3;
-}
-
-template<int bitFormat>
-static inline unsigned interpolate16_2_3_3(unsigned c1, unsigned c2, unsigned c3) {
- c1<<=1;
- const unsigned rb=(c1&(redblueMask<<1))+((c2&redblueMask)+(c3&redblueMask))*3;
- const unsigned g=(c1&(greenMask<<1))+((c2&greenMask)+(c3&greenMask))*3;
- return ((rb&(redblueMask<<3))|(g&(greenMask<<8)))>>3;
-}
-
-template<int bitFormat>
-static inline unsigned interpolate16_14_1_1(unsigned c1, unsigned c2, unsigned c3) {
- const unsigned rb=(c1&redblueMask)*14+(c2&redblueMask)+(c3&redblueMask);
- const unsigned g=(c1&greenMask)*14+(c2&greenMask)+(c3&greenMask);
- return ((rb&(redblueMask<<4))|(g&(greenMask<<4)))>>4;
-}
-
-
-
-
/**
* Compare two YUV values (encoded 8-8-8) and check if they differ by more than
* a certain hard coded threshold. Used by the hq scaler family.
Modified: scummvm/trunk/graphics/scaler.cpp
===================================================================
--- scummvm/trunk/graphics/scaler.cpp 2009-01-25 01:58:16 UTC (rev 36048)
+++ scummvm/trunk/graphics/scaler.cpp 2009-01-25 04:29:25 UTC (rev 36049)
@@ -121,21 +121,21 @@
gBitFormat = BitFormat;
#ifndef DISABLE_HQ_SCALERS
- #undef highBits;
- #undef lowBits;
+ #undef kHighBitsMask;
+ #undef kLowBitsMask;
if (gBitFormat == 555) {
InitLUT(Graphics::createPixelFormat<555>());
#ifdef USE_NASM
- hqx_highbits = Graphics::ColorMasks<555>::highBits;
- hqx_lowbits = Graphics::ColorMasks<555>::lowBits & 0xFFFF;
+ hqx_highbits = Graphics::ColorMasks<555>::kHighBitsMask;
+ hqx_lowbits = Graphics::ColorMasks<555>::kLowBitsMask & 0xFFFF;
#endif
}
if (gBitFormat == 565) {
InitLUT(Graphics::createPixelFormat<565>());
#ifdef USE_NASM
- hqx_highbits = Graphics::ColorMasks<565>::highBits;
- hqx_lowbits = Graphics::ColorMasks<565>::lowBits & 0xFFFF;
+ hqx_highbits = Graphics::ColorMasks<565>::kHighBitsMask;
+ hqx_lowbits = Graphics::ColorMasks<565>::kLowBitsMask & 0xFFFF;
#endif
}
#endif
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