Expand description
Forward, MSB-first bit reader with exp-Golomb decoders.
Used by every codec parser in this crate. Behavior:
- Bits are consumed MSB first within each byte.
read_bits(n)supports1 <= n <= 32. Larger widths are not meaningful for any codec field in scope.read_ue_v/read_se_vimplement H.264/H.265 unsigned and signed exp-Golomb coding. Codes wider than 32 bits returnCodecError::GolombOverflowrather than panicking.- End-of-stream always returns a structured
CodecError::EndOfStream; no panics on arbitrary input. This is the invariant the proptest harness relies on.
Emulation-prevention byte (0x03) removal lives on
rbsp_from_ebsp because it is codec-agnostic.
Structs§
Functions§
- rbsp_
from_ ebsp - Strip H.264/H.265 emulation-prevention bytes: whenever the encoder
emits
0x00 0x00 0x00or0x00 0x00 0x01or0x00 0x00 0x02or0x00 0x00 0x03in the NAL payload, it inserts a0x03byte after the two zeros to distinguish from a start code. Reverse that transformation so the decoder sees the raw RBSP.