Expand description
Kodak entropy coders and pixel transforms.
- 65000 (DCR, DCS Pro / 7x0 series): rows are split into blocks of up to 256
samples; each block starts with 4-bit difference lengths (two per byte) followed
by the differences, read LSB-first from big-endian 16-bit words. Predictors reset
per block (one per column parity). A length nibble above 12 marks a block stored
as raw 12-bit samples instead. Because a block’s byte length follows from its
length nibbles alone,
scan_65000_rowslocates every row cheaply so rows decode in parallel. - RADC (DC40/DC50): adaptive Huffman-coded predictive scheme on 4-row bands.
- DC120: 8-bit rows stored with a per-row rotation.
- YCbCr 4:2:x to RGB transforms of the C330/C603 compact cameras.
Constants§
- BLOCK_
65000 - Samples per 65000 block.
Functions§
- block_
len_ 65000 - Byte length of one 65000 block of
lensamples starting atdata[pos..], and whether it is a raw (uncompressed 12-bit) block.Noneif the header is truncated. - c330_
row - C330: one output row of
widthRGB pixels from a2 * raw_width-byte YUYV-like row. - c603_
row - C603: one output row from a
3 * width-byte record holding two luma rows and one chroma row (oddselects the second luma row). - dc120_
row - DC120: unrotate one 848-byte row.
- decode_
65000_ row - Decode one CFA row of 65000 data starting at
data[pos..], mapping values throughcurve(out-of-range predictions leave the sample at zero). Returns where the next row starts. - decode_
block_ 65000 - Decode one 65000 block of
lensamples atdata[pos..]intoout(at least(len + 3) & !3rounded up to 8 entries). Returnstruefor a raw block (values are absolute samples rather than differences). - decode_
block_ 65000_ at decode_block_65000, also returning the position just past the block (the next block’s start, asblock_len_65000gives it).- decode_
radc - RADC (Kodak DC40/DC50): decode
height x widthsamples (both at most 512 x 768) intoout(row stridewidth).cbppis the EXIF CompressedBitsPerPixel numerator, which selects the quantisation of the literal-value tree. - gamma_
curve - Inverse transfer table (power
pwrwith a linear toe of slopets, BT.709-style) over0..=imax, used for Kodak compact cameras without a stored curve. - scan_
65000_ rows - Locate the start of every row of a 65000 CFA payload of
width x heightsamples starting atstart(sequential header scan, no entropy decoding).