pub struct Cabac<'a> { /* private fields */ }Expand description
The CABAC decoder: arithmetic engine reading MSB-first from the RBSP plus the 460 adaptive context models.
Implementations§
Source§impl<'a> Cabac<'a>
impl<'a> Cabac<'a>
Sourcepub fn new(
data: &'a [u8],
start_byte: usize,
qp: i32,
init_idc: u32,
is_i: bool,
) -> Self
pub fn new( data: &'a [u8], start_byte: usize, qp: i32, init_idc: u32, is_i: bool, ) -> Self
Initializes from the RBSP data at byte offset start_byte (the slice
data, byte-aligned past the header), the slice’s qp (clamped 0..51),
cabac_init_idc, and whether the slice is I/SI (spec §9.3.1).
Sourcepub fn dbg_state(&self) -> (u32, u32)
pub fn dbg_state(&self) -> (u32, u32)
Engine state (codIRange, codIOffset) — for bring-up verification against the
oracle’s symbol 0 (Brick 1.1). At slice start this is (510, first-9-bits).
Sourcepub fn decode_decision(&mut self, ctx_idx: usize) -> u32
pub fn decode_decision(&mut self, ctx_idx: usize) -> u32
Decodes a context-coded bin (spec §9.3.3.2.1), updating the context model.
Sourcepub fn decode_bypass(&mut self) -> u32
pub fn decode_bypass(&mut self) -> u32
Decodes a bypass (equiprobable) bin (spec §9.3.3.2.3).
Sourcepub fn decode_bypass_bits(&mut self, n: u32) -> u32
pub fn decode_bypass_bits(&mut self, n: u32) -> u32
Decodes n bypass bins as an unsigned value (MSB first).
Sourcepub fn decode_terminate(&mut self) -> bool
pub fn decode_terminate(&mut self) -> bool
Decodes the terminate bin (spec §9.3.3.2.4); true ends the slice (or
marks I_PCM). No renormalization on terminate.