Expand description
Reference arithmetic coder, big-endian bit streams, and frequency tables for tufazip.
Ported from arithmetic_coder.py (Project Nayuki) and make_freq_table in nn.py
with exact resumable checkpoint state snapshots.
Structs§
- Arithmetic
Decoder - Range arithmetic decoder reading big-endian bits from a
BitInputStream. - Arithmetic
Encoder - Range arithmetic encoder writing big-endian bits to a
BitOutputStream. - BitInput
State - Exact serializable state of a
BitInputStream. - BitInput
Stream - Big-endian bit reader backed by a byte stream.
- BitOutput
State - Exact serializable state of a
BitOutputStream. - BitOutput
Stream - Big-endian bit writer backed by a byte stream.
- Decoder
State - Exact serializable state of an
ArithmeticDecoder. - Encoder
State - Exact serializable state of an
ArithmeticEncoder.
Enums§
- Arith
Error - Errors returned by arithmetic coding and bit stream operations.
Constants§
- DEFAULT_
STATE_ BITS - Default state bit width used by
tufazip. - FREQ_
TOTAL - Frequency-table resolution used when quantizing softmax probabilities.
Functions§
- make_
freq_ table - Converts raw logits into a cumulative integer frequency table matching
nn.py. - make_
freq_ table_ into - Converts raw logits into a cumulative integer frequency table, reusing
out.