Skip to main content

Crate tufazip_arith

Crate tufazip_arith 

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

ArithmeticDecoder
Range arithmetic decoder reading big-endian bits from a BitInputStream.
ArithmeticEncoder
Range arithmetic encoder writing big-endian bits to a BitOutputStream.
BitInputState
Exact serializable state of a BitInputStream.
BitInputStream
Big-endian bit reader backed by a byte stream.
BitOutputState
Exact serializable state of a BitOutputStream.
BitOutputStream
Big-endian bit writer backed by a byte stream.
DecoderState
Exact serializable state of an ArithmeticDecoder.
EncoderState
Exact serializable state of an ArithmeticEncoder.

Enums§

ArithError
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.