Skip to main content

Module samsung

Module samsung 

Source
Expand description

Samsung SRW compressions.

TIFF compressionnamelayout
32770 + tag 40976V0per-row offsets; 16-sample blocks with a direction bit and four adaptive bit lengths; rows stored as 2x2-transposed pairs
32772V1single predictive Huffman stream (fixed 10-bit table), see crate::nikon_huffman
32773V2rows aligned to 16 bytes; 16-sample blocks with motion-compensated prediction from previous rows, adaptive bit lengths and a quantisation scale

V0 and V2 read bits MSB-first from little-endian 32-bit words, fetching a new word only when the buffered bits run out (Ph1Bits); V2 relies on this exact fetch pattern for its row alignment.

Structs§

Ph1Bits
MSB-first reader over little-endian 32-bit words with lazy word fetches. Reading past the end yields all-ones words and is flagged.

Functions§

decode_v0
Decode Samsung V0 (compression 32770 with a row offset table).
decode_v0_reference
Sequential reference implementation of Samsung V0 (see decode_v0); kept as the specification the two-phase decoder is tested against.
decode_v0_with
decode_v0 with explicit control over parallelism.
decode_v1
Decode Samsung V1 (compression 32772). Returns the row in which the data ran out (None when the stream was complete).
decode_v2
Decode Samsung V2 (compression 32773). src starts at the image data.