pub struct GetBitContext<'a> { /* private fields */ }Implementations§
Source§impl<'a> GetBitContext<'a>
impl<'a> GetBitContext<'a>
pub fn new(buf: &'a [u8]) -> Self
pub fn new_bits(buf: &'a [u8], size_in_bits: usize) -> Result<Self>
pub fn new_window( buf: &'a [u8], bit_pos: usize, size_in_bits: usize, ) -> Result<Self>
pub fn bits_left(&self) -> isize
pub fn bits_read(&self) -> usize
pub fn align_to_byte(&mut self)
Sourcepub fn skip_bits(&mut self, n: usize) -> Result<()>
pub fn skip_bits(&mut self, n: usize) -> Result<()>
Advance the bit reader using FFmpeg’s checked GetBitContext semantics.
FFmpeg deliberately permits the read index to enter eight bits of zero padding past the logical end of the bitstream. A large amount of its VLC code relies on that look-ahead behavior at frame boundaries.
pub fn get_bits1(&mut self) -> Result<u32>
Sourcepub fn get_bits(&mut self, n: usize) -> Result<u32>
pub fn get_bits(&mut self, n: usize) -> Result<u32>
Read up to 32 bits.
This mirrors FFmpeg’s checked GetBitContext: reads use zero-filled
padding beyond size_in_bits, while the stored bit index is clamped to
size_in_bits + 8. It is intentionally not an EOF error by itself;
callers that require a hard boundary check use bits_left() exactly as
the upstream WMA decoders do.
pub fn show_bits(&self, n: usize) -> Result<u32>
pub fn get_bits_long(&mut self, n: usize) -> Result<u32>
pub fn get_sbits(&mut self, n: usize) -> Result<i32>
Trait Implementations§
Source§impl<'a> Clone for GetBitContext<'a>
impl<'a> Clone for GetBitContext<'a>
Source§fn clone(&self) -> GetBitContext<'a>
fn clone(&self) -> GetBitContext<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for GetBitContext<'a>
impl<'a> RefUnwindSafe for GetBitContext<'a>
impl<'a> Send for GetBitContext<'a>
impl<'a> Sync for GetBitContext<'a>
impl<'a> Unpin for GetBitContext<'a>
impl<'a> UnsafeUnpin for GetBitContext<'a>
impl<'a> UnwindSafe for GetBitContext<'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