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 00byte 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§
- Hasselblad
Header - Parsed header of a Hasselblad stream.
Functions§
- decode
- Decode a single-shot stream into
out(width x height, row-major).baseis added to the row-start predictor (0 except for some H4D-60 3FR files). - decode_
par decodethat entropy-decodes large predictor-1 streams on all threads (par_entropy) whenparallelis set. Output and errors are identical todecode: anything speculation cannot prove takes the sequential path.