pub struct SymbolDecoder<'a> { /* private fields */ }Expand description
A range decoder over an AV1 tile’s symbol data.
Implementations§
Source§impl<'a> SymbolDecoder<'a>
impl<'a> SymbolDecoder<'a>
Sourcepub fn new(data: &'a [u8], disable_cdf_update: bool) -> Result<Self>
pub fn new(data: &'a [u8], disable_cdf_update: bool) -> Result<Self>
Initialise the decoder over a tile’s sz-byte symbol partition
(init_symbol, §8.2.2). The position must be byte-aligned, which the
syntax guarantees at every call site.
Sourcepub fn read_symbol(&mut self, cdf: &mut [u16]) -> Result<usize>
pub fn read_symbol(&mut self, cdf: &mut [u16]) -> Result<usize>
Decode one symbol against cdf, adapting it unless updates are disabled
(read_symbol, §8.2.6). cdf has N + 1 entries: N cumulative
frequencies with cdf[N-1] == 1 << 15, then an adaptation counter.
Sourcepub fn read_bool(&mut self) -> Result<bool>
pub fn read_bool(&mut self) -> Result<bool>
Decode one equiprobable bit (read_bool, §8.2.3). The transient CDF’s
adaptation is never observed, so it is skipped.
Sourcepub fn read_literal(&mut self, n: u32) -> Result<u32>
pub fn read_literal(&mut self, n: u32) -> Result<u32>
Decode an n-bit literal, most-significant bit first (read_literal,
§8.2.5).
Auto Trait Implementations§
impl<'a> Freeze for SymbolDecoder<'a>
impl<'a> RefUnwindSafe for SymbolDecoder<'a>
impl<'a> Send for SymbolDecoder<'a>
impl<'a> Sync for SymbolDecoder<'a>
impl<'a> Unpin for SymbolDecoder<'a>
impl<'a> UnsafeUnpin for SymbolDecoder<'a>
impl<'a> UnwindSafe for SymbolDecoder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more