pub struct RangeDecoder<'a> { /* private fields */ }Expand description
Range coder (arithmetic decoder) for entropy decoding.
Implementations§
Source§impl<'a> RangeDecoder<'a>
impl<'a> RangeDecoder<'a>
Sourcepub fn new(input: &'a [u8]) -> Self
pub fn new(input: &'a [u8]) -> Self
Creates a new range decoder reading from the given byte slice.
Sourcepub fn bytes_read(&self) -> usize
pub fn bytes_read(&self) -> usize
Number of bytes read so far.
Sourcepub fn decode_bit(&mut self) -> bool
pub fn decode_bit(&mut self) -> bool
Decodes a single bit.
Sourcepub fn decode_with_model(&mut self, model: &mut RCQsModel) -> u32
pub fn decode_with_model(&mut self, model: &mut RCQsModel) -> u32
Decodes a symbol using a probability model.
Sourcepub fn decode_uint(&mut self, n: i32) -> u32
pub fn decode_uint(&mut self, n: i32) -> u32
Decodes an n-bit unsigned integer (0 <= result < 2^n).
Sourcepub fn decode_ulong(&mut self, n: i32) -> u64
pub fn decode_ulong(&mut self, n: i32) -> u64
Decodes a 64-bit unsigned integer with n bits.
Auto Trait Implementations§
impl<'a> Freeze for RangeDecoder<'a>
impl<'a> RefUnwindSafe for RangeDecoder<'a>
impl<'a> Send for RangeDecoder<'a>
impl<'a> Sync for RangeDecoder<'a>
impl<'a> Unpin for RangeDecoder<'a>
impl<'a> UnsafeUnpin for RangeDecoder<'a>
impl<'a> UnwindSafe for RangeDecoder<'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