pub struct SimpleRangeDecoder { /* private fields */ }Expand description
Range coder decoder for FFV1.
Reads entropy-coded binary decisions from a byte buffer using adaptive probability states.
Implementations§
Source§impl SimpleRangeDecoder
impl SimpleRangeDecoder
Sourcepub fn new(data: &[u8]) -> CodecResult<Self>
pub fn new(data: &[u8]) -> CodecResult<Self>
Create a new range decoder from the given data.
Sourcepub fn get_bit(&mut self, state: &mut u8) -> CodecResult<bool>
pub fn get_bit(&mut self, state: &mut u8) -> CodecResult<bool>
Decode a single binary decision using the given adaptive state.
Sourcepub fn get_symbol(&mut self, states: &mut [u8]) -> CodecResult<i32>
pub fn get_symbol(&mut self, states: &mut [u8]) -> CodecResult<i32>
Decode a signed symbol using the given context states.
Sourcepub fn bytes_consumed(&self) -> usize
pub fn bytes_consumed(&self) -> usize
Number of bytes consumed so far.
Auto Trait Implementations§
impl Freeze for SimpleRangeDecoder
impl RefUnwindSafe for SimpleRangeDecoder
impl Send for SimpleRangeDecoder
impl Sync for SimpleRangeDecoder
impl Unpin for SimpleRangeDecoder
impl UnsafeUnpin for SimpleRangeDecoder
impl UnwindSafe for SimpleRangeDecoder
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> 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