There might be some unhandled case in our lossless decoder and maybe also in dcraw, or there may be some encoder misconfiguration.
Test #1 - you can use any build with lossless compression enabled:To find out whether the fault is in our decoders, or on the encoder side, try loading a lossless silent DNG in pic_view from file_man. Only run this if mlv_dump or dcraw output is obviously wrong (maybe as in the above example, maybe with other defects).
Results:
- Looks fine? The problem is in our PC-based decoders (dcraw, mlv_dump).
- Image from pic_view has the same defects as with dcraw/mlv_dump? The problem is in the encoder configuration (lossless.c).
- Image from pic_view broken, or playback doesn't work? Look at Canon's lossless decoding stubs, or at the way we call it from pic_view/mlv_play.
Test #2 - you need to compile a custom silent.mo:To check whether this bug affects your camera (applies to
any model that supports lossless compression), or to investigate and hopefully fix it, follow these steps:
Step 1: save some image as both 14-bit lossless *and* 14-bit uncompressed (it *must* be the same image, not just the same static scene):
diff -r 8ee7858f0d7e modules/silent/silent.c
--- a/modules/silent/silent.c
+++ b/modules/silent/silent.c
@@ -560,3 +560,5 @@
if (!ok) bmp_printf( FONT_MED, 0, 83, "DNG save error (card full?)");
- return ok;
+ extern void reverse_bytes_order(char*, int);
+ reverse_bytes_order(raw_info->buffer, raw_info->frame_size);
+ /* fall through */
}
Step 2: compare the raw data and check whether there are any differences (on 6D and 650D, there will be; on other models, hopefully not):
dcraw -4 -E 12340000.DNG 12340001.DNG
md5sum 12340000.pgm 12340001.pgm
Step 3: if the two checksums are different, investigate the differences (
tutorial):
octave:1> a = imread('12340000.pgm');
octave:2> b = imread('12340001.pgm');
octave:3> manual inspection, imshow(a - b, []) etc
Step 4: adjust the lossless decoder (either the one from dcraw, or lj92.c from mlv_dump) or the
encoder configuration (lossless.c) until these differences disappear (how? I don't know, you need to experiment)
Step 5: repeat for 650D and all other models (I've ran this test on 5D3, got identical checksums at step 2)
Good luck!