From 97153f9c3b17bb603e7f51fd872b0633924d0fe1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 27 Jan 2009 01:29:22 +0000 Subject: Removed interpolate16_2 and interpolate16_3 svn-id: r36088 --- graphics/scaler/2xsai.cpp | 6 +++--- graphics/scaler/hq2x_i386.asm | 10 +++++----- graphics/scaler/hq3x_i386.asm | 10 +++++----- graphics/scaler/intern.h | 23 ----------------------- 4 files changed, 13 insertions(+), 36 deletions(-) (limited to 'graphics/scaler') diff --git a/graphics/scaler/2xsai.cpp b/graphics/scaler/2xsai.cpp index f56d5f7e40..37b5457dd8 100644 --- a/graphics/scaler/2xsai.cpp +++ b/graphics/scaler/2xsai.cpp @@ -46,9 +46,9 @@ static inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) { return rmap[y][x]; } -#define interpolate_1_1 interpolate16_2 -#define interpolate_3_1 interpolate16_2 -#define interpolate_6_1_1 interpolate16_3 +#define interpolate_1_1 interpolate16_1_1 > +#define interpolate_3_1 interpolate16_3_1 > +#define interpolate_6_1_1 interpolate16_6_1_1 > #define interpolate_1_1_1_1 interpolate32_1_1_1_1 template diff --git a/graphics/scaler/hq2x_i386.asm b/graphics/scaler/hq2x_i386.asm index 6dd97ed763..3de1095e74 100644 --- a/graphics/scaler/hq2x_i386.asm +++ b/graphics/scaler/hq2x_i386.asm @@ -148,7 +148,7 @@ SECTION .text mov %1,dx %endmacro -; interpolate16_3 +; 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 @@ SECTION .text mov %1,dx %endmacro -; interpolate16_3 +; 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 @@ SECTION .text mov %1, dx %endmacro -; interpolate16_3 +; 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 @@ SECTION .text mov %1, dx %endmacro -; interpolate16_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 @@ SECTION .text mov %1, dx %endmacro -; interpolate16_3 +; 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 diff --git a/graphics/scaler/hq3x_i386.asm b/graphics/scaler/hq3x_i386.asm index 1b470f5663..c3d1daec37 100644 --- a/graphics/scaler/hq3x_i386.asm +++ b/graphics/scaler/hq3x_i386.asm @@ -131,7 +131,7 @@ SECTION .text %%fin: %endmacro -; interpolate16_2 +; 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 @@ SECTION .text mov %1,dx %endmacro -; interpolate16_3 +; 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 @@ SECTION .text mov %1,dx %endmacro -; interpolate16_2 +; 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 @@ SECTION .text mov %1,dx %endmacro -; interpolate16_3 +; 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 @@ SECTION .text mov %1, dx %endmacro -; interpolate16_2 +; interpolate16_1_1 ; Mix two pixels with weight 1 and 1, respectively: (c1+c2)/2; %macro Interp5 3 mov edx,%2 diff --git a/graphics/scaler/intern.h b/graphics/scaler/intern.h index 7546d39021..aec3ad13b5 100644 --- a/graphics/scaler/intern.h +++ b/graphics/scaler/intern.h @@ -76,29 +76,6 @@ static inline uint32 interpolate32_1_1_1_1(uint32 p1, uint32 p2, uint32 p3, uint return x + y; } -/** - * 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 -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 -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 for details on how this works. -- cgit v1.2.3