Skip to main content

Module raw

Module raw 

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

Rans64DecSymbol
Prepared decoder symbol.
Rans64Decoder
Raw rANS decoder.
Rans64EncSymbol
Prepared encoder symbol.
Rans64Encoder
Raw rANS encoder.
RansByteDecSymbol
Prepared decoder symbol.
RansByteDecoder
Raw rANS decoder.
RansByteEncSymbol
Prepared encoder symbol.
RansByteEncoder
Raw rANS encoder.