Skip to main content

Module cm_model

Module cm_model 

Source
Expand description

ContextModel – flexible context model using ContextMap + StateMap.

Phase 4+: Three CM model variants, each now producing 3 predictions:

  1. StateMap prediction (p1): existing state->probability mapping
  2. Run-count prediction (p2): consecutive same-bit count in this context
  3. Byte-history prediction (p3): last byte seen in this context predicts current bit

The run-count uses the same bit-level hash as the StateMap. The byte-history uses a separate byte-level hash (independent of partial byte c0) so that the stored byte is accessible at any bpos within the same byte context.

Structs§

AssociativeContextModel
A context model using 2-way set-associative ContextMap. Best for order-5+ where collision rates are highest.
ChecksumContextModel
A context model using ChecksumContextMap for reduced collision damage.
ContextModel
A context model backed by a ContextMap (hash->state) + StateMap (state->prob). Now also produces run-count and byte-history predictions.

Type Aliases§

DualPrediction
Dual prediction from a context model. (state_p, run_p) – both 12-bit probabilities in [1, 4095].