pub struct BitstreamReader<'a> { /* private fields */ }Expand description
Reads individual bits and Exp-Golomb coded integers from a byte slice.
Implementations§
Source§impl<'a> BitstreamReader<'a>
impl<'a> BitstreamReader<'a>
pub fn new(data: &'a [u8]) -> Self
Sourcepub fn bits_remaining(&self) -> usize
pub fn bits_remaining(&self) -> usize
Returns the number of bits remaining.
Sourcepub fn read_bit(&mut self) -> Result<u8, VideoError>
pub fn read_bit(&mut self) -> Result<u8, VideoError>
Reads a single bit (0 or 1).
Sourcepub fn read_bits(&mut self, n: u8) -> Result<u32, VideoError>
pub fn read_bits(&mut self, n: u8) -> Result<u32, VideoError>
Reads n bits as a u32 (MSB first), n <= 32.
Sourcepub fn read_ue(&mut self) -> Result<u32, VideoError>
pub fn read_ue(&mut self) -> Result<u32, VideoError>
Reads an unsigned Exp-Golomb coded integer (ue(v)).
Sourcepub fn read_se(&mut self) -> Result<i32, VideoError>
pub fn read_se(&mut self) -> Result<i32, VideoError>
Reads a signed Exp-Golomb coded integer (se(v)).
Auto Trait Implementations§
impl<'a> Freeze for BitstreamReader<'a>
impl<'a> RefUnwindSafe for BitstreamReader<'a>
impl<'a> Send for BitstreamReader<'a>
impl<'a> Sync for BitstreamReader<'a>
impl<'a> Unpin for BitstreamReader<'a>
impl<'a> UnsafeUnpin for BitstreamReader<'a>
impl<'a> UnwindSafe for BitstreamReader<'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
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