Skip to main content

Module misc_packed

Module misc_packed 

Source
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 of bits bits 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 when flags & 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§

PackedParams
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) * 8 bytes.
mipi10_rows
MIPI RAW10: 4 samples in 5 bytes (8 high bits each, then a byte of 4x2 low bits). stride is the byte distance between rows; with reverse_words each group of 4 stored bytes is byte-reversed first (Broadcom little-endian dumps).
packed_rows
Decode a “packed” payload. file is the whole file (the interlaced layout addresses its second field relative to the file size), offset the 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 of width samples; bottom_up stores the last row first.