Expand description
Packings used by headerless sensor dumps (CHDK, phone/action-camera dumps, Raspberry Pi, old compacts).
packed_rows: the “packed” layout family, parameterised by load flags: samples ofbitsbits read MSB-first from little-endian words of 8, 16, 24 or 32 bits (flags & 24), rows padded to an even byte count (flags & 128), a pad byte after every 10 samples (flags & 1), sample pairs swapped (flags & 64) and two interlaced fields (flags & 2, second field located at half the file whenflags & 4). Rows are independent whenever they start on a word boundary, which is the common case and decodes in parallel; every other combination runs through a sequential reference implementation.mipi10_rows: MIPI RAW10 (4 samples in 5 bytes, low bits in the 5th byte).loose10_rows: Android “loose” RAW10 (6 samples in each little-endian 64-bit word).u16_rows: 16-bit little/big-endian samples with an optional right shift.
Structs§
- Packed
Params - Geometry of a “packed” payload.
Functions§
- loose10_
rows - Android “loose” RAW10: each little-endian 64-bit word carries 6 samples (LSB first),
rows of
ceil(width / 6) * 8bytes. - mipi10_
rows - MIPI RAW10: 4 samples in 5 bytes (8 high bits each, then a byte of 4x2 low bits).
strideis the byte distance between rows; withreverse_wordseach group of 4 stored bytes is byte-reversed first (Broadcom little-endian dumps). - packed_
rows - Decode a “packed” payload.
fileis the whole file (the interlaced layout addresses its second field relative to the file size),offsetthe payload start. Rows past the end of the data are zero-filled. - packed_
rows_ reference - Bit-exact sequential decode of any packed layout (reference implementation for the parallel path).
- u16_
rows - 16-bit samples (little- or big-endian), shifted right by
shift, rows ofwidthsamples;bottom_upstores the last row first.