Expand description
Olympus / OM System ORF lossless compression.
A single MSB-first bit stream codes every sample of the frame as an adaptive
Golomb-like residual. Even and odd columns form two interleaved channels: each
channel keeps its own adaptation state (previous code magnitude, a run counter
of small codes and a smoothed residual), and predicts from same-colour
neighbours two pixels to the left (W), above (N) and diagonal (NW).
Per sample:
- sign bit, then
low_bits(usually 2) literal low bits, thenextra_bits(usually 0) bits appended below the reconstructed value; - a unary-coded “high” part (number of zeros before a one, escape after
max_highzeros to a fixed-width field), thenwbits“low” bits, wherewbitsadapts to the magnitude of the previous same-channel code; - the code is combined with the smoothed residual and added to the edge-sensitive median prediction.
The camera describes the coder with tags 0x640..0x653 of the makernote
ImageProcessing directory (OlympusParams); every body to date uses the same
values, which are also the defaults. The stream is inherently sequential.
Structs§
- Olympus
Params - Coder parameters (makernote ImageProcessing tags 0x640..0x653).
Functions§
- decode
- Decode a full
width x heightframe intoout(row-major,widthstride).datastarts at the stream header. Returns an error on malformed parameters or a stream that runs out of data. - decode_
with decode, optionally overlapping entropy decoding and prediction on two threads.- stream_
start - Offset of the bit stream after the header, checking the header contents.