pub struct NaluReader<T> {
    data: Cursor<T>,
    curr_byte: u32,
    num_remaining_bits_in_curr_byte: usize,
    prev_two_bytes: u32,
    num_epb: usize,
}
Expand description

A bit reader for h264 bitstreams. It properly handles emulation-prevention bytes and stop bits.

Fields

data: Cursor<T>

A reference into the next unread byte in the stream.

curr_byte: u32

Contents of the current byte. First unread bit starting at position 8 - num_remaining_bits_in_curr_bytes.

num_remaining_bits_in_curr_byte: usize

Number of bits remaining in curr_byte

prev_two_bytes: u32

Used in epb detection.

num_epb: usize

Number of epbs (i.e. 0x000003) we found.

Implementations

Read a single bit from the stream.

Read up to 31 bits from the stream.

Skip up to 31 bits from the stream.

Returns the amount of bits left in the stream

Returns the number of emulation-prevention bytes read so far.

Whether the stream still has RBSP data. Implements more_rbsp_data(). See the spec for more details.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.