pub struct Rans64Decoder<Sr>{ /* private fields */ }Expand description
Re-export the core rANS primitives. Raw rANS decoder.
Implementations§
Source§impl<Sr> Rans64Decoder<Sr>
impl<Sr> Rans64Decoder<Sr>
pub fn new(source: Sr) -> Rans64Decoder<Sr>
pub fn source(&self) -> &Sr
pub fn source_mut(&mut self) -> &mut Sr
pub fn into_source(self) -> Sr
pub fn state(&self) -> u64
pub fn check_eof(&self) -> bool
Sourcepub fn init(&mut self) -> bool
pub fn init(&mut self) -> bool
Initialize the decoder by reading the initial state from the source.
Sourcepub fn get(&self, scale_bits: u32) -> u32
pub fn get(&self, scale_bits: u32) -> u32
Get the next symbol frequency (low scale_bits of state).
Sourcepub fn advance(&mut self, start: u32, freq: u32, scale_bits: u32) -> bool
pub fn advance(&mut self, start: u32, freq: u32, scale_bits: u32) -> bool
Advance the decoder past a symbol.
Uses transactional state: computes into a local variable and only
assigns to self.state after renormalization succeeds.
Equivalent to: RansDecoder::Advance(start, freq, scale_bits).
Sourcepub fn advance_symbol(
&mut self,
symbol: &Rans64DecSymbol,
scale_bits: u32,
) -> bool
pub fn advance_symbol( &mut self, symbol: &Rans64DecSymbol, scale_bits: u32, ) -> bool
Advance using a prepared decoder symbol.
Trait Implementations§
Auto Trait Implementations§
impl<Sr> Freeze for Rans64Decoder<Sr>where
Sr: Freeze,
impl<Sr> RefUnwindSafe for Rans64Decoder<Sr>where
Sr: RefUnwindSafe,
impl<Sr> Send for Rans64Decoder<Sr>where
Sr: Send,
impl<Sr> Sync for Rans64Decoder<Sr>where
Sr: Sync,
impl<Sr> Unpin for Rans64Decoder<Sr>where
Sr: Unpin,
impl<Sr> UnsafeUnpin for Rans64Decoder<Sr>where
Sr: UnsafeUnpin,
impl<Sr> UnwindSafe for Rans64Decoder<Sr>where
Sr: UnwindSafe,
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