23 void operator()(std::span<const Pixel> in0, std::span<const Pixel> in1, std::span<const Pixel> in2,
24 std::span<Pixel> out0, std::span<Pixel> out1, std::span<Pixel> out2,
25 std::span<uint16_t> edgeBuf,
EdgeHQLite edgeOp);
28template<std::
unsigned_
integral Pixel>
30 std::span<const Pixel> in0, std::span<const Pixel> in1, std::span<const Pixel> in2,
31 std::span<Pixel> out0, std::span<Pixel> out1, std::span<Pixel> out2,
32 std::span<uint16_t> edgeBuf,
35 auto srcWidth = edgeBuf.size();
36 assert(in0.size() == srcWidth);
37 assert(in1.size() == srcWidth);
38 assert(in2.size() == srcWidth);
39 assert(out0.size() == 3 * srcWidth);
40 assert(out1.size() == 3 * srcWidth);
41 assert(out2.size() == 3 * srcWidth);
44 auto c5 =
readPixel(in1[0]);
auto c6 = c5;
45 auto c8 =
readPixel(in2[0]);
auto c9 = c8;
48 if (c5 != c8) pattern |= 3 << 6;
49 if (c5 != c2) pattern |= 3 << 9;
51 for (
auto x :
xrange(srcWidth)) {
55 if (x != srcWidth - 1) {
60 pattern = (pattern >> 6) & 0x001F;
69 if (c5 != c8) pattern |= 1 << 5;
70 if (c5 != c9) pattern |= 1 << 6;
71 if (c6 != c8) pattern |= 1 << 7;
72 if (c5 != c6) pattern |= 1 << 8;
77 pattern |= ((edgeBuf[x] & (1 << 5) ) << 6) |
78 ((edgeBuf[x] & ((1 << 6) | (1 << 7))) << 3);
79 edgeBuf[x] = narrow_cast<uint16_t>(pattern);
81 unsigned pixel0, pixel1, pixel2, pixel3, pixel4,
82 pixel5, pixel6, pixel7, pixel8;
84#include "HQ3xLiteScaler-1x1to3x3.nn"
86 out0[3 * x + 0] = writePixel<Pixel>(pixel0);
87 out0[3 * x + 1] = writePixel<Pixel>(pixel1);
88 out0[3 * x + 2] = writePixel<Pixel>(pixel2);
89 out1[3 * x + 0] = writePixel<Pixel>(pixel3);
90 out1[3 * x + 1] = writePixel<Pixel>(pixel4);
91 out1[3 * x + 2] = writePixel<Pixel>(pixel5);
92 out2[3 * x + 0] = writePixel<Pixel>(pixel6);
93 out2[3 * x + 1] = writePixel<Pixel>(pixel7);
94 out2[3 * x + 2] = writePixel<Pixel>(pixel8);
99template<std::
unsigned_
integral Pixel>
102 , pixelOps(pixelOps_)
106template<std::
unsigned_
integral Pixel>
108 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
114 src, srcStartY, srcEndY, srcWidth,
115 dst, dstStartY, dstEndY);
118template<std::
unsigned_
integral Pixel>
120 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
126 src, srcStartY, srcEndY, srcWidth,
127 dst, dstStartY, dstEndY);
130template<std::
unsigned_
integral Pixel>
132 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
138 src, srcStartY, srcEndY, srcWidth,
139 dst, dstStartY, dstEndY);
142template<std::
unsigned_
integral Pixel>
144 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
150 src, srcStartY, srcEndY, srcWidth,
151 dst, dstStartY, dstEndY);
154template<std::
unsigned_
integral Pixel>
156 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
162 src, srcStartY, srcEndY, srcWidth,
163 dst, dstStartY, dstEndY);
166template<std::
unsigned_
integral Pixel>
168 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
174 src, srcStartY, srcEndY, srcWidth,
175 dst, dstStartY, dstEndY);
Interface for getting lines from a video frame.
void scale1x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale4x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale4x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale8x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
HQ3xLiteScaler(const PixelOperations< Pixel > &pixelOps)
void scale2x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
void scale2x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Polymorphic wrapper around another line scaler.
Base class for 3x scalers.
This file implemented 3 utility functions:
uint32_t readPixel(Pixel p)
void operator()(std::span< const Pixel > in0, std::span< const Pixel > in1, std::span< const Pixel > in2, std::span< Pixel > out0, std::span< Pixel > out1, std::span< Pixel > out2, std::span< uint16_t > edgeBuf, EdgeHQLite edgeOp)
constexpr auto xrange(T e)