pub fn quantize_pdf_to_rans_cdf(pdf: &[f64]) -> Vec<u32>Expand description
Quantize PDF to rANS CDF table with guaranteed minimum frequencies.
This implements a robust quantization algorithm that ensures:
- All symbols with p > 0 get freq >= 1
- The total equals ANS_TOTAL exactly
- Monotonicity is preserved (
cdf[i+1] >= cdf[i])
Uses error diffusion to distribute rounding errors across symbols.
§Arguments
pdf- Probability distribution (must sum to ~1.0)
§Returns
CDF table where cdf[i] = cumulative probability up to symbol i