Skip to main content

Module model

Module model 

Source
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§

EntropyModel
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).