From 9897125f9a73c13ec143ac81333d1596b463ec78 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 5 Mar 2011 20:04:05 +0000 Subject: [PATCH] add hq4x filter. i can't tell if i did it right, because all hqx filters look broken to me even when theyre working. --- desmume/src/windows/DeSmuME_2005.vcproj | 64 +- desmume/src/windows/DeSmuME_2008.vcproj | 60 +- desmume/src/windows/DeSmuME_2010.vcxproj | 3 + .../src/windows/DeSmuME_2010.vcxproj.filters | 9 + desmume/src/windows/filter/filter.h | 28 +- desmume/src/windows/filter/hq2x.cpp | 634 ++- desmume/src/windows/filter/hq4x.cpp | 135 + desmume/src/windows/filter/hq4x.dat | 4244 +++++++++++++++++ desmume/src/windows/filter/hq4x.h | 40 + desmume/src/windows/filter/interp.h | 330 +- desmume/src/windows/filter/lq2x.cpp | 606 +-- desmume/src/windows/main.cpp | 70 +- desmume/src/windows/resource.h | 8 +- desmume/src/windows/resources.rc | Bin 957338 -> 958028 bytes desmume/src/windows/video.h | 12 +- 15 files changed, 5358 insertions(+), 885 deletions(-) create mode 100644 desmume/src/windows/filter/hq4x.cpp create mode 100644 desmume/src/windows/filter/hq4x.dat create mode 100644 desmume/src/windows/filter/hq4x.h diff --git a/desmume/src/windows/DeSmuME_2005.vcproj b/desmume/src/windows/DeSmuME_2005.vcproj index 9b8833ac8..923f03561 100644 --- a/desmume/src/windows/DeSmuME_2005.vcproj +++ b/desmume/src/windows/DeSmuME_2005.vcproj @@ -940,6 +940,10 @@ RelativePath=".\filter\epx.cpp" > + + @@ -948,6 +952,14 @@ RelativePath=".\filter\hq2x.h" > + + + + @@ -1631,30 +1643,6 @@ - - - - - - - - - - - - @@ -1667,14 +1655,38 @@ RelativePath="..\addons\slot1_retail.cpp" > + + + + + + + + + + + + - - diff --git a/desmume/src/windows/DeSmuME_2008.vcproj b/desmume/src/windows/DeSmuME_2008.vcproj index af825a1fa..fe57667c8 100644 --- a/desmume/src/windows/DeSmuME_2008.vcproj +++ b/desmume/src/windows/DeSmuME_2008.vcproj @@ -993,30 +993,6 @@ - - - - - - - - - - - - @@ -1029,14 +1005,38 @@ RelativePath="..\addons\slot1_retail.cpp" > + + + + + + + + + + + + + + + + + + diff --git a/desmume/src/windows/DeSmuME_2010.vcxproj b/desmume/src/windows/DeSmuME_2010.vcxproj index 5916d7139..374ab2b9a 100644 --- a/desmume/src/windows/DeSmuME_2010.vcxproj +++ b/desmume/src/windows/DeSmuME_2010.vcxproj @@ -528,6 +528,7 @@ + @@ -665,6 +666,7 @@ + @@ -814,6 +816,7 @@ 7z.exe;un7z_and_touch.bat;%(AdditionalInputs) .libs\wx.tag;%(Outputs) + diff --git a/desmume/src/windows/DeSmuME_2010.vcxproj.filters b/desmume/src/windows/DeSmuME_2010.vcxproj.filters index 74dc693b5..a533195e3 100644 --- a/desmume/src/windows/DeSmuME_2010.vcxproj.filters +++ b/desmume/src/windows/DeSmuME_2010.vcxproj.filters @@ -444,6 +444,9 @@ Core\addons + + Windows\filters + @@ -834,6 +837,9 @@ Core\utils + + Windows\filters + @@ -848,6 +854,9 @@ Windows\resources + + Windows\filters + diff --git a/desmume/src/windows/filter/filter.h b/desmume/src/windows/filter/filter.h index e31ec099b..eea59e3eb 100644 --- a/desmume/src/windows/filter/filter.h +++ b/desmume/src/windows/filter/filter.h @@ -1,21 +1,20 @@ -/* Copyright (C) 2009 DeSmuME team +/* +Copyright (C) 2009-2011 DeSmuME team - This file is part of DeSmuME +This file is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. - DeSmuME is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. +This file is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. - DeSmuME is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with the this software. If not, see . +*/ - You should have received a copy of the GNU General Public License - along with DeSmuME; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ struct SSurface { unsigned char *Surface; @@ -28,6 +27,7 @@ void RenderNearest2X (SSurface Src, SSurface Dst); void RenderLQ2X (SSurface Src, SSurface Dst); void RenderLQ2XS (SSurface Src, SSurface Dst); void RenderHQ2X (SSurface Src, SSurface Dst); +void RenderHQ4X (SSurface Src, SSurface Dst); void RenderHQ2XS (SSurface Src, SSurface Dst); void Render2xSaI (SSurface Src, SSurface Dst); void RenderSuper2xSaI (SSurface Src, SSurface Dst); diff --git a/desmume/src/windows/filter/hq2x.cpp b/desmume/src/windows/filter/hq2x.cpp index a0559d18b..5bddcf4f7 100644 --- a/desmume/src/windows/filter/hq2x.cpp +++ b/desmume/src/windows/filter/hq2x.cpp @@ -31,125 +31,123 @@ #include "filter.h" #include "interp.h" -unsigned interp_mask[2]; -unsigned interp_bits_per_pixel; - -/***************************************************************************/ -/* HQ2x C implementation */ - -/* - * This effect is a rewritten implementation of the hq2x effect made by Maxim Stepin - */ - -static void hq2x_16_def(u16* dst0, u16* dst1, const u16* src0, const u16* src1, const u16* src2, unsigned count) -{ - unsigned i; - - for(i=0;i0) { - c[0] = src0[-1]; - c[3] = src1[-1]; - c[6] = src2[-1]; - } else { - c[0] = c[1]; - c[3] = c[4]; - c[6] = c[7]; - } - - if (i0) { +// c[0] = src0[-1]; +// c[3] = src1[-1]; +// c[6] = src2[-1]; +// } else { +// c[0] = c[1]; +// c[3] = c[4]; +// c[6] = c[7]; +// } +// +// if (i0) { - c[0] = src0[-1]; - c[3] = src1[-1]; - c[6] = src2[-1]; - } else { - c[0] = c[1]; - c[3] = c[4]; - c[6] = c[7]; - } - - if (i> 3; - r = (int)((c[j] & 0xF800)) >> 8; - } else { - b = (int)((c[j] & 0x1F)) << 3; - g = (int)((c[j] & 0x3E0)) >> 2; - r = (int)((c[j] & 0x7C00)) >> 7; - } - const int bright = r+r+r + g+g+g + b+b; - if(bright > maxBright) maxBright = bright; - if(bright < minBright) minBright = bright; - - brightArray[j] = bright; - } - int diffBright = ((maxBright - minBright) * 7) >> 4; - if(diffBright > 7) - { - const int centerBright = brightArray[4]; - if(ABS(brightArray[0] - centerBright) > diffBright) - mask |= 1 << 0; - if(ABS(brightArray[1] - centerBright) > diffBright) - mask |= 1 << 1; - if(ABS(brightArray[2] - centerBright) > diffBright) - mask |= 1 << 2; - if(ABS(brightArray[3] - centerBright) > diffBright) - mask |= 1 << 3; - if(ABS(brightArray[5] - centerBright) > diffBright) - mask |= 1 << 4; - if(ABS(brightArray[6] - centerBright) > diffBright) - mask |= 1 << 5; - if(ABS(brightArray[7] - centerBright) > diffBright) - mask |= 1 << 6; - if(ABS(brightArray[8] - centerBright) > diffBright) - mask |= 1 << 7; - } - -#define P0 dst0[0] -#define P1 dst0[1] -#define P2 dst1[0] -#define P3 dst1[1] -#define MUR false//(ABS(brightArray[1] - brightArray[5]) > diffBright) // top-right -#define MDR false//(ABS(brightArray[5] - brightArray[7]) > diffBright) // bottom-right -#define MDL false//(ABS(brightArray[7] - brightArray[3]) > diffBright) // bottom-left -#define MUL false//(ABS(brightArray[3] - brightArray[1]) > diffBright) // top-left -#define IC(p0) c[p0] -#define I11(p0,p1) interp_16_11(c[p0], c[p1]) -#define I211(p0,p1,p2) interp_16_211(c[p0], c[p1], c[p2]) -#define I31(p0,p1) interp_16_31(c[p0], c[p1]) -#define I332(p0,p1,p2) interp_16_332(c[p0], c[p1], c[p2]) -#define I431(p0,p1,p2) interp_16_431(c[p0], c[p1], c[p2]) -#define I521(p0,p1,p2) interp_16_521(c[p0], c[p1], c[p2]) -#define I53(p0,p1) interp_16_53(c[p0], c[p1]) -#define I611(p0,p1,p2) interp_16_611(c[p0], c[p1], c[p2]) -#define I71(p0,p1) interp_16_71(c[p0], c[p1]) -#define I772(p0,p1,p2) interp_16_772(c[p0], c[p1], c[p2]) -#define I97(p0,p1) interp_16_97(c[p0], c[p1]) -#define I1411(p0,p1,p2) interp_16_1411(c[p0], c[p1], c[p2]) -#define I151(p0,p1) interp_16_151(c[p0], c[p1]) - - switch (mask) { -#include "hq2x.h" - } - -#undef P0 -#undef P1 -#undef P2 -#undef P3 -#undef MUR -#undef MDR -#undef MDL -#undef MUL -#undef IC -#undef I11 -#undef I211 -#undef I31 -#undef I332 -#undef I431 -#undef I521 -#undef I53 -#undef I611 -#undef I71 -#undef I772 -#undef I97 -#undef I1411 -#undef I151 - - src0 += 1; - src1 += 1; - src2 += 1; - dst0 += 2; - dst1 += 2; - } -} +//static void hq2xS_16_def(u16* dst0, u16* dst1, const u16* src0, const u16* src1, const u16* src2, unsigned count) +//{ +// unsigned i; +// +// for(i=0;i0) { +// c[0] = src0[-1]; +// c[3] = src1[-1]; +// c[6] = src2[-1]; +// } else { +// c[0] = c[1]; +// c[3] = c[4]; +// c[6] = c[7]; +// } +// +// if (i> 3; +// r = (int)((c[j] & 0xF800)) >> 8; +// } else { +// b = (int)((c[j] & 0x1F)) << 3; +// g = (int)((c[j] & 0x3E0)) >> 2; +// r = (int)((c[j] & 0x7C00)) >> 7; +// } +// const int bright = r+r+r + g+g+g + b+b; +// if(bright > maxBright) maxBright = bright; +// if(bright < minBright) minBright = bright; +// +// brightArray[j] = bright; +// } +// int diffBright = ((maxBright - minBright) * 7) >> 4; +// if(diffBright > 7) +// { +// const int centerBright = brightArray[4]; +// if(ABS(brightArray[0] - centerBright) > diffBright) +// mask |= 1 << 0; +// if(ABS(brightArray[1] - centerBright) > diffBright) +// mask |= 1 << 1; +// if(ABS(brightArray[2] - centerBright) > diffBright) +// mask |= 1 << 2; +// if(ABS(brightArray[3] - centerBright) > diffBright) +// mask |= 1 << 3; +// if(ABS(brightArray[5] - centerBright) > diffBright) +// mask |= 1 << 4; +// if(ABS(brightArray[6] - centerBright) > diffBright) +// mask |= 1 << 5; +// if(ABS(brightArray[7] - centerBright) > diffBright) +// mask |= 1 << 6; +// if(ABS(brightArray[8] - centerBright) > diffBright) +// mask |= 1 << 7; +// } +// +//#define P0 dst0[0] +//#define P1 dst0[1] +//#define P2 dst1[0] +//#define P3 dst1[1] +//#define MUR false//(ABS(brightArray[1] - brightArray[5]) > diffBright) // top-right +//#define MDR false//(ABS(brightArray[5] - brightArray[7]) > diffBright) // bottom-right +//#define MDL false//(ABS(brightArray[7] - brightArray[3]) > diffBright) // bottom-left +//#define MUL false//(ABS(brightArray[3] - brightArray[1]) > diffBright) // top-left +//#define IC(p0) c[p0] +//#define I11(p0,p1) interp_16_11(c[p0], c[p1]) +//#define I211(p0,p1,p2) interp_16_211(c[p0], c[p1], c[p2]) +//#define I31(p0,p1) interp_16_31(c[p0], c[p1]) +//#define I332(p0,p1,p2) interp_16_332(c[p0], c[p1], c[p2]) +//#define I431(p0,p1,p2) interp_16_431(c[p0], c[p1], c[p2]) +//#define I521(p0,p1,p2) interp_16_521(c[p0], c[p1], c[p2]) +//#define I53(p0,p1) interp_16_53(c[p0], c[p1]) +//#define I611(p0,p1,p2) interp_16_611(c[p0], c[p1], c[p2]) +//#define I71(p0,p1) interp_16_71(c[p0], c[p1]) +//#define I772(p0,p1,p2) interp_16_772(c[p0], c[p1], c[p2]) +//#define I97(p0,p1) interp_16_97(c[p0], c[p1]) +//#define I1411(p0,p1,p2) interp_16_1411(c[p0], c[p1], c[p2]) +//#define I151(p0,p1) interp_16_151(c[p0], c[p1]) +// +// switch (mask) { +//#include "hq2x.h" +// } +// +//#undef P0 +//#undef P1 +//#undef P2 +//#undef P3 +//#undef MUR +//#undef MDR +//#undef MDL +//#undef MUL +//#undef IC +//#undef I11 +//#undef I211 +//#undef I31 +//#undef I332 +//#undef I431 +//#undef I521 +//#undef I53 +//#undef I611 +//#undef I71 +//#undef I772 +//#undef I97 +//#undef I1411 +//#undef I151 +// +// src0 += 1; +// src1 += 1; +// src2 += 1; +// dst0 += 2; +// dst1 += 2; +// } +//} static void hq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, const u32* src2, unsigned count) { @@ -534,35 +532,35 @@ static void hq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, dst1 += 2; } } - -void hq2x(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) -{ - u16 *dst0 = (u16 *)dstPtr; - u16 *dst1 = dst0 + (dstPitch >> 1); - - u16 *src0 = (u16 *)srcPtr; - u16 *src1 = src0 + (srcPitch >> 1); - u16 *src2 = src1 + (srcPitch >> 1); - - hq2x_16_def(dst0, dst1, src0, src0, src1, width); - - int count = height; - - count -= 2; - while(count) { - dst0 += dstPitch; - dst1 += dstPitch; - hq2x_16_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 1; - --count; - } - dst0 += dstPitch; - dst1 += dstPitch; - hq2x_16_def(dst0, dst1, src0, src1, src1, width); -} +// +//void hq2x(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, +// u8 *dstPtr, u32 dstPitch, int width, int height) +//{ +// u16 *dst0 = (u16 *)dstPtr; +// u16 *dst1 = dst0 + (dstPitch >> 1); +// +// u16 *src0 = (u16 *)srcPtr; +// u16 *src1 = src0 + (srcPitch >> 1); +// u16 *src2 = src1 + (srcPitch >> 1); +// +// hq2x_16_def(dst0, dst1, src0, src0, src1, width); +// +// int count = height; +// +// count -= 2; +// while(count) { +// dst0 += dstPitch; +// dst1 += dstPitch; +// hq2x_16_def(dst0, dst1, src0, src1, src2, width); +// src0 = src1; +// src1 = src2; +// src2 += srcPitch >> 1; +// --count; +// } +// dst0 += dstPitch; +// dst1 += dstPitch; +// hq2x_16_def(dst0, dst1, src0, src1, src1, width); +//} void hq2x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, u8 *dstPtr, u32 dstPitch, int width, int height) @@ -591,35 +589,35 @@ void hq2x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, dst1 += dstPitch >> 1; hq2x_32_def(dst0, dst1, src0, src1, src1, width); } - -void hq2xS(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) -{ - u16 *dst0 = (u16 *)dstPtr; - u16 *dst1 = dst0 + (dstPitch >> 1); - - u16 *src0 = (u16 *)srcPtr; - u16 *src1 = src0 + (srcPitch >> 1); - u16 *src2 = src1 + (srcPitch >> 1); - - hq2xS_16_def(dst0, dst1, src0, src0, src1, width); - - int count = height; - - count -= 2; - while(count) { - dst0 += dstPitch; - dst1 += dstPitch; - hq2xS_16_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 1; - --count; - } - dst0 += dstPitch; - dst1 += dstPitch; - hq2xS_16_def(dst0, dst1, src0, src1, src1, width); -} +// +//void hq2xS(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, +// u8 *dstPtr, u32 dstPitch, int width, int height) +//{ +// u16 *dst0 = (u16 *)dstPtr; +// u16 *dst1 = dst0 + (dstPitch >> 1); +// +// u16 *src0 = (u16 *)srcPtr; +// u16 *src1 = src0 + (srcPitch >> 1); +// u16 *src2 = src1 + (srcPitch >> 1); +// +// hq2xS_16_def(dst0, dst1, src0, src0, src1, width); +// +// int count = height; +// +// count -= 2; +// while(count) { +// dst0 += dstPitch; +// dst1 += dstPitch; +// hq2xS_16_def(dst0, dst1, src0, src1, src2, width); +// src0 = src1; +// src1 = src2; +// src2 += srcPitch >> 1; +// --count; +// } +// dst0 += dstPitch; +// dst1 += dstPitch; +// hq2xS_16_def(dst0, dst1, src0, src1, src1, width); +//} void hq2xS32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, u8 *dstPtr, u32 dstPitch, int width, int height) @@ -649,10 +647,10 @@ void hq2xS32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, hq2xS_32_def(dst0, dst1, src0, src1, src1, width); } -void hq2x_init(unsigned bits_per_pixel) -{ - interp_set(bits_per_pixel); -} +//void hq2x_init(unsigned bits_per_pixel) +//{ +// interp_set(bits_per_pixel); +//} void RenderHQ2X (SSurface Src, SSurface Dst) { diff --git a/desmume/src/windows/filter/hq4x.cpp b/desmume/src/windows/filter/hq4x.cpp new file mode 100644 index 000000000..967902934 --- /dev/null +++ b/desmume/src/windows/filter/hq4x.cpp @@ -0,0 +1,135 @@ +/* + * This file is part of the Advance project. + * + * Copyright (C) 2003, 2008 Andrea Mazzoleni + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * In addition, as a special exception, Andrea Mazzoleni + * gives permission to link the code of this program with + * the MAME library (or with modified versions of MAME that use the + * same license as MAME), and distribute linked combinations including + * the two. You must obey the GNU General Public License in all + * respects for all of the code used other than MAME. If you modify + * this file, you may extend this exception to your version of the + * file, but you are not obligated to do so. If you do not wish to + * do so, delete this exception statement from your version. + */ + +#include "filter.h" +#include "interp.h" + +/***************************************************************************/ +/* HQ4x C implementation */ + +/* + * This effect is a rewritten implementation of the hq4x effect made by Maxim Stepin + */ + + +void hq4x_32_def(u32* dst0, u32* dst1, u32* dst2, u32* dst3, const u32* src0, const u32* src1, const u32* src2, unsigned count, unsigned flag) +{ + unsigned i; + + for(i=0;i> 3; - r = (int)((p1 & 0xF800) - (p2 & 0xF800)) >> 8; - } else { - b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; - g = (int)((p1 & 0x3E0) - (p2 & 0x3E0)) >> 2; - r = (int)((p1 & 0x7C00) - (p2 & 0x7C00)) >> 7; - } - - y = r + g + b; - u = r - b; - v = -r + 2*g - b; - - if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT) - return 1; - - if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT) - return 1; - - if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT) - return 1; - -return 0; -} +// +//static int interp_16_diff(u16 p1, u16 p2) +//{ +// int r, g, b; +// int y, u, v; +// +// if (p1 == p2) +// return 0; +// +// if (interp_bits_per_pixel == 16) { +// b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; +// g = (int)((p1 & 0x7E0) - (p2 & 0x7E0)) >> 3; +// r = (int)((p1 & 0xF800) - (p2 & 0xF800)) >> 8; +// } else { +// b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; +// g = (int)((p1 & 0x3E0) - (p2 & 0x3E0)) >> 2; +// r = (int)((p1 & 0x7C00) - (p2 & 0x7C00)) >> 7; +// } +// +// y = r + g + b; +// u = r - b; +// v = -r + 2*g - b; +// +// if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT) +// return 1; +// +// if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT) +// return 1; +// +// if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT) +// return 1; +// +//return 0; +//} static int interp_32_diff(u32 p1, u32 p2) { @@ -281,34 +281,34 @@ static int interp_32_diff(u32 p1, u32 p2) static __forceinline unsigned int ABS(int x) { return (x+(x>>31))^(x>>31); } // faster #define MAX(x,y) ((x) > (y) ? (x) : (y)) #define MIN(x,y) ((x) < (y) ? (x) : (y)) - -static int interp_16_diff2(u16 p1, u16 p2) -{ - int r, g, b; - int y, u, v; - - if ((p1 & 0xF79E) == (p2 & 0xF79E)) - return 0; - - if (interp_bits_per_pixel == 16) { - b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; - g = (int)((p1 & 0x7E0) - (p2 & 0x7E0)) >> 3; - r = (int)((p1 & 0xF800) - (p2 & 0xF800)) >> 8; - } else { - b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; - g = (int)((p1 & 0x3E0) - (p2 & 0x3E0)) >> 2; - r = (int)((p1 & 0x7C00) - (p2 & 0x7C00)) >> 7; - } - -// yb = 30*r + 58*g + 12*b; - y = 33*r + 36*g + 31*b; - u = -14*r - 29*g + 44*b; - v = 62*r - 51*g - 10*b; - - if (11*ABS(y) + 8*ABS(u) + 6*ABS(v) > INTERP_LIMIT2) - return 1; - return 0; -} +// +//static int interp_16_diff2(u16 p1, u16 p2) +//{ +// int r, g, b; +// int y, u, v; +// +// if ((p1 & 0xF79E) == (p2 & 0xF79E)) +// return 0; +// +// if (interp_bits_per_pixel == 16) { +// b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; +// g = (int)((p1 & 0x7E0) - (p2 & 0x7E0)) >> 3; +// r = (int)((p1 & 0xF800) - (p2 & 0xF800)) >> 8; +// } else { +// b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; +// g = (int)((p1 & 0x3E0) - (p2 & 0x3E0)) >> 2; +// r = (int)((p1 & 0x7C00) - (p2 & 0x7C00)) >> 7; +// } +// +//// yb = 30*r + 58*g + 12*b; +// y = 33*r + 36*g + 31*b; +// u = -14*r - 29*g + 44*b; +// v = 62*r - 51*g - 10*b; +// +// if (11*ABS(y) + 8*ABS(u) + 6*ABS(v) > INTERP_LIMIT2) +// return 1; +// return 0; +//} static int interp_32_diff2(u32 p1, u32 p2) { @@ -332,25 +332,25 @@ static int interp_32_diff2(u32 p1, u32 p2) return 0; } - -static void interp_set(unsigned bits_per_pixel) -{ - interp_bits_per_pixel = bits_per_pixel; - - switch (bits_per_pixel) { - case 15 : - interp_mask[0] = 0x7C1F; - interp_mask[1] = 0x03E0; - break; - case 16 : - interp_mask[0] = 0xF81F; - interp_mask[1] = 0x07E0; - break; - case 32 : - interp_mask[0] = 0xFF00FF; - interp_mask[1] = 0x00FF00; - break; - } -} +// +//static void interp_set(unsigned bits_per_pixel) +//{ +// interp_bits_per_pixel = bits_per_pixel; +// +// switch (bits_per_pixel) { +// case 15 : +// interp_mask[0] = 0x7C1F; +// interp_mask[1] = 0x03E0; +// break; +// case 16 : +// interp_mask[0] = 0xF81F; +// interp_mask[1] = 0x07E0; +// break; +// case 32 : +// interp_mask[0] = 0xFF00FF; +// interp_mask[1] = 0x00FF00; +// break; +// } +//} #endif diff --git a/desmume/src/windows/filter/lq2x.cpp b/desmume/src/windows/filter/lq2x.cpp index 086d3cac1..fceec3e34 100644 --- a/desmume/src/windows/filter/lq2x.cpp +++ b/desmume/src/windows/filter/lq2x.cpp @@ -31,244 +31,244 @@ #include "filter.h" #include "interp.h" -static void lq2x_16_def(u16* dst0, u16* dst1, const u16* src0, const u16* src1, const u16* src2, unsigned count) -{ - unsigned i; - - for(i=0;i0) { - c[0] = src0[-1]; - c[3] = src1[-1]; - c[6] = src2[-1]; - } else { - c[0] = c[1]; - c[3] = c[4]; - c[6] = c[7]; - } - - if (i0) { - c[0] = src0[-1]; - c[3] = src1[-1]; - c[6] = src2[-1]; - } else { - c[0] = c[1]; - c[3] = c[4]; - c[6] = c[7]; - } - - if (i> 8; - const int r = (int)((c[j] & 0xF80000)) >> 16; - const int bright = r+r+r + g+g+g + b+b; - if(bright > maxBright) maxBright = bright; - if(bright < minBright) minBright = bright; - - brightArray[j] = bright; - } - int diffBright = ((maxBright - minBright) * 7) >> 4; - if(diffBright > 7) - { - const int centerBright = brightArray[4]; - if(ABS(brightArray[0] - centerBright) > diffBright) - mask |= 1 << 0; - if(ABS(brightArray[1] - centerBright) > diffBright) - mask |= 1 << 1; - if(ABS(brightArray[2] - centerBright) > diffBright) - mask |= 1 << 2; - if(ABS(brightArray[3] - centerBright) > diffBright) - mask |= 1 << 3; - if(ABS(brightArray[5] - centerBright) > diffBright) - mask |= 1 << 4; - if(ABS(brightArray[6] - centerBright) > diffBright) - mask |= 1 << 5; - if(ABS(brightArray[7] - centerBright) > diffBright) - mask |= 1 << 6; - if(ABS(brightArray[8] - centerBright) > diffBright) - mask |= 1 << 7; - } - -#define P0 dst0[0] -#define P1 dst0[1] -#define P2 dst1[0] -#define P3 dst1[1] -#define MUR false -#define MDR false -#define MDL false -#define MUL false -#define IC(p0) c[p0] -#define I11(p0,p1) interp_16_11(c[p0], c[p1]) -#define I211(p0,p1,p2) interp_16_211(c[p0], c[p1], c[p2]) -#define I31(p0,p1) interp_16_31(c[p0], c[p1]) -#define I332(p0,p1,p2) interp_16_332(c[p0], c[p1], c[p2]) -#define I431(p0,p1,p2) interp_16_431(c[p0], c[p1], c[p2]) -#define I521(p0,p1,p2) interp_16_521(c[p0], c[p1], c[p2]) -#define I53(p0,p1) interp_16_53(c[p0], c[p1]) -#define I611(p0,p1,p2) interp_16_611(c[p0], c[p1], c[p2]) -#define I71(p0,p1) interp_16_71(c[p0], c[p1]) -#define I772(p0,p1,p2) interp_16_772(c[p0], c[p1], c[p2]) -#define I97(p0,p1) interp_16_97(c[p0], c[p1]) -#define I1411(p0,p1,p2) interp_16_1411(c[p0], c[p1], c[p2]) -#define I151(p0,p1) interp_16_151(c[p0], c[p1]) - - switch (mask) { -#include "lq2x.h" - } - -#undef P0 -#undef P1 -#undef P2 -#undef P3 -#undef MUR -#undef MDR -#undef MDL -#undef MUL -#undef IC -#undef I11 -#undef I211 -#undef I31 -#undef I332 -#undef I431 -#undef I521 -#undef I53 -#undef I611 -#undef I71 -#undef I772 -#undef I97 -#undef I1411 -#undef I151 - - src0 += 1; - src1 += 1; - src2 += 1; - dst0 += 2; - dst1 += 2; - } -} +//static void lq2x_16_def(u16* dst0, u16* dst1, const u16* src0, const u16* src1, const u16* src2, unsigned count) +//{ +// unsigned i; +// +// for(i=0;i0) { +// c[0] = src0[-1]; +// c[3] = src1[-1]; +// c[6] = src2[-1]; +// } else { +// c[0] = c[1]; +// c[3] = c[4]; +// c[6] = c[7]; +// } +// +// if (i0) { +// c[0] = src0[-1]; +// c[3] = src1[-1]; +// c[6] = src2[-1]; +// } else { +// c[0] = c[1]; +// c[3] = c[4]; +// c[6] = c[7]; +// } +// +// if (i> 8; +// const int r = (int)((c[j] & 0xF80000)) >> 16; +// const int bright = r+r+r + g+g+g + b+b; +// if(bright > maxBright) maxBright = bright; +// if(bright < minBright) minBright = bright; +// +// brightArray[j] = bright; +// } +// int diffBright = ((maxBright - minBright) * 7) >> 4; +// if(diffBright > 7) +// { +// const int centerBright = brightArray[4]; +// if(ABS(brightArray[0] - centerBright) > diffBright) +// mask |= 1 << 0; +// if(ABS(brightArray[1] - centerBright) > diffBright) +// mask |= 1 << 1; +// if(ABS(brightArray[2] - centerBright) > diffBright) +// mask |= 1 << 2; +// if(ABS(brightArray[3] - centerBright) > diffBright) +// mask |= 1 << 3; +// if(ABS(brightArray[5] - centerBright) > diffBright) +// mask |= 1 << 4; +// if(ABS(brightArray[6] - centerBright) > diffBright) +// mask |= 1 << 5; +// if(ABS(brightArray[7] - centerBright) > diffBright) +// mask |= 1 << 6; +// if(ABS(brightArray[8] - centerBright) > diffBright) +// mask |= 1 << 7; +// } +// +//#define P0 dst0[0] +//#define P1 dst0[1] +//#define P2 dst1[0] +//#define P3 dst1[1] +//#define MUR false +//#define MDR false +//#define MDL false +//#define MUL false +//#define IC(p0) c[p0] +//#define I11(p0,p1) interp_16_11(c[p0], c[p1]) +//#define I211(p0,p1,p2) interp_16_211(c[p0], c[p1], c[p2]) +//#define I31(p0,p1) interp_16_31(c[p0], c[p1]) +//#define I332(p0,p1,p2) interp_16_332(c[p0], c[p1], c[p2]) +//#define I431(p0,p1,p2) interp_16_431(c[p0], c[p1], c[p2]) +//#define I521(p0,p1,p2) interp_16_521(c[p0], c[p1], c[p2]) +//#define I53(p0,p1) interp_16_53(c[p0], c[p1]) +//#define I611(p0,p1,p2) interp_16_611(c[p0], c[p1], c[p2]) +//#define I71(p0,p1) interp_16_71(c[p0], c[p1]) +//#define I772(p0,p1,p2) interp_16_772(c[p0], c[p1], c[p2]) +//#define I97(p0,p1) interp_16_97(c[p0], c[p1]) +//#define I1411(p0,p1,p2) interp_16_1411(c[p0], c[p1], c[p2]) +//#define I151(p0,p1) interp_16_151(c[p0], c[p1]) +// +// switch (mask) { +//#include "lq2x.h" +// } +// +//#undef P0 +//#undef P1 +//#undef P2 +//#undef P3 +//#undef MUR +//#undef MDR +//#undef MDL +//#undef MUL +//#undef IC +//#undef I11 +//#undef I211 +//#undef I31 +//#undef I332 +//#undef I431 +//#undef I521 +//#undef I53 +//#undef I611 +//#undef I71 +//#undef I772 +//#undef I97 +//#undef I1411 +//#undef I151 +// +// src0 += 1; +// src1 += 1; +// src2 += 1; +// dst0 += 2; +// dst1 += 2; +// } +//} static void lq2x_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, const u32* src2, unsigned count) { @@ -508,67 +508,67 @@ static void lq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, dst1 += 2; } } -void lq2x16(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) -{ - u16 *dst0 = (u16 *)dstPtr; - u16 *dst1 = dst0 + (dstPitch >> 1); - - u16 *src0 = (u16 *)srcPtr; - u16 *src1 = src0 + (srcPitch >> 1); - u16 *src2 = src1 + (srcPitch >> 1); - - lq2x_16_def(dst0, dst1, src0, src0, src1, width); - if( height == 1 ) return; - - int count = height; - - count -= 2; - while(count>0) { - dst0 += dstPitch; - dst1 += dstPitch; - lq2x_16_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 1; - --count; - } - dst0 += dstPitch; - dst1 += dstPitch; - lq2x_16_def(dst0, dst1, src0, src1, src1, width); -} - -void lq2xS16(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) -{ - u16 *dst0 = (u16 *)dstPtr; - u16 *dst1 = dst0 + (dstPitch >> 1); - - u16 *src0 = (u16 *)srcPtr; - u16 *src1 = src0 + (srcPitch >> 1); - u16 *src2 = src1 + (srcPitch >> 1); - - int count; - - lq2xS_16_def(dst0, dst1, src0, src0, src1, width); - if( height == 1 ) return; - - count = height; - - count -= 2; - while(count>0) { - dst0 += dstPitch; - dst1 += dstPitch; - lq2x_16_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 1; - --count; - } - dst0 += dstPitch; - dst1 += dstPitch; - lq2xS_16_def(dst0, dst1, src0, src1, src1, width); -} +//void lq2x16(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, +// u8 *dstPtr, u32 dstPitch, int width, int height) +//{ +// u16 *dst0 = (u16 *)dstPtr; +// u16 *dst1 = dst0 + (dstPitch >> 1); +// +// u16 *src0 = (u16 *)srcPtr; +// u16 *src1 = src0 + (srcPitch >> 1); +// u16 *src2 = src1 + (srcPitch >> 1); +// +// lq2x_16_def(dst0, dst1, src0, src0, src1, width); +// if( height == 1 ) return; +// +// int count = height; +// +// count -= 2; +// while(count>0) { +// dst0 += dstPitch; +// dst1 += dstPitch; +// lq2x_16_def(dst0, dst1, src0, src1, src2, width); +// src0 = src1; +// src1 = src2; +// src2 += srcPitch >> 1; +// --count; +// } +// dst0 += dstPitch; +// dst1 += dstPitch; +// lq2x_16_def(dst0, dst1, src0, src1, src1, width); +//} +// +//void lq2xS16(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, +// u8 *dstPtr, u32 dstPitch, int width, int height) +//{ +// u16 *dst0 = (u16 *)dstPtr; +// u16 *dst1 = dst0 + (dstPitch >> 1); +// +// u16 *src0 = (u16 *)srcPtr; +// u16 *src1 = src0 + (srcPitch >> 1); +// u16 *src2 = src1 + (srcPitch >> 1); +// +// int count; +// +// lq2xS_16_def(dst0, dst1, src0, src0, src1, width); +// if( height == 1 ) return; +// +// count = height; +// +// count -= 2; +// while(count>0) { +// dst0 += dstPitch; +// dst1 += dstPitch; +// lq2x_16_def(dst0, dst1, src0, src1, src2, width); +// src0 = src1; +// src1 = src2; +// src2 += srcPitch >> 1; +// --count; +// } +// dst0 += dstPitch; +// dst1 += dstPitch; +// lq2xS_16_def(dst0, dst1, src0, src1, src1, width); +//} void lq2x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, u8 *dstPtr, u32 dstPitch, int width, int height) @@ -631,10 +631,10 @@ void lq2xS32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, lq2xS_32_def(dst0, dst1, src0, src1, src1, width); } -void lq2x_init(unsigned bits_per_pixel) -{ - interp_set(bits_per_pixel); -} +//void lq2x_init(unsigned bits_per_pixel) +//{ +// interp_set(bits_per_pixel); +//} void RenderLQ2X (SSurface Src, SSurface Dst) { diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index d57eea995..7ce03b28c 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -1,19 +1,19 @@ -/* main.cpp - Copyright 2006 Theo Berkau - Copyright (C) 2006-2010 DeSmuME team +/* +Copyright 2006 Theo Berkau +Copyright (C) 2006-2011 DeSmuME team - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. +This file is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +This file is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with the this software. If not, see . +You should have received a copy of the GNU General Public License +along with the this software. If not, see . */ // icon gradient: #f6f6fb to #8080c0 @@ -2593,8 +2593,10 @@ int _main() WndY = GetPrivateProfileInt("Video","WindowPosY", CW_USEDEFAULT, IniName); if(WndX < -10000) WndX = CW_USEDEFAULT; // fix for missing window problem if(WndY < -10000) WndY = CW_USEDEFAULT; // (happens if you close desmume while it's minimized) - video.width = GetPrivateProfileInt("Video", "Width", 256, IniName); - video.height = GetPrivateProfileInt("Video", "Height", 384, IniName); + video.width = 256; + video.height = 384; + //video.width = GetPrivateProfileInt("Video", "Width", 256, IniName); + //video.height = GetPrivateProfileInt("Video", "Height", 384, IniName); video.layout_old = video.layout = GetPrivateProfileInt("Video", "LCDsLayout", 0, IniName); if (video.layout > 2) { @@ -2677,8 +2679,18 @@ int _main() } //disable wacky stylus stuff - GlobalAddAtom("MicrosoftTabletPenServiceProperty"); - SetProp(MainWindow->getHWnd(),"MicrosoftTabletPenServiceProperty",(HANDLE)1); + GlobalAddAtom(MICROSOFT_TABLETPENSERVICE_PROPERTY); + SetProp(MainWindow->getHWnd(),MICROSOFT_TABLETPENSERVICE_PROPERTY,(HANDLE)( + TABLET_DISABLE_PRESSANDHOLD | + TABLET_DISABLE_PENTAPFEEDBACK | + TABLET_DISABLE_PENBARRELFEEDBACK | + TABLET_DISABLE_TOUCHUIFORCEON | + TABLET_DISABLE_TOUCHUIFORCEOFF | + TABLET_DISABLE_TOUCHSWITCH | + TABLET_DISABLE_FLICKS | + TABLET_DISABLE_SMOOTHSCROLLING | + TABLET_DISABLE_FLICKFALLBACKKEYS + )); gpu_SetRotateScreen(video.rotation); @@ -2914,7 +2926,7 @@ int _main() GetPrivateProfileString("Firmware", "FirmwareFile", "firmware.bin", CommonSettings.Firmware, 256, IniName); CommonSettings.BootFromFirmware = GetPrivateProfileBool("Firmware", "BootFromFirmware", false, IniName); - video.currentfilter = GetPrivateProfileInt("Video", "Filter", video.NONE, IniName); + video.setfilter(GetPrivateProfileInt("Video", "Filter", video.NONE, IniName)); FilterUpdate(MainWindow->getHWnd(),false); /* Read the firmware settings from the init file */ @@ -4013,6 +4025,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM MainWindow->checkMenu(IDM_RENDER_LQ2X, video.currentfilter == video.LQ2X ); MainWindow->checkMenu(IDM_RENDER_LQ2XS, video.currentfilter == video.LQ2XS ); MainWindow->checkMenu(IDM_RENDER_HQ2X, video.currentfilter == video.HQ2X ); + MainWindow->checkMenu(IDM_RENDER_HQ4X, video.currentfilter == video.HQ4X ); MainWindow->checkMenu(IDM_RENDER_HQ2XS, video.currentfilter == video.HQ2XS ); MainWindow->checkMenu(IDM_RENDER_2XSAI, video.currentfilter == video._2XSAI ); MainWindow->checkMenu(IDM_RENDER_SUPER2XSAI, video.currentfilter == video.SUPER2XSAI ); @@ -4516,16 +4529,6 @@ DOKEYDOWN: NDS_UnPause(); } return 0; - case WM_TABLET_QUERYSYSTEMGESTURESTATUS: - return TABLET_DISABLE_PRESSANDHOLD | - TABLET_DISABLE_PENTAPFEEDBACK | - TABLET_DISABLE_PENBARRELFEEDBACK | - TABLET_DISABLE_TOUCHUIFORCEON | - TABLET_DISABLE_TOUCHUIFORCEOFF | - TABLET_DISABLE_TOUCHSWITCH | - TABLET_DISABLE_FLICKS | - TABLET_DISABLE_SMOOTHSCROLLING | - TABLET_DISABLE_FLICKFALLBACKKEYS; case WM_MOUSEMOVE: case WM_LBUTTONDOWN: @@ -4708,6 +4711,13 @@ DOKEYDOWN: FilterUpdate(hwnd); } break; + case IDM_RENDER_HQ4X: + { + Lock lock (win_backbuffer_sync); + video.setfilter(video.HQ4X); + FilterUpdate(hwnd); + } + break; case IDM_RENDER_HQ2XS: { Lock lock (win_backbuffer_sync); @@ -6507,8 +6517,8 @@ bool DDRAW::createSurfaces(HWND hwnd) else surfDescBack.ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY; - surfDescBack.dwWidth = 384 * 2; - surfDescBack.dwHeight = 384 * 2; + surfDescBack.dwWidth = 384 * 4; + surfDescBack.dwHeight = 384 * 4; if (FAILED(handle->CreateSurface(&surfDescBack, &surface.back, NULL))) return false; if (FAILED(handle->CreateClipper(0, &clip, NULL))) return false; diff --git a/desmume/src/windows/resource.h b/desmume/src/windows/resource.h index b3cf60a73..7a3f59a4a 100644 --- a/desmume/src/windows/resource.h +++ b/desmume/src/windows/resource.h @@ -862,6 +862,12 @@ #define ID_TOOLS_SETFONT 40085 #define ID_CONFIG_SETFONT 40086 #define IDD_FONTCONFIG 40087 +#define ID_MAGNIFICATIONFILTER_HQ4X 40088 +#define IDM_RENDER_HQ4X 40089 +#define ID_40090 40090 +#define ID_MAGNIFICATIONFILTER_HQ4X40091 40091 +#define ID_FILTRI_HQ4X 40092 +#define ID_40093 40093 #define IDC_LABEL_UP 50000 #define IDC_LABEL_RIGHT 50001 #define IDC_LABEL_LEFT 50002 @@ -962,7 +968,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 125 -#define _APS_NEXT_COMMAND_VALUE 40088 +#define _APS_NEXT_COMMAND_VALUE 40094 #define _APS_NEXT_CONTROL_VALUE 1041 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index ef3250b2be11508452ea28fcf1ee8cb5e3ed00b3..2ee5e158e8909c9d5f74959b550bcb303a1b3303 100644 GIT binary patch delta 201 zcmbQW-RjI9tA-ZFElfpyj3(0!qgj2YALwJ^Xt(QQ0%GRvc6}_9&LPVHMVLGor*Bxs z!LmKTfKP+5T_Bznh}nRceY-$B$2&13S^>t~5N2j*{IP|jh))UJ}i3dC$c%)VVE zf#aPRSh5``3B;U0MO^P*!_`k?pRQ2E&DOpnn;VFEw(rR1U2zmHJA-|DnQ BF~9%- diff --git a/desmume/src/windows/video.h b/desmume/src/windows/video.h index 537c27d13..7dd065515 100644 --- a/desmume/src/windows/video.h +++ b/desmume/src/windows/video.h @@ -17,8 +17,8 @@ public: int currentfilter; u8* srcBuffer; - CACHE_ALIGN u32 buffer[4*256*192*2]; - CACHE_ALIGN u32 filteredbuffer[4*256*192*2]; + CACHE_ALIGN u32 buffer[16*256*192*2]; + CACHE_ALIGN u32 filteredbuffer[16*256*192*2]; enum { NONE, @@ -38,6 +38,7 @@ public: EPXPLUS, EPX1POINT5, EPXPLUS1POINT5, + HQ4X, NUM_FILTERS, }; @@ -68,6 +69,10 @@ public: width = 256*3/2; height = 384*3/2; break; + case HQ4X: + width = 256*4; + height = 384*4; + break; default: width = 256*2; height = 384*2; @@ -110,6 +115,9 @@ public: case HQ2X: RenderHQ2X(src, dst); break; + case HQ4X: + RenderHQ4X(src, dst); + break; case HQ2XS: RenderHQ2XS(src, dst); break;