111 if (
frame.compInfo[i].superH != 1 ||
frame.compInfo[i].superV != 1)
112 ThrowRDE(
"Unsupported subsampling");
114 int N_COMP =
frame.cps;
116 std::vector<LJpegDecompressor::PerComponentRecipe> rec;
118 std::generate_n(std::back_inserter(rec), N_COMP,
123 return {*hts[i], initPred[i]};
127 {
static_cast<int>(
offX),
static_cast<int>(
offY)},
128 {
static_cast<int>(
w),
static_cast<int>(
h)}};
132 std::numeric_limits<int>::max())
133 ThrowRDE(
"Maximal output tile is too large");
137 if (maxRes.area() != N_COMP * jpegFrameDim.area())
138 ThrowRDE(
"LJpeg frame area does not match maximal tile area");
140 if (maxRes.x % jpegFrameDim.x != 0 || maxRes.y % jpegFrameDim.y != 0)
141 ThrowRDE(
"Maximal output tile size is not a multiple of LJpeg frame size");
143 auto MCUSize =
iPoint2D{maxRes.x / jpegFrameDim.x, maxRes.y / jpegFrameDim.y};
145 ThrowRDE(
"Unexpected MCU size, does not match LJpeg component count");
149 int numLJpegRowsPerRestartInterval;
153 numLJpegRowsPerRestartInterval = jpegFrameDim.y;
155 const int numMCUsPerRow = jpegFrameDim.x;
157 ThrowRDE(
"Restart interval is not a multiple of frame row size");
162 numLJpegRowsPerRestartInterval,
163 input.peekRemainingBuffer().getAsArray1DRef());