pub struct SymbolReader { /* private fields */ }Expand description
High-level symbol reader for CDF-based arithmetic coding.
Implementations§
Source§impl SymbolReader
impl SymbolReader
Sourcepub fn read_symbol(&mut self, cdf: &mut [u16]) -> usize
pub fn read_symbol(&mut self, cdf: &mut [u16]) -> usize
Read a symbol using a CDF.
Updates the CDF after reading.
Sourcepub fn read_symbol_no_update(&mut self, cdf: &[u16]) -> usize
pub fn read_symbol_no_update(&mut self, cdf: &[u16]) -> usize
Read a symbol without updating CDF.
Sourcepub fn read_bool_eq(&mut self) -> bool
pub fn read_bool_eq(&mut self) -> bool
Read a boolean with fixed probability (128/256).
Sourcepub fn read_literal(&mut self, n: u8) -> u32
pub fn read_literal(&mut self, n: u8) -> u32
Read a literal (fixed-length code) of n bits.
Sourcepub fn read_subexp(&mut self, k: u8, max_val: u32) -> u32
pub fn read_subexp(&mut self, k: u8, max_val: u32) -> u32
Read an unsigned value using subexp coding.
Sourcepub fn read_signed_subexp(&mut self, k: u8, max_val: u32) -> i32
pub fn read_signed_subexp(&mut self, k: u8, max_val: u32) -> i32
Read a signed value using subexp coding.
Sourcepub fn read_inv_recenter(&mut self, r: u32, max_val: u32) -> u32
pub fn read_inv_recenter(&mut self, r: u32, max_val: u32) -> u32
Read inverse recenter value.
Sourcepub fn has_more_data(&self) -> bool
pub fn has_more_data(&self) -> bool
Check if more data is available.
Trait Implementations§
Source§impl Clone for SymbolReader
impl Clone for SymbolReader
Source§fn clone(&self) -> SymbolReader
fn clone(&self) -> SymbolReader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SymbolReader
impl RefUnwindSafe for SymbolReader
impl Send for SymbolReader
impl Sync for SymbolReader
impl Unpin for SymbolReader
impl UnsafeUnpin for SymbolReader
impl UnwindSafe for SymbolReader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more