24 unsigned srcWidth,
unsigned* edgeBuf,
EdgeHQ edgeOp);
27 template <
typename Pixel>
29 const Pixel* __restrict in0,
const Pixel* __restrict in1,
30 const Pixel* __restrict in2,
31 Pixel* __restrict out0,
Pixel* __restrict out1,
32 Pixel* __restrict out2,
33 unsigned srcWidth,
unsigned* __restrict edgeBuf,
36 unsigned c1, c2, c3, c4, c5, c6, c7, c8, c9;
37 c2 = c3 = readPixel(in0[0]);
38 c5 = c6 = readPixel(in1[0]);
39 c8 = c9 = readPixel(in2[0]);
42 if (edgeOp(c5, c8)) pattern |= 3 << 6;
43 if (edgeOp(c5, c2)) pattern |= 3 << 9;
45 for (
unsigned x = 0; x < srcWidth; ++x) {
46 c1 = c2; c4 = c5; c7 = c8;
47 c2 = c3; c5 = c6; c8 = c9;
48 if (x != srcWidth - 1) {
49 c3 = readPixel(in0[x + 1]);
50 c6 = readPixel(in1[x + 1]);
51 c9 = readPixel(in2[x + 1]);
54 pattern = (pattern >> 6) & 0x001F;
63 if (edgeOp(c5, c8)) pattern |= 1 << 5;
64 if (edgeOp(c5, c9)) pattern |= 1 << 6;
65 if (edgeOp(c6, c8)) pattern |= 1 << 7;
66 if (edgeOp(c5, c6)) pattern |= 1 << 8;
71 pattern |= ((edgeBuf[x] & (1 << 5) ) << 6) |
72 ((edgeBuf[x] & ((1 << 6) | (1 << 7))) << 3);
75 unsigned pixel0, pixel1, pixel2, pixel3, pixel4,
76 pixel5, pixel6, pixel7, pixel8;
78 #include "HQ3xScaler-1x1to3x3.nn"
80 out0[3 * x + 0] = writePixel<Pixel>(pixel0);
81 out0[3 * x + 1] = writePixel<Pixel>(pixel1);
82 out0[3 * x + 2] = writePixel<Pixel>(pixel2);
83 out1[3 * x + 0] = writePixel<Pixel>(pixel3);
84 out1[3 * x + 1] = writePixel<Pixel>(pixel4);
85 out1[3 * x + 2] = writePixel<Pixel>(pixel5);
86 out2[3 * x + 0] = writePixel<Pixel>(pixel6);
87 out2[3 * x + 1] = writePixel<Pixel>(pixel7);
88 out2[3 * x + 2] = writePixel<Pixel>(pixel8);
94 template <
class Pixel>
101 template <
class Pixel>
103 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
109 src, srcStartY, srcEndY, srcWidth,
110 dst, dstStartY, dstEndY, (srcWidth * 9) / 2);
113 template <
class Pixel>
115 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
121 src, srcStartY, srcEndY, srcWidth,
122 dst, dstStartY, dstEndY, srcWidth * 3);
125 template <
class Pixel>
127 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
133 src, srcStartY, srcEndY, srcWidth,
134 dst, dstStartY, dstEndY, (srcWidth * 9) / 4);
137 template <
class Pixel>
139 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
145 src, srcStartY, srcEndY, srcWidth,
146 dst, dstStartY, dstEndY, (srcWidth * 3) / 2);
149 template <
class Pixel>
151 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
157 src, srcStartY, srcEndY, srcWidth,
158 dst, dstStartY, dstEndY, (srcWidth * 9) / 8);
161 template <
class Pixel>
163 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
169 src, srcStartY, srcEndY, srcWidth,
170 dst, dstStartY, dstEndY, (srcWidth * 3) / 4);