Dear Developers,

while examining raw files from Olympus OM-D E-M5MarkII i've found that
coding is fairly simple, no compression - just packing of 2x12bpp into 3
bytes. Based on Dave Coffin's dcraw here is my version of load_raw just for
this case:

void CLASS olympus_load_hires()
{
    uchar buf[16];
    unsigned val;
    int row, col, i=15;
    for (row=0; row < height; row++) {
        for (col=0; col < raw_width; col+=2) {
            if(i==15) {
                fread(buf, 16, 1, ifp);
                i=0;
            }
            val = *(unsigned *)(&buf[i]);

            BAYER(row,col) = val & 0x00000fff;
            BAYER(row, col+1) = (val>>12) & 0x00000fff;
            i+=3;
        }
    }
}

The file is read by 16 bytes chunks, 15 of them is decoded into 5 pixels,
buf[15] is always 0 (unused).
Total length of strip is width x height x 1.6, ie 9280 x 6932 x 1.6 =
102926336, as indicated by tag #0x0117; this may be used as indication of
HiRes shot. It's possible that tag #0x0604 (ImageQuality3) also depends on
mode (0=HiRes, 1=Normal), but it's only guess.

Please feel free to use this idea in next release of DarkTable!

Yours,
Krzysztof Spera

PS. Same info sent to Dave.
K

___________________________________________________________________________
darktable developer mailing list
to unsubscribe send a mail to [email protected]

Reply via email to