Expand description
Re-export the core rANS primitives. Raw rANS encoder/decoder implementations for both RansByte and Rans64 variants.
The code is generated via a macro to avoid duplication while matching the C++ template structure exactly.
§Scale-bits edge cases
When scale_bits == 32 (the maximum for Rans64), the expression 1u32 << scale_bits
overflows in Rust (and is undefined behavior in C++). The upstream C++ code also
enters indefinite shift territory here. This implementation defines the behavior
deterministically: scale_bits == 32 is rejected for the prepared-symbol path
where it would cause overflow, matching an intentional safety divergence.
See residual MSRTC.RAW.SCALE32.
Structs§
- Rans64
DecSymbol - Prepared decoder symbol.
- Rans64
Decoder - Raw rANS decoder.
- Rans64
EncSymbol - Prepared encoder symbol.
- Rans64
Encoder - Raw rANS encoder.
- Rans
Byte DecSymbol - Prepared decoder symbol.
- Rans
Byte Decoder - Raw rANS decoder.
- Rans
Byte EncSymbol - Prepared encoder symbol.
- Rans
Byte Encoder - Raw rANS encoder.