1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Licensed under the MIT license.
// Author: Riaan de Beer - github.com/infinityabundance - rdebeer.infinityabundance@gmail.com
// Derived from Microsoft MLVC msrtc_rans (MIT)
// See NOTICE file for attribution.
//! # msrtc-rans-core
//!
//! Deterministic, no_std-capable rANS primitives for the msrtc_rans entropy coder.
//!
//! This crate implements the raw rANS encoding and decoding primitives used by
//! Microsoft MLVC's `msrtc_rans` package. The arithmetic (reciprocal preparation,
//! Mul64Hi, fast division) is structurally faithful to the C++ implementation.
//!
//! **Status:** The encoder and decoder equations, constants, and symbol preparation
//! are implemented and self-consistent. Byte-level parity against the pinned
//! Microsoft C++ oracle has not yet been established by differential court.
//! See the `msrtc-rans-court` crate for ongoing parity verification.
extern crate alloc;
/// Frequency type used throughout the rANS implementation - corresponds to `rans_freq_t` (uint32_t)
pub type Freq = u32;
pub use RawRansError;
/// Re-export key types for convenience.
pub use ;
pub use RansVariant;