Skip to main content

Module hasselblad

Module hasselblad 

Source
Expand description

Hasselblad lossless JPEG variant (3FR/FFF, Imacon/Flexcolor, H/X/CFV backs).

The stream starts with ordinary JPEG markers (SOF3, DHT, SOS) but the scan is not standard lossless JPEG:

  • bits are read MSB-first from 32-bit little-endian words, with no FF 00 byte stuffing;
  • pixels are coded in pairs: two Huffman length symbols, then the two difference values (a length-16 code of all ones means -32768);
  • prediction is from the same-colour neighbour two columns to the left, starting each row at 0x8000 + base_offset; predictor 11 additionally adds half the horizontal gradient of the row two above.

The stream is a single sequential bit stream (no restart markers or row index).

Structs§

HasselbladHeader
Parsed header of a Hasselblad stream.

Functions§

decode
Decode a single-shot stream into out (width x height, row-major). base is added to the row-start predictor (0 except for some H4D-60 3FR files).
decode_par
decode that entropy-decodes large predictor-1 streams on all threads (par_entropy) when parallel is set. Output and errors are identical to decode: anything speculation cannot prove takes the sequential path.