Skip to main content

Crate gamut_bitstream

Crate gamut_bitstream 

Source
Expand description

Low-level bit writers and entropy coders shared by the gamut codecs.

The pieces here are the encoder-side mirror of the parsing processes defined in the AV1 Bitstream & Decoding Process Specification (references/av1/av1-spec.pdf):

  • BitWriter — most-significant-bit-first fixed-width fields (f(n)) and byte alignment, used by the AV1 uncompressed sequence/frame headers (AV1 §4, §8.1).
  • write_leb128 / leb128_len — unsigned LEB128 used for OBU sizes (AV1 §4.10.5, Annex B).
  • SymbolEncoder — the AV1 multi-symbol arithmetic (range) coder, derived by inverting the symbol decoder of AV1 §8.2. It is the entropy back-end for coded tile data.

The forward-looking ANS / Huffman coders named in the workspace plan (for AV2 / JPEG XL) are not implemented yet; they will join this crate behind their own modules.

Structs§

BitWriter
A most-significant-bit-first bit writer.
SymbolEncoder
Encoder for the AV1 symbol (range) coder.

Functions§

leb128_len
Returns the number of bytes the minimal unsigned LEB128 encoding of value occupies.
write_leb128
Appends the minimal unsigned LEB128 encoding of value to out.