Skip to main content

Module dct12

Module dct12 

Source
Expand description

12-bit DCT tiles used by early Blackmagic cinema DNGs (compression 7 with an SOF1 frame instead of SOF3).

Single-component sequential DCT: the DC coefficient is DPCM-coded with the class-0 Huffman table, AC coefficients use the class-1 table with JPEG run/size symbols, quantisation tables carry 16-bit entries, and the inverse transform is the direct separable cosine sum. The arithmetic below (f32 accumulation order, √½ scaling of the first row/column, +0.5 then truncation, clamp to u16) is fixed so that the output is bit-exact and deterministic across platforms.

Structs§

Dct12
Parsed stream headers.