gamut_bitstream/lib.rs
1//! Low-level bit writers and entropy coders shared by the gamut codecs.
2//!
3//! The pieces here are the encoder-side mirror of the parsing processes defined in the AV1
4//! Bitstream & Decoding Process Specification (`references/av1/av1-spec.pdf`):
5//!
6//! - [`BitWriter`] — most-significant-bit-first fixed-width fields (`f(n)`) and byte alignment,
7//! used by the AV1 uncompressed sequence/frame headers (AV1 §4, §8.1).
8//! - [`write_leb128`] / [`leb128_len`] — unsigned LEB128 used for OBU sizes (AV1 §4.10.5, Annex B).
9//! - [`SymbolEncoder`] — the AV1 multi-symbol arithmetic (range) coder, derived by inverting the
10//! symbol *decoder* of AV1 §8.2. It is the entropy back-end for coded tile data.
11//!
12//! The forward-looking ANS / Huffman coders named in the workspace plan (for AV2 / JPEG XL) are
13//! not implemented yet; they will join this crate behind their own modules.
14#![forbid(unsafe_code)]
15
16mod bitwriter;
17mod leb128;
18mod symbol;
19
20pub use bitwriter::BitWriter;
21pub use leb128::{leb128_len, write_leb128};
22pub use symbol::SymbolEncoder;