Skip to main content

Module bit_reader

Module bit_reader 

Source
Expand description

Shared MSB-first bit reader with u(n) / ue(v) / se(v) primitives. These are the basic building blocks every codec module needs.

§Conventions

  • u(n) reads n bits (0 ≤ n ≤ 32), MSB first inside each byte.
  • ue(v) is the unsigned Exp-Golomb code from H.264 9.1 / H.265 9.2.
  • se(v) is the signed Exp-Golomb code from H.264 9.1.1 / H.265 9.2.2.
  • Past-the-end reads silently yield zero bits. Callers wanting strict EOF behaviour should compare BitReader::bit_pos against bytes.len() * 8 themselves.

Structs§

BitReader
MSB-first bit reader over a borrowed byte slice.