Squashed 'rtengine/libraw/' content from commit cccb97647
git-subtree-dir: rtengine/libraw git-subtree-split: cccb97647fcee56801fa68231fa8a38aa8b52ef7
This commit is contained in:
39
RawSpeed/rawspeed.samsung-decoder.patch
Normal file
39
RawSpeed/rawspeed.samsung-decoder.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
diff --git a/RawSpeed/SrwDecoder.cpp b/RawSpeed/SrwDecoder.cpp
|
||||
index fa46499..1aff689 100644
|
||||
--- a/RawSpeed/SrwDecoder.cpp
|
||||
+++ b/RawSpeed/SrwDecoder.cpp
|
||||
@@ -141,7 +141,7 @@ void SrwDecoder::decodeCompressed( TiffIFD* raw )
|
||||
// First we decode even pixels
|
||||
for (int c = 0; c < 16; c += 2) {
|
||||
int b = len[(c >> 3)];
|
||||
- int32 adj = ((int32) bits.getBits(b) << (32-b) >> (32-b));
|
||||
+ int32 adj = b > 0 ? ((int32) bits.getBits(b) << (32-b) >> (32-b)) :0;
|
||||
img[c] = adj + img_up[c];
|
||||
}
|
||||
// Now we decode odd pixels
|
||||
@@ -149,7 +149,7 @@ void SrwDecoder::decodeCompressed( TiffIFD* raw )
|
||||
// is beyond me, it will hurt compression a deal.
|
||||
for (int c = 1; c < 16; c += 2) {
|
||||
int b = len[2 | (c >> 3)];
|
||||
- int32 adj = ((int32) bits.getBits(b) << (32-b) >> (32-b));
|
||||
+ int32 adj = b > 0 ? ((int32) bits.getBits(b) << (32-b) >> (32-b)) :0;
|
||||
img[c] = adj + img_up2[c];
|
||||
}
|
||||
} else {
|
||||
@@ -158,14 +158,14 @@ void SrwDecoder::decodeCompressed( TiffIFD* raw )
|
||||
int pred_left = x ? img[-2] : 128;
|
||||
for (int c = 0; c < 16; c += 2) {
|
||||
int b = len[(c >> 3)];
|
||||
- int32 adj = ((int32) bits.getBits(b) << (32-b) >> (32-b));
|
||||
+ int32 adj = b > 0 ? ((int32) bits.getBits(b) << (32-b) >> (32-b)) :0;
|
||||
img[c] = adj + pred_left;
|
||||
}
|
||||
// Now we decode odd pixels
|
||||
pred_left = x ? img[-1] : 128;
|
||||
for (int c = 1; c < 16; c += 2) {
|
||||
int b = len[2 | (c >> 3)];
|
||||
- int32 adj = ((int32) bits.getBits(b) << (32-b) >> (32-b));
|
||||
+ int32 adj = b > 0 ? ((int32) bits.getBits(b) << (32-b) >> (32-b)) :0;
|
||||
img[c] = adj + pred_left;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user