Expand description
Canonical entropy models: a deterministic, integer-only (no floating point) frequency-table normalizer and its wire serialization.
A model is a frequency table over a fixed byte alphabet (ALPHABET = 256)
whose entries sum to exactly 1 << scale_bits. Normalization from raw symbol
counts is a pure function of the counts and scale_bits: identical inputs
always produce identical output bytes. This is the substrate rANS will later
consume; no entropy coder lives here yet.
Structs§
- Entropy
Model - A normalized frequency table over the byte alphabet.
Constants§
- ALPHABET
- Supported alphabet size (bytes).
- MAX_
SCALE_ BITS - MIN_
SCALE_ BITS - Minimum / maximum scale bits. Frequencies must fit in u16, so <= 15.
- MODEL_
VERSION_ 1 - Legacy model wire version (dense-only,
[1][scale_bits][count=256][u16 x 256]). - MODEL_
VERSION_ 2 - Compact model wire version (sparse/dense form selection).