diff options
author | Max Horn | 2003-09-29 23:34:43 +0000 |
---|---|---|
committer | Max Horn | 2003-09-29 23:34:43 +0000 |
commit | 7ccafa467cf2d913a8c11a0b440f40c7ba06adf2 (patch) | |
tree | 9c5232f7e27b34c5ccec6cb06a704a7fbdcc5f8b /common/scaler/hq2x.cpp | |
parent | e75eba1a1fbdf2dd025bca6086d1c8b59d5f252f (diff) | |
download | scummvm-rg350-7ccafa467cf2d913a8c11a0b440f40c7ba06adf2.tar.gz scummvm-rg350-7ccafa467cf2d913a8c11a0b440f40c7ba06adf2.tar.bz2 scummvm-rg350-7ccafa467cf2d913a8c11a0b440f40c7ba06adf2.zip |
synced hq2x with upstream changes; some performance tweaks to hq2x/hq3x (I think for bigger speed improvement we'd have to use ASM (with C++ fallback of course)...
svn-id: r10494
Diffstat (limited to 'common/scaler/hq2x.cpp')
-rw-r--r-- | common/scaler/hq2x.cpp | 1084 |
1 files changed, 546 insertions, 538 deletions
diff --git a/common/scaler/hq2x.cpp b/common/scaler/hq2x.cpp index de134373dd..4eef8679e1 100644 --- a/common/scaler/hq2x.cpp +++ b/common/scaler/hq2x.cpp @@ -22,49 +22,59 @@ #include "common/scaler/intern.h" -#define PIXEL00_0 *(q) = w[5]; -#define PIXEL00_10 *(q) = interpolate16_2<bitFormat,3,1>(w[5], w[1]); -#define PIXEL00_11 *(q) = interpolate16_2<bitFormat,3,1>(w[5], w[4]); -#define PIXEL00_12 *(q) = interpolate16_2<bitFormat,3,1>(w[5], w[2]); -#define PIXEL00_20 *(q) = interpolate16_3<bitFormat,2,1,1>(w[5], w[4], w[2]); -#define PIXEL00_30 *(q) = interpolate16_3<bitFormat,6,1,1>(w[5], w[4], w[2]); -#define PIXEL00_40 *(q) = interpolate16_3<bitFormat,14,1,1>(w[5], w[4], w[2]); -#define PIXEL00_50 *(q) = interpolate16_3<bitFormat,5,2,1>(w[5], w[2], w[4]); -#define PIXEL00_51 *(q) = interpolate16_3<bitFormat,5,2,1>(w[5], w[4], w[2]); -#define PIXEL00_60 *(q) = interpolate16_3<bitFormat,2,3,3>(w[5], w[4], w[2]); +#define PIXEL00_0 *(q) = w[5]; +#define PIXEL00_10 *(q) = interpolate16_2<bitFormat,3,1>(w[5], w[1]); +#define PIXEL00_11 *(q) = interpolate16_2<bitFormat,3,1>(w[5], w[4]); +#define PIXEL00_12 *(q) = interpolate16_2<bitFormat,3,1>(w[5], w[2]); +#define PIXEL00_20 *(q) = interpolate16_3<bitFormat,2,1,1>(w[5], w[4], w[2]); +#define PIXEL00_21 *(q) = interpolate16_3<bitFormat,2,1,1>(w[5], w[1], w[2]); +#define PIXEL00_22 *(q) = interpolate16_3<bitFormat,2,1,1>(w[5], w[1], w[4]); +#define PIXEL00_60 *(q) = interpolate16_3<bitFormat,5,2,1>(w[5], w[2], w[4]); +#define PIXEL00_61 *(q) = interpolate16_3<bitFormat,5,2,1>(w[5], w[4], w[2]); +#define PIXEL00_70 *(q) = interpolate16_3<bitFormat,6,1,1>(w[5], w[4], w[2]); +#define PIXEL00_90 *(q) = interpolate16_3<bitFormat,2,3,3>(w[5], w[4], w[2]); +#define PIXEL00_100 *(q) = interpolate16_3<bitFormat,14,1,1>(w[5], w[4], w[2]); -#define PIXEL01_0 *(q+1) = w[5]; -#define PIXEL01_10 *(q+1) = interpolate16_2<bitFormat,3,1>(w[5], w[3]); -#define PIXEL01_11 *(q+1) = interpolate16_2<bitFormat,3,1>(w[5], w[2]); -#define PIXEL01_12 *(q+1) = interpolate16_2<bitFormat,3,1>(w[5], w[6]); -#define PIXEL01_20 *(q+1) = interpolate16_3<bitFormat,2,1,1>(w[5], w[2], w[6]); -#define PIXEL01_30 *(q+1) = interpolate16_3<bitFormat,6,1,1>(w[5], w[2], w[6]); -#define PIXEL01_40 *(q+1) = interpolate16_3<bitFormat,14,1,1>(w[5], w[2], w[6]); -#define PIXEL01_50 *(q+1) = interpolate16_3<bitFormat,5,2,1>(w[5], w[6], w[2]); -#define PIXEL01_51 *(q+1) = interpolate16_3<bitFormat,5,2,1>(w[5], w[2], w[6]); -#define PIXEL01_60 *(q+1) = interpolate16_3<bitFormat,2,3,3>(w[5], w[2], w[6]); +#define PIXEL01_0 *(q+1) = w[5]; +#define PIXEL01_10 *(q+1) = interpolate16_2<bitFormat,3,1>(w[5], w[3]); +#define PIXEL01_11 *(q+1) = interpolate16_2<bitFormat,3,1>(w[5], w[2]); +#define PIXEL01_12 *(q+1) = interpolate16_2<bitFormat,3,1>(w[5], w[6]); +#define PIXEL01_20 *(q+1) = interpolate16_3<bitFormat,2,1,1>(w[5], w[2], w[6]); +#define PIXEL01_21 *(q+1) = interpolate16_3<bitFormat,2,1,1>(w[5], w[3], w[6]); +#define PIXEL01_22 *(q+1) = interpolate16_3<bitFormat,2,1,1>(w[5], w[3], w[2]); +#define PIXEL01_60 *(q+1) = interpolate16_3<bitFormat,5,2,1>(w[5], w[6], w[2]); +#define PIXEL01_61 *(q+1) = interpolate16_3<bitFormat,5,2,1>(w[5], w[2], w[6]); +#define PIXEL01_70 *(q+1) = interpolate16_3<bitFormat,6,1,1>(w[5], w[2], w[6]); +#define PIXEL01_90 *(q+1) = interpolate16_3<bitFormat,2,3,3>(w[5], w[2], w[6]); +#define PIXEL01_100 *(q+1) = interpolate16_3<bitFormat,14,1,1>(w[5], w[2], w[6]); -#define PIXEL10_0 *(q+nextlineDst) = w[5]; -#define PIXEL10_10 *(q+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[7]); -#define PIXEL10_11 *(q+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[8]); -#define PIXEL10_12 *(q+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[4]); -#define PIXEL10_20 *(q+nextlineDst) = interpolate16_3<bitFormat,2,1,1>(w[5], w[8], w[4]); -#define PIXEL10_30 *(q+nextlineDst) = interpolate16_3<bitFormat,6,1,1>(w[5], w[8], w[4]); -#define PIXEL10_40 *(q+nextlineDst) = interpolate16_3<bitFormat,14,1,1>(w[5], w[8], w[4]); -#define PIXEL10_50 *(q+nextlineDst) = interpolate16_3<bitFormat,5,2,1>(w[5], w[4], w[8]); -#define PIXEL10_51 *(q+nextlineDst) = interpolate16_3<bitFormat,5,2,1>(w[5], w[8], w[4]); -#define PIXEL10_60 *(q+nextlineDst) = interpolate16_3<bitFormat,2,3,3>(w[5], w[8], w[4]); +#define PIXEL10_0 *(q+nextlineDst) = w[5]; +#define PIXEL10_10 *(q+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[7]); +#define PIXEL10_11 *(q+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[8]); +#define PIXEL10_12 *(q+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[4]); +#define PIXEL10_20 *(q+nextlineDst) = interpolate16_3<bitFormat,2,1,1>(w[5], w[8], w[4]); +#define PIXEL10_21 *(q+nextlineDst) = interpolate16_3<bitFormat,2,1,1>(w[5], w[7], w[4]); +#define PIXEL10_22 *(q+nextlineDst) = interpolate16_3<bitFormat,2,1,1>(w[5], w[7], w[8]); +#define PIXEL10_60 *(q+nextlineDst) = interpolate16_3<bitFormat,5,2,1>(w[5], w[4], w[8]); +#define PIXEL10_61 *(q+nextlineDst) = interpolate16_3<bitFormat,5,2,1>(w[5], w[8], w[4]); +#define PIXEL10_70 *(q+nextlineDst) = interpolate16_3<bitFormat,6,1,1>(w[5], w[8], w[4]); +#define PIXEL10_90 *(q+nextlineDst) = interpolate16_3<bitFormat,2,3,3>(w[5], w[8], w[4]); +#define PIXEL10_100 *(q+nextlineDst) = interpolate16_3<bitFormat,14,1,1>(w[5], w[8], w[4]); -#define PIXEL11_0 *(q+1+nextlineDst) = w[5]; -#define PIXEL11_10 *(q+1+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[9]); -#define PIXEL11_11 *(q+1+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[6]); -#define PIXEL11_12 *(q+1+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[8]); -#define PIXEL11_20 *(q+1+nextlineDst) = interpolate16_3<bitFormat,2,1,1>(w[5], w[6], w[8]); -#define PIXEL11_30 *(q+1+nextlineDst) = interpolate16_3<bitFormat,6,1,1>(w[5], w[6], w[8]); -#define PIXEL11_40 *(q+1+nextlineDst) = interpolate16_3<bitFormat,14,1,1>(w[5], w[6], w[8]); -#define PIXEL11_50 *(q+1+nextlineDst) = interpolate16_3<bitFormat,5,2,1>(w[5], w[8], w[6]); -#define PIXEL11_51 *(q+1+nextlineDst) = interpolate16_3<bitFormat,5,2,1>(w[5], w[6], w[8]); -#define PIXEL11_60 *(q+1+nextlineDst) = interpolate16_3<bitFormat,2,3,3>(w[5], w[6], w[8]); +#define PIXEL11_0 *(q+1+nextlineDst) = w[5]; +#define PIXEL11_10 *(q+1+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[9]); +#define PIXEL11_11 *(q+1+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[6]); +#define PIXEL11_12 *(q+1+nextlineDst) = interpolate16_2<bitFormat,3,1>(w[5], w[8]); +#define PIXEL11_20 *(q+1+nextlineDst) = interpolate16_3<bitFormat,2,1,1>(w[5], w[6], w[8]); +#define PIXEL11_21 *(q+1+nextlineDst) = interpolate16_3<bitFormat,2,1,1>(w[5], w[9], w[8]); +#define PIXEL11_22 *(q+1+nextlineDst) = interpolate16_3<bitFormat,2,1,1>(w[5], w[9], w[6]); +#define PIXEL11_60 *(q+1+nextlineDst) = interpolate16_3<bitFormat,5,2,1>(w[5], w[8], w[6]); +#define PIXEL11_61 *(q+1+nextlineDst) = interpolate16_3<bitFormat,5,2,1>(w[5], w[6], w[8]); +#define PIXEL11_70 *(q+1+nextlineDst) = interpolate16_3<bitFormat,6,1,1>(w[5], w[6], w[8]); +#define PIXEL11_90 *(q+1+nextlineDst) = interpolate16_3<bitFormat,2,3,3>(w[5], w[6], w[8]); +#define PIXEL11_100 *(q+1+nextlineDst) = interpolate16_3<bitFormat,14,1,1>(w[5], w[6], w[8]); + +#define YUV(x) RGBtoYUV[w[x]] /** * The HQ2x high quality 2x graphics filter. @@ -74,7 +84,6 @@ template<int bitFormat> void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { int w[10]; - int yuv[10]; const uint32 nextlineSrc = srcPitch / sizeof(uint16); const uint16 *p = (const uint16 *)srcPtr; @@ -94,42 +103,41 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, // +----+----+----+ while (height--) { - w[2] = *(p - 1 - nextlineSrc); yuv[2] = RGBtoYUV[w[2]]; - w[5] = *(p - 1); yuv[5] = RGBtoYUV[w[5]]; - w[8] = *(p - 1 + nextlineSrc); yuv[8] = RGBtoYUV[w[8]]; + w[2] = *(p - 1 - nextlineSrc); + w[5] = *(p - 1); + w[8] = *(p - 1 + nextlineSrc); - w[3] = *(p - nextlineSrc); yuv[3] = RGBtoYUV[w[3]]; - w[6] = *(p); yuv[6] = RGBtoYUV[w[6]]; - w[9] = *(p + nextlineSrc); yuv[9] = RGBtoYUV[w[9]]; + w[3] = *(p - nextlineSrc); + w[6] = *(p); + w[9] = *(p + nextlineSrc); int tmpWidth = width; while (tmpWidth--) { p++; - w[1] = w[2]; yuv[1] = yuv[2]; - w[4] = w[5]; yuv[4] = yuv[5]; - w[7] = w[8]; yuv[7] = yuv[8]; + w[1] = w[2]; + w[4] = w[5]; + w[7] = w[8]; - w[2] = w[3]; yuv[2] = yuv[3]; - w[5] = w[6]; yuv[5] = yuv[6]; - w[8] = w[9]; yuv[8] = yuv[9]; + w[2] = w[3]; + w[5] = w[6]; + w[8] = w[9]; - w[3] = *(p - nextlineSrc); yuv[3] = RGBtoYUV[w[3]]; - w[6] = *(p); yuv[6] = RGBtoYUV[w[6]]; - w[9] = *(p + nextlineSrc); yuv[9] = RGBtoYUV[w[9]]; + w[3] = *(p - nextlineSrc); + w[6] = *(p); + w[9] = *(p + nextlineSrc); int pattern = 0; - int flag = 1; - - for (int k = 1; k <= 9; k++) { - if (k == 5) continue; + const int yuv5 = YUV(5); - if (w[k] != w[5]) { - if (diffYUV(yuv[5], yuv[k])) - pattern |= flag; - } - flag <<= 1; - } + if (w[5] != w[1] && diffYUV(yuv5, YUV(1))) pattern |= 0x0001; + if (w[5] != w[2] && diffYUV(yuv5, YUV(2))) pattern |= 0x0002; + if (w[5] != w[3] && diffYUV(yuv5, YUV(3))) pattern |= 0x0004; + if (w[5] != w[4] && diffYUV(yuv5, YUV(4))) pattern |= 0x0008; + if (w[5] != w[6] && diffYUV(yuv5, YUV(6))) pattern |= 0x0010; + if (w[5] != w[7] && diffYUV(yuv5, YUV(7))) pattern |= 0x0020; + if (w[5] != w[8] && diffYUV(yuv5, YUV(8))) pattern |= 0x0040; + if (w[5] != w[9] && diffYUV(yuv5, YUV(9))) pattern |= 0x0080; switch (pattern) { case 0: @@ -157,8 +165,8 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 34: case 130: case 162: - PIXEL00_10 - PIXEL01_10 + PIXEL00_22 + PIXEL01_21 PIXEL10_20 PIXEL11_20 break; @@ -167,9 +175,9 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 48: case 49: PIXEL00_20 - PIXEL01_10 + PIXEL01_22 PIXEL10_20 - PIXEL11_10 + PIXEL11_21 break; case 64: case 65: @@ -177,16 +185,16 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 69: PIXEL00_20 PIXEL01_20 - PIXEL10_10 - PIXEL11_10 + PIXEL10_21 + PIXEL11_22 break; case 8: case 12: case 136: case 140: - PIXEL00_10 + PIXEL00_21 PIXEL01_20 - PIXEL10_10 + PIXEL10_22 PIXEL11_20 break; case 3: @@ -194,7 +202,7 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 131: case 163: PIXEL00_11 - PIXEL01_10 + PIXEL01_21 PIXEL10_20 PIXEL11_20 break; @@ -202,7 +210,7 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 38: case 134: case 166: - PIXEL00_10 + PIXEL00_22 PIXEL01_12 PIXEL10_20 PIXEL11_20 @@ -214,14 +222,14 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL00_20 PIXEL01_11 PIXEL10_20 - PIXEL11_10 + PIXEL11_21 break; case 144: case 145: case 176: case 177: PIXEL00_20 - PIXEL01_10 + PIXEL01_22 PIXEL10_20 PIXEL11_12 break; @@ -231,7 +239,7 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 197: PIXEL00_20 PIXEL01_20 - PIXEL10_10 + PIXEL10_21 PIXEL11_11 break; case 96: @@ -241,13 +249,13 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL00_20 PIXEL01_20 PIXEL10_12 - PIXEL11_10 + PIXEL11_22 break; case 40: case 44: case 168: case 172: - PIXEL00_10 + PIXEL00_21 PIXEL01_20 PIXEL10_11 PIXEL11_20 @@ -258,26 +266,26 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 141: PIXEL00_12 PIXEL01_20 - PIXEL10_10 + PIXEL10_22 PIXEL11_20 break; case 18: case 50: - PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + PIXEL00_22 + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { PIXEL01_20 } PIXEL10_20 - PIXEL11_10 + PIXEL11_21 break; case 80: case 81: PIXEL00_20 - PIXEL01_10 - PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + PIXEL01_22 + PIXEL10_21 + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { PIXEL11_20 @@ -285,37 +293,37 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, break; case 72: case 76: - PIXEL00_10 + PIXEL00_21 PIXEL01_20 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { PIXEL10_20 } - PIXEL11_10 + PIXEL11_22 break; case 10: case 138: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { PIXEL00_20 } - PIXEL01_10 - PIXEL10_10 + PIXEL01_21 + PIXEL10_22 PIXEL11_20 break; case 66: - PIXEL00_10 - PIXEL01_10 - PIXEL10_10 - PIXEL11_10 + PIXEL00_22 + PIXEL01_21 + PIXEL10_21 + PIXEL11_22 break; case 24: - PIXEL00_10 - PIXEL01_10 - PIXEL10_10 - PIXEL11_10 + PIXEL00_21 + PIXEL01_22 + PIXEL10_22 + PIXEL11_21 break; case 7: case 39: @@ -351,21 +359,21 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, break; case 22: case 54: - PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + PIXEL00_22 + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_20 - PIXEL11_10 + PIXEL11_21 break; case 208: case 209: PIXEL00_20 - PIXEL01_10 - PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + PIXEL01_22 + PIXEL10_21 + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 @@ -373,195 +381,195 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, break; case 104: case 108: - PIXEL00_10 + PIXEL00_21 PIXEL01_20 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - PIXEL11_10 + PIXEL11_22 break; case 11: case 139: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - PIXEL01_10 - PIXEL10_10 + PIXEL01_21 + PIXEL10_22 PIXEL11_20 break; case 19: case 51: - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL00_11 PIXEL01_10 } else { - PIXEL00_50 - PIXEL01_60 + PIXEL00_60 + PIXEL01_90 } PIXEL10_20 - PIXEL11_10 + PIXEL11_21 break; case 146: case 178: - PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + PIXEL00_22 + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 PIXEL11_12 } else { - PIXEL01_60 - PIXEL11_51 + PIXEL01_90 + PIXEL11_61 } PIXEL10_20 break; case 84: case 85: PIXEL00_20 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL01_11 PIXEL11_10 } else { - PIXEL01_50 - PIXEL11_60 + PIXEL01_60 + PIXEL11_90 } - PIXEL10_10 + PIXEL10_21 break; case 112: case 113: PIXEL00_20 - PIXEL01_10 - if (diffYUV(yuv[6], yuv[8])) { + PIXEL01_22 + if (diffYUV(YUV(6), YUV(8))) { PIXEL10_12 PIXEL11_10 } else { - PIXEL10_51 - PIXEL11_60 + PIXEL10_61 + PIXEL11_90 } break; case 200: case 204: - PIXEL00_10 + PIXEL00_21 PIXEL01_20 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 PIXEL11_11 } else { - PIXEL10_60 - PIXEL11_50 + PIXEL10_90 + PIXEL11_60 } break; case 73: case 77: - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL00_12 PIXEL10_10 } else { - PIXEL00_51 - PIXEL10_60 + PIXEL00_61 + PIXEL10_90 } PIXEL01_20 - PIXEL11_10 + PIXEL11_22 break; case 42: case 170: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 PIXEL10_11 } else { - PIXEL00_60 - PIXEL10_50 + PIXEL00_90 + PIXEL10_60 } - PIXEL01_10 + PIXEL01_21 PIXEL11_20 break; case 14: case 142: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 PIXEL01_12 } else { - PIXEL00_60 - PIXEL01_51 + PIXEL00_90 + PIXEL01_61 } - PIXEL10_10 + PIXEL10_22 PIXEL11_20 break; case 67: PIXEL00_11 - PIXEL01_10 - PIXEL10_10 - PIXEL11_10 + PIXEL01_21 + PIXEL10_21 + PIXEL11_22 break; case 70: - PIXEL00_10 + PIXEL00_22 PIXEL01_12 - PIXEL10_10 - PIXEL11_10 + PIXEL10_21 + PIXEL11_22 break; case 28: - PIXEL00_10 + PIXEL00_21 PIXEL01_11 - PIXEL10_10 - PIXEL11_10 + PIXEL10_22 + PIXEL11_21 break; case 152: - PIXEL00_10 - PIXEL01_10 - PIXEL10_10 + PIXEL00_21 + PIXEL01_22 + PIXEL10_22 PIXEL11_12 break; case 194: - PIXEL00_10 - PIXEL01_10 - PIXEL10_10 + PIXEL00_22 + PIXEL01_21 + PIXEL10_21 PIXEL11_11 break; case 98: - PIXEL00_10 - PIXEL01_10 + PIXEL00_22 + PIXEL01_21 PIXEL10_12 - PIXEL11_10 + PIXEL11_22 break; case 56: - PIXEL00_10 - PIXEL01_10 + PIXEL00_21 + PIXEL01_22 PIXEL10_11 - PIXEL11_10 + PIXEL11_21 break; case 25: PIXEL00_12 - PIXEL01_10 - PIXEL10_10 - PIXEL11_10 + PIXEL01_22 + PIXEL10_22 + PIXEL11_21 break; case 26: case 31: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } - PIXEL10_10 - PIXEL11_10 + PIXEL10_22 + PIXEL11_21 break; case 82: case 214: - PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + PIXEL00_22 + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } - PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + PIXEL10_21 + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 @@ -569,14 +577,14 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, break; case 88: case 248: - PIXEL00_10 - PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + PIXEL00_21 + PIXEL01_22 + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 @@ -584,44 +592,44 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, break; case 74: case 107: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + PIXEL01_21 + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - PIXEL11_10 + PIXEL11_22 break; case 27: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_10 - PIXEL10_10 - PIXEL11_10 + PIXEL10_22 + PIXEL11_21 break; case 86: - PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + PIXEL00_22 + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } - PIXEL10_10 + PIXEL10_21 PIXEL11_10 break; case 216: - PIXEL00_10 - PIXEL01_10 + PIXEL00_21 + PIXEL01_22 PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 @@ -629,38 +637,38 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, break; case 106: PIXEL00_10 - PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + PIXEL01_21 + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - PIXEL11_10 + PIXEL11_22 break; case 30: PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } - PIXEL10_10 - PIXEL11_10 + PIXEL10_22 + PIXEL11_21 break; case 210: - PIXEL00_10 + PIXEL00_22 PIXEL01_10 - PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + PIXEL10_21 + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 120: - PIXEL00_10 - PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + PIXEL00_21 + PIXEL01_22 + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 @@ -668,321 +676,321 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL11_10 break; case 75: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - PIXEL01_10 + PIXEL01_21 PIXEL10_10 - PIXEL11_10 + PIXEL11_22 break; case 29: PIXEL00_12 PIXEL01_11 - PIXEL10_10 - PIXEL11_10 + PIXEL10_22 + PIXEL11_21 break; case 198: - PIXEL00_10 + PIXEL00_22 PIXEL01_12 - PIXEL10_10 + PIXEL10_21 PIXEL11_11 break; case 184: - PIXEL00_10 - PIXEL01_10 + PIXEL00_21 + PIXEL01_22 PIXEL10_11 PIXEL11_12 break; case 99: PIXEL00_11 - PIXEL01_10 + PIXEL01_21 PIXEL10_12 - PIXEL11_10 + PIXEL11_22 break; case 57: PIXEL00_12 - PIXEL01_10 + PIXEL01_22 PIXEL10_11 - PIXEL11_10 + PIXEL11_21 break; case 71: PIXEL00_11 PIXEL01_12 - PIXEL10_10 - PIXEL11_10 + PIXEL10_21 + PIXEL11_22 break; case 156: - PIXEL00_10 + PIXEL00_21 PIXEL01_11 - PIXEL10_10 + PIXEL10_22 PIXEL11_12 break; case 226: - PIXEL00_10 - PIXEL01_10 + PIXEL00_22 + PIXEL01_21 PIXEL10_12 PIXEL11_11 break; case 60: - PIXEL00_10 + PIXEL00_21 PIXEL01_11 PIXEL10_11 - PIXEL11_10 + PIXEL11_21 break; case 195: PIXEL00_11 - PIXEL01_10 - PIXEL10_10 + PIXEL01_21 + PIXEL10_21 PIXEL11_11 break; case 102: - PIXEL00_10 + PIXEL00_22 PIXEL01_12 PIXEL10_12 - PIXEL11_10 + PIXEL11_22 break; case 153: PIXEL00_12 - PIXEL01_10 - PIXEL10_10 + PIXEL01_22 + PIXEL10_22 PIXEL11_12 break; case 58: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } PIXEL10_11 - PIXEL11_10 + PIXEL11_21 break; case 83: PIXEL00_11 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } - PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + PIXEL10_21 + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 92: - PIXEL00_10 + PIXEL00_21 PIXEL01_11 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 202: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } - PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + PIXEL01_21 + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } PIXEL11_11 break; case 78: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } PIXEL01_12 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } - PIXEL11_10 + PIXEL11_22 break; case 154: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } - PIXEL10_10 + PIXEL10_22 PIXEL11_12 break; case 114: - PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + PIXEL00_22 + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } PIXEL10_12 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 89: PIXEL00_12 - PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + PIXEL01_22 + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 90: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 55: case 23: - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL00_11 PIXEL01_0 } else { - PIXEL00_50 - PIXEL01_60 + PIXEL00_60 + PIXEL01_90 } PIXEL10_20 - PIXEL11_10 + PIXEL11_21 break; case 182: case 150: - PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + PIXEL00_22 + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 PIXEL11_12 } else { - PIXEL01_60 - PIXEL11_51 + PIXEL01_90 + PIXEL11_61 } PIXEL10_20 break; case 213: case 212: PIXEL00_20 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL01_11 PIXEL11_0 } else { - PIXEL01_50 - PIXEL11_60 + PIXEL01_60 + PIXEL11_90 } - PIXEL10_10 + PIXEL10_21 break; case 241: case 240: PIXEL00_20 - PIXEL01_10 - if (diffYUV(yuv[6], yuv[8])) { + PIXEL01_22 + if (diffYUV(YUV(6), YUV(8))) { PIXEL10_12 PIXEL11_0 } else { - PIXEL10_51 - PIXEL11_60 + PIXEL10_61 + PIXEL11_90 } break; case 236: case 232: - PIXEL00_10 + PIXEL00_21 PIXEL01_20 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 PIXEL11_11 } else { - PIXEL10_60 - PIXEL11_50 + PIXEL10_90 + PIXEL11_60 } break; case 109: case 105: - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL00_12 PIXEL10_0 } else { - PIXEL00_51 - PIXEL10_60 + PIXEL00_61 + PIXEL10_90 } PIXEL01_20 - PIXEL11_10 + PIXEL11_22 break; case 171: case 43: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 PIXEL10_11 } else { - PIXEL00_60 - PIXEL10_50 + PIXEL00_90 + PIXEL10_60 } - PIXEL01_10 + PIXEL01_21 PIXEL11_20 break; case 143: case 15: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 PIXEL01_12 } else { - PIXEL00_60 - PIXEL01_51 + PIXEL00_90 + PIXEL01_61 } - PIXEL10_10 + PIXEL10_22 PIXEL11_20 break; case 124: - PIXEL00_10 + PIXEL00_21 PIXEL01_11 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 @@ -990,38 +998,38 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL11_10 break; case 203: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - PIXEL01_10 + PIXEL01_21 PIXEL10_10 PIXEL11_11 break; case 62: PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_11 - PIXEL11_10 + PIXEL11_21 break; case 211: PIXEL00_11 PIXEL01_10 - PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + PIXEL10_21 + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 118: - PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + PIXEL00_22 + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 @@ -1031,9 +1039,9 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, break; case 217: PIXEL00_12 - PIXEL01_10 + PIXEL01_22 PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 @@ -1042,32 +1050,32 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 110: PIXEL00_10 PIXEL01_12 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - PIXEL11_10 + PIXEL11_22 break; case 155: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_10 - PIXEL10_10 + PIXEL10_22 PIXEL11_12 break; case 188: - PIXEL00_10 + PIXEL00_21 PIXEL01_11 PIXEL10_11 PIXEL11_12 break; case 185: PIXEL00_12 - PIXEL01_10 + PIXEL01_22 PIXEL10_11 PIXEL11_12 break; @@ -1075,28 +1083,28 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL00_12 PIXEL01_11 PIXEL10_11 - PIXEL11_10 + PIXEL11_21 break; case 157: PIXEL00_12 PIXEL01_11 - PIXEL10_10 + PIXEL10_22 PIXEL11_12 break; case 103: PIXEL00_11 PIXEL01_12 PIXEL10_12 - PIXEL11_10 + PIXEL11_22 break; case 227: PIXEL00_11 - PIXEL01_10 + PIXEL01_21 PIXEL10_12 PIXEL11_11 break; case 230: - PIXEL00_10 + PIXEL00_22 PIXEL01_12 PIXEL10_12 PIXEL11_11 @@ -1104,45 +1112,45 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 199: PIXEL00_11 PIXEL01_12 - PIXEL10_10 + PIXEL10_21 PIXEL11_11 break; case 220: - PIXEL00_10 + PIXEL00_21 PIXEL01_11 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 158: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } - PIXEL10_10 + PIXEL10_22 PIXEL11_12 break; case 234: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } - PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + PIXEL01_21 + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 @@ -1150,161 +1158,161 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL11_11 break; case 242: - PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + PIXEL00_22 + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } PIXEL10_12 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 59: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } PIXEL10_11 - PIXEL11_10 + PIXEL11_21 break; case 121: PIXEL00_12 - PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + PIXEL01_22 + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 87: PIXEL00_11 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } - PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + PIXEL10_21 + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 79: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_12 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } - PIXEL11_10 + PIXEL11_22 break; case 122: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 94: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 218: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 91: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 229: @@ -1332,58 +1340,58 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL11_12 break; case 186: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } PIXEL10_11 PIXEL11_12 break; case 115: PIXEL00_11 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } PIXEL10_12 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 93: PIXEL00_12 PIXEL01_11 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 206: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } PIXEL01_12 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } PIXEL11_11 break; @@ -1391,19 +1399,19 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 201: PIXEL00_12 PIXEL01_20 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_10 } else { - PIXEL10_30 + PIXEL10_70 } PIXEL11_11 break; case 174: case 46: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_10 } else { - PIXEL00_30 + PIXEL00_70 } PIXEL01_12 PIXEL10_11 @@ -1412,10 +1420,10 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 179: case 147: PIXEL00_11 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_10 } else { - PIXEL01_30 + PIXEL01_70 } PIXEL10_20 PIXEL11_12 @@ -1425,10 +1433,10 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL00_20 PIXEL01_11 PIXEL10_12 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_10 } else { - PIXEL11_30 + PIXEL11_70 } break; case 189: @@ -1445,12 +1453,12 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, break; case 126: PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 @@ -1458,48 +1466,48 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL11_10 break; case 219: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_10 PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 125: - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL00_12 PIXEL10_0 } else { - PIXEL00_51 - PIXEL10_60 + PIXEL00_61 + PIXEL10_90 } PIXEL01_11 PIXEL11_10 break; case 221: PIXEL00_12 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL01_11 PIXEL11_0 } else { - PIXEL01_50 - PIXEL11_60 + PIXEL01_60 + PIXEL11_90 } PIXEL10_10 break; case 207: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 PIXEL01_12 } else { - PIXEL00_60 - PIXEL01_51 + PIXEL00_90 + PIXEL01_61 } PIXEL10_10 PIXEL11_11 @@ -1507,32 +1515,32 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 238: PIXEL00_10 PIXEL01_12 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 PIXEL11_11 } else { - PIXEL10_60 - PIXEL11_50 + PIXEL10_90 + PIXEL11_60 } break; case 190: PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 PIXEL11_12 } else { - PIXEL01_60 - PIXEL11_51 + PIXEL01_90 + PIXEL11_61 } PIXEL10_11 break; case 187: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 PIXEL10_11 } else { - PIXEL00_60 - PIXEL10_50 + PIXEL00_90 + PIXEL10_60 } PIXEL01_10 PIXEL11_12 @@ -1540,21 +1548,21 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 243: PIXEL00_11 PIXEL01_10 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL10_12 PIXEL11_0 } else { - PIXEL10_51 - PIXEL11_60 + PIXEL10_61 + PIXEL11_90 } break; case 119: - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL00_11 PIXEL01_0 } else { - PIXEL00_50 - PIXEL01_60 + PIXEL00_60 + PIXEL01_90 } PIXEL10_12 PIXEL11_10 @@ -1563,19 +1571,19 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 233: PIXEL00_12 PIXEL01_20 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { - PIXEL10_40 + PIXEL10_100 } PIXEL11_11 break; case 175: case 47: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { - PIXEL00_40 + PIXEL00_100 } PIXEL01_12 PIXEL10_11 @@ -1584,10 +1592,10 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, case 183: case 151: PIXEL00_11 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { - PIXEL01_40 + PIXEL01_100 } PIXEL10_20 PIXEL11_12 @@ -1597,34 +1605,34 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL00_20 PIXEL01_11 PIXEL10_12 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { - PIXEL11_40 + PIXEL11_100 } break; case 250: PIXEL00_10 PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 123: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 @@ -1632,12 +1640,12 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL11_10 break; case 95: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 @@ -1647,206 +1655,206 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, break; case 222: PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 252: - PIXEL00_10 + PIXEL00_21 PIXEL01_11 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { - PIXEL11_40 + PIXEL11_100 } break; case 249: PIXEL00_12 - PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + PIXEL01_22 + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { - PIXEL10_40 + PIXEL10_100 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 235: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + PIXEL01_21 + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { - PIXEL10_40 + PIXEL10_100 } PIXEL11_11 break; case 111: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { - PIXEL00_40 + PIXEL00_100 } PIXEL01_12 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - PIXEL11_10 + PIXEL11_22 break; case 63: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { - PIXEL00_40 + PIXEL00_100 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_11 - PIXEL11_10 + PIXEL11_21 break; case 159: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { - PIXEL01_40 + PIXEL01_100 } - PIXEL10_10 + PIXEL10_22 PIXEL11_12 break; case 215: PIXEL00_11 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { - PIXEL01_40 + PIXEL01_100 } - PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + PIXEL10_21 + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 246: - PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + PIXEL00_22 + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_12 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { - PIXEL11_40 + PIXEL11_100 } break; case 254: PIXEL00_10 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { - PIXEL11_40 + PIXEL11_100 } break; case 253: PIXEL00_12 PIXEL01_11 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { - PIXEL10_40 + PIXEL10_100 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { - PIXEL11_40 + PIXEL11_100 } break; case 251: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_10 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { - PIXEL10_40 + PIXEL10_100 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 } break; case 239: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { - PIXEL00_40 + PIXEL00_100 } PIXEL01_12 - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { - PIXEL10_40 + PIXEL10_100 } PIXEL11_11 break; case 127: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { - PIXEL00_40 + PIXEL00_100 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { PIXEL01_20 } - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { PIXEL10_20 @@ -1854,32 +1862,32 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, PIXEL11_10 break; case 191: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { - PIXEL00_40 + PIXEL00_100 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { - PIXEL01_40 + PIXEL01_100 } PIXEL10_11 PIXEL11_12 break; case 223: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { PIXEL00_20 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { - PIXEL01_40 + PIXEL01_100 } PIXEL10_10 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { PIXEL11_20 @@ -1887,38 +1895,38 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, break; case 247: PIXEL00_11 - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { - PIXEL01_40 + PIXEL01_100 } PIXEL10_12 - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { - PIXEL11_40 + PIXEL11_100 } break; case 255: - if (diffYUV(yuv[4], yuv[2])) { + if (diffYUV(YUV(4), YUV(2))) { PIXEL00_0 } else { - PIXEL00_40 + PIXEL00_100 } - if (diffYUV(yuv[2], yuv[6])) { + if (diffYUV(YUV(2), YUV(6))) { PIXEL01_0 } else { - PIXEL01_40 + PIXEL01_100 } - if (diffYUV(yuv[8], yuv[4])) { + if (diffYUV(YUV(8), YUV(4))) { PIXEL10_0 } else { - PIXEL10_40 + PIXEL10_100 } - if (diffYUV(yuv[6], yuv[8])) { + if (diffYUV(YUV(6), YUV(8))) { PIXEL11_0 } else { - PIXEL11_40 + PIXEL11_100 } break; } |