Skip to content

Instantly share code, notes, and snippets.

@pedrocr
Created February 7, 2016 19:57
Show Gist options
  • Save pedrocr/3c8231de996fa1f330af to your computer and use it in GitHub Desktop.
Save pedrocr/3c8231de996fa1f330af to your computer and use it in GitHub Desktop.
Current rawspeed diff between darktable and upstream
diff -ur RawSpeed/LJpegDecompressor.cpp ../darktable/src/external/rawspeed/RawSpeed/LJpegDecompressor.cpp
--- RawSpeed/LJpegDecompressor.cpp 2016-02-07 19:54:51.799558054 +0000
+++ ../darktable/src/external/rawspeed/RawSpeed/LJpegDecompressor.cpp 2016-01-03 21:17:24.124101832 +0000
@@ -504,9 +504,9 @@
if (rv == 16) {
if (mDNGCompatible)
- htbl->bigTable[i] = (-32768 << 8) | (16 + l);
+ htbl->bigTable[i] = (-(32768 << 8)) | (16 + l);
else
- htbl->bigTable[i] = (-32768 << 8) | l;
+ htbl->bigTable[i] = (-(32768 << 8)) | l;
continue;
}
diff -ur RawSpeed/NefDecoder.cpp ../darktable/src/external/rawspeed/RawSpeed/NefDecoder.cpp
--- RawSpeed/NefDecoder.cpp 2016-02-07 19:54:51.799558054 +0000
+++ ../darktable/src/external/rawspeed/RawSpeed/NefDecoder.cpp 2016-01-17 15:49:24.298701699 +0000
@@ -276,11 +276,11 @@
uint32 y = offset.y;
h = MIN(h + (uint32)offset.y, (uint32)mRaw->dim.y);
w *= cpp;
- BitPumpMSB32 *in = new BitPumpMSB32(&input);
+ BitPumpMSB32 in(&input);
for (; y < h; y++) {
ushort16* dest = (ushort16*) & data[offset.x*sizeof(ushort16)*cpp+y*outPitch];
for (uint32 x = 0 ; x < w; x++) {
- dest[x] = in->getBits(12);
+ dest[x] = in.getBits(12);
}
}
}
@@ -308,17 +308,17 @@
h = MIN(h + (uint32)offset.y, (uint32)mRaw->dim.y);
w *= cpp;
h /= 2;
- BitPumpMSB *in = new BitPumpMSB(&input);
+ BitPumpMSB in(&input);
for (; y < h; y++) {
ushort16* dest = (ushort16*) & data[offset.x*sizeof(ushort16)*cpp+y*2*outPitch];
for (uint32 x = 0 ; x < w; x++) {
- dest[x] = in->getBits(12);
+ dest[x] = in.getBits(12);
}
}
for (y = offset.y; y < h; y++) {
ushort16* dest = (ushort16*) & data[offset.x*sizeof(ushort16)*cpp+(y*2+1)*outPitch];
for (uint32 x = 0 ; x < w; x++) {
- dest[x] = in->getBits(12);
+ dest[x] = in.getBits(12);
}
}
}
diff -ur RawSpeed/X3fDecoder.cpp ../darktable/src/external/rawspeed/RawSpeed/X3fDecoder.cpp
--- RawSpeed/X3fDecoder.cpp 2016-02-07 19:54:51.799558054 +0000
+++ ../darktable/src/external/rawspeed/RawSpeed/X3fDecoder.cpp 2016-01-17 15:49:24.298701699 +0000
@@ -360,7 +360,7 @@
}
/* We have a weird prediction which is actually more appropriate for a CFA image */
- BitPumpMSB *bits = new BitPumpMSB(mFile->getData(plane_offset[i]), mFile->getSize()-plane_offset[i]);
+ BitPumpMSB bits(mFile->getData(plane_offset[i]), mFile->getSize()-plane_offset[i]);
/* Initialize predictors */
int pred_up[4];
int pred_left[2];
@@ -369,22 +369,22 @@
for (int y = 0; y < dim.y; y++) {
ushort16* dst = (ushort16*)mRaw->getData(0, y << subs) + i;
- int diff1= SigmaDecode(bits);
- int diff2 = SigmaDecode(bits);
+ int diff1= SigmaDecode(&bits);
+ int diff2 = SigmaDecode(&bits);
dst[0] = pred_left[0] = pred_up[y & 1] = pred_up[y & 1] + diff1;
dst[3<<subs] = pred_left[1] = pred_up[(y & 1) + 2] = pred_up[(y & 1) + 2] + diff2;
dst += 6<<subs;
// We decode two pixels every loop
for (int x = 2; x < dim.x; x += 2) {
- int diff1 = SigmaDecode(bits);
- int diff2 = SigmaDecode(bits);
+ int diff1 = SigmaDecode(&bits);
+ int diff2 = SigmaDecode(&bits);
dst[0] = pred_left[0] = pred_left[0] + diff1;
dst[3<<subs] = pred_left[1] = pred_left[1] + diff2;
dst += 6<<subs;
}
// If plane is larger than image, skip that number of pixels.
for (int i = 0; i < skipX; i++)
- SigmaSkipOne(bits);
+ SigmaSkipOne(&bits);
}
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment