Skip to main content

Module panasonic

Module panasonic 

Source
Expand description

Panasonic / Leica RW2 payload codecs (RawFormat 4–8).

RawFormatBodiesCodingParallel unit
4most RW2 bodies up to 201914 pixels per 16-byte packet, 2-bit shift + 8-bit deltaspacket (row)
5GH5S, G9 high-res10×12-bit or 9×14-bit LSB-packed per 16 bytesrow
6S1/S1R/S1H/S5, GH5 II11×14-bit or 14×12-bit, delta coded per 16 bytesrow
7S1R/S5 high-res9×14-bit LSB-packed per 16 bytesrow
8GH6, G9 II, S5 II, S9 …Huffman-coded 2×2 differences in vertical stripsstrip

Formats 4 and 5 store the stream in 0x4000-byte blocks whose last split bytes come first on disk (BlockedStream). Format 4 reads every 16-byte packet as a 128-bit little-endian integer from its most significant bit down, and each packet carries exactly 128 bits for its 14 pixels; that makes every packet independent even though the format is defined as one sequential stream.

All decoders are bit-exact, including how a short final block is padded with the previous block’s bytes.

Structs§

BlockedStream
A format 4/5 stream: blocks of BLOCK bytes whose first split bytes (in stream order) are stored after the remaining BLOCK - split bytes.
V8Decoder
Format-8 decoder: Huffman-coded differences to a running 2×2 prediction.
V8Params
Format-8 parameters (RW2 tags 0x39–0x48).
V8Strip
One independently coded vertical strip.

Constants§

BLOCK
Size of the rotation blocks of formats 4 and 5.
V4_PIXELS
Pixels per format-4 packet.

Functions§

decode_v4
Decode a format-4 image (width * height samples into out). Rows are independent when width is a multiple of 14 (always the case in practice); otherwise the stream is decoded sequentially.
decode_v5
Format 5: packets run through the blocked stream; every row starts a new packet.
decode_v6
Decode a format-6 image: per row width / ppb packets of 16 bytes, each holding 11 (14-bit) or 14 (12-bit) delta-coded pixels. Only whole 16-row bands are decoded.
decode_v7
Format 7: rows of width / ppp packets stored back to back (no block rotation). Only whole 16-row bands are decoded and trailing columns that do not fill a packet stay zero.
decode_v4_rows
Decode rows first_row..first_row + out.len() / width of a format-4 image whose width is a multiple of 14 (rows are independent).
decode_v4_sequential
Bit-exact sequential reader for Panasonic packets (any width).
decode_v5_rows
Decode rows first_row..first_row + out.len() / width of a format-5 image.
decode_v6_rows
Decode rows first_row..first_row + out.len() / width of a format-6 image.
decode_v7_rows
Decode rows first_row..first_row + out.len() / width of a format-7 image.
packed_pixels
Pixels per 16-byte packet for formats 5 and 7.
v4_packet
Decode one 16-byte format-4 packet into 14 pixels.