Skip to main content

RangeDecoder

Struct RangeDecoder 

Source
pub struct RangeDecoder<'a> { /* private fields */ }
Expand description

Range coder (arithmetic decoder) for entropy decoding.

Implementations§

Source§

impl<'a> RangeDecoder<'a>

Source

pub fn new(input: &'a [u8]) -> Self

Creates a new range decoder reading from the given byte slice.

Source

pub fn error(&self) -> bool

Whether an EOF error was encountered.

Source

pub fn bytes_read(&self) -> usize

Number of bytes read so far.

Source

pub fn init(&mut self)

Initializes the decoder by reading the first 4 bytes.

Source

pub fn decode_bit(&mut self) -> bool

Decodes a single bit.

Source

pub fn decode_with_model(&mut self, model: &mut RCQsModel) -> u32

Decodes a symbol using a probability model.

Source

pub fn decode_uint(&mut self, n: i32) -> u32

Decodes an n-bit unsigned integer (0 <= result < 2^n).

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.