Struct Reader

Source
pub struct Reader<'a>(/* private fields */);

Implementations§

Source§

impl<'a> Reader<'a>

Source

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

Source

pub fn read_bit(&mut self) -> Result<bool>

Read a single bit from the spec. Implements f(1) to return a bool for convenience.

Source

pub fn read_bits(&mut self, num_bits: u8) -> Result<u32>

Implements f(n): Unsigned n-bit number appearing directly in the bitstream. The bits are read from high to low order. See 4.10.2

Source

pub fn read_uvlc(&mut self) -> Result<u32>

Implements uvlc(): Variable length unsigned n-bit number appearing directly in the bitstream. See 4.10.3

Source

pub fn read_le(&mut self, num_bits: u8) -> Result<u32>

Implements le(n): Unsigned little-endian n-byte number appearing directly in the bitstream. See 4.10.4

Source

pub fn read_leb128(&mut self) -> Result<u32>

Implements leb128(): Unsigned integer represented by a variable number of little-endian bytes. See 4.10.5

Source

pub fn read_su(&mut self, num_bits: u8) -> Result<i32>

Implements su(n): Signed integer converted from an n bits unsigned integer in the bitstream. (The unsigned integer corresponds to the bottom n bits of the signed integer.). See 4.10.6

Source

pub fn read_ns(&mut self, num_bits: u8) -> Result<u32>

Implements ns(n): Unsigned encoded integer with maximum number of values n (i.e. output in range 0..n-1). See 4.10.7

Source

pub fn read_delta_q(&mut self) -> Result<i32>

Implements 5.9.13: Delta quantizer syntax.

Source

pub fn more_data_in_bitstream(&self) -> bool

Source

pub fn current_annexb_obu_length( &mut self, annexb_state: &mut AnnexBState, ) -> Result<Option<usize>>

Get the length of the current OBU in AnnexB format.

Source

pub fn skip(&mut self, num_bits: u64) -> Result<()>

Skips num_bits bits.

Source

pub fn position(&self) -> u64

Source

pub fn read_trailing_bits(&mut self, num_bits: u64) -> Result<()>

Implements 5.3.4.

Source

pub fn decode_unsigned_subexp_with_ref( &mut self, mx: i32, r: i32, ) -> Result<u32>

Implements 5.9.27.

Source

pub fn decode_signed_subexp_with_ref( &mut self, low: i32, high: i32, r: i32, ) -> Result<i32>

Implements 5.9.26.

Source

pub fn byte_alignment(&mut self) -> Result<()>

Implements 5.3.5 Byte alignment syntax

Source

pub fn remaining_bits(&self) -> u64

Trait Implementations§

Source§

impl<'a> Clone for Reader<'a>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Reader<'a>

§

impl<'a> RefUnwindSafe for Reader<'a>

§

impl<'a> Send for Reader<'a>

§

impl<'a> Sync for Reader<'a>

§

impl<'a> Unpin for Reader<'a>

§

impl<'a> UnwindSafe for Reader<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.