rwkvzip/coders/
mod.rs

1//! Entropy coders for rwkvzip.
2//!
3//! This module provides both Arithmetic Coding (AC) and rANS coders.
4//!
5//! # Coder Selection
6//!
7//! - **Arithmetic Coding (AC)**: Optimal compression ratio, slightly slower.
8//!   Best for small files or maximum compression.
9//! - **rANS**: Near-optimal compression with better throughput, especially
10//!   with SIMD on x86_64. Best for larger files.
11
12pub mod ac;
13pub mod rans;
14
15// Re-export main types
16pub use ac::{
17    p_min, quantize_pdf_to_cdf, quantize_pdf_to_cdf_inplace, softmax_pdf, softmax_pdf_floor,
18    softmax_pdf_floor_inplace, softmax_pdf_inplace, ArithmeticDecoder, ArithmeticEncoder,
19    CDF_TOTAL,
20};
21
22pub use rans::{
23    cdf_for_symbol, quantize_pdf_to_rans_cdf, quantize_pdf_to_rans_cdf_with_buffer,
24    BlockedRansDecoder, BlockedRansEncoder, Cdf, RansDecoder, RansEncoder, ANS_BITS, ANS_HIGH,
25    ANS_LOW, ANS_TOTAL, BLOCK_SIZE,
26};
27
28// SIMD types (x86_64 AVX2-enabled by default for this build)
29pub use rans::{SimdRansDecoder, SimdRansEncoder, RANS_LANES};