Skip to main content

Module vc5

Module vc5 

Source
Expand description

SMPTE ST 2073 (VC-5) wavelet codec as used by GoPro .GPR files (DNG compression 9).

A GPR tile is one VC-5 bitstream (“VC-5” magic, big-endian 16-bit tag/value pairs) describing a Bayer image as four half-resolution channels (G sum, R−G, B−G, G difference). Each channel is a 3-level 2-D wavelet: one 16-bit lowpass band for the coarsest level plus three run-length/VLC coded, quantised and companded highpass bands per level. Reconstruction runs the vertical then horizontal inverse transform per level (with the per-level prescale), clamps the finest level to 14 bits, then recombines the four channels into the Bayer mosaic through the VC-5 inverse-log curve rescaled to the DNG white level.

The 264-entry run/value code book (table 17 of the standard) is GoPro’s published table (gopro/gpr, Apache-2.0 OR MIT).

Parallelism: the 40 coded bands decode concurrently, channels reconstruct concurrently and the final recombination is row-parallel.

Enums§

CfaPhase
Bayer phase of the output mosaic (colours of the top-left 2x2 block).

Functions§

decode
Decode a VC-5 bitstream (starting at the “VC-5” signature) into a width x height Bayer mosaic (out, row-major). white_level selects the output bit depth of the inverse-log curve (e.g. 4095 → 12-bit samples).