Expand description
rANS (range Asymmetric Numeral System) coder with an optional multi-lane path.
The primary implementation is scalar and portable. On x86_64 builds, this module also exposes an 8-lane interleaved encoder/decoder API.
§Design
- Uses 8-way parallel rANS states for throughput
- 15-bit precision for probability quantization
- Interleaved bitstream for decoder efficiency
- Supports both streaming and batch modes
Structs§
- Blocked
Rans Decoder - Blocked rANS decoder for streaming large files.
- Blocked
Rans Encoder - Blocked rANS encoder for streaming large files.
- Cdf
- rANS CDF representation for a symbol.
- Rans
Decoder - Scalar rANS decoder.
- Rans
Encoder - Scalar rANS encoder.
- Simd
Rans Decoder - SIMD lane-parallel rANS types on x86_64. 8-way interleaved rANS decoder.
- Simd
Rans Encoder - SIMD lane-parallel rANS types on x86_64. 8-way interleaved rANS encoder.
Constants§
- ANS_
BITS - Number of bits for rANS probability precision
- ANS_
HIGH - Upper bound for rANS state (2^31)
- ANS_LOW
- Lower bound for rANS state (2^15)
- ANS_
TOTAL - Total probability range (2^15 = 32768)
- BLOCK_
SIZE - Block size for blocked rANS (128KB)
- RANS_
LANES - SIMD lane-parallel rANS types on x86_64. Number of parallel rANS streams
Functions§
- cdf_
for_ symbol - Get Cdf for a symbol from a CDF table.
- quantize_
pdf_ to_ rans_ cdf - Quantize PDF to rANS CDF table with guaranteed minimum frequencies.
- quantize_
pdf_ to_ rans_ cdf_ with_ buffer - Quantize PDF to rANS CDF using reusable scratch buffers.