Skip to content

Commit

Permalink
LJpegDecompressor::decodeN(): silence implicit conversion issue
Browse files Browse the repository at this point in the history
  • Loading branch information
LebedevRI committed May 6, 2019
1 parent f1c129a commit 7b03342
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/librawspeed/decompressors/LJpegDecompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,14 @@ template <int N_COMP, bool WeirdWidth> void LJpegDecompressor::decodeN() {

unsigned x = 0;

// FIXME: predictor may have value outside of the ushort16.
// https://github.com/darktable-org/rawspeed/issues/175

// For x, we first process all full pixel blocks within the image buffer ...
for (; x < fullBlocks; ++x) {
unroll_loop<N_COMP>([&](int i) {
*dest++ = pred[i] += ht[i]->decodeNext(bitStream);
pred[i] = ushort16(pred[i] + ht[i]->decodeNext(bitStream));
*dest++ = pred[i];
});
}

Expand All @@ -205,7 +209,8 @@ template <int N_COMP, bool WeirdWidth> void LJpegDecompressor::decodeN() {
assert(trailingPixels < N_COMP);
unsigned c = 0;
for (; c < trailingPixels; ++c) {
*dest++ = pred[c] += ht[c]->decodeNext(bitStream);
pred[c] = ushort16(pred[c] + ht[c]->decodeNext(bitStream));
*dest++ = pred[c];
}
// Discard the rest of the block.
assert(c < N_COMP);
Expand Down

0 comments on commit 7b03342

Please sign in to comment.