pub struct SliceHeaderReader {
pub log2_max_frame_num: u8,
}Expand description
Reads slice header fields from a raw byte buffer.
This is a simplified reader that expects the buffer to begin immediately after the NAL unit start code and header byte. Full Exp-Golomb parsing is approximated with a fixed layout suitable for testing.
Fields§
§log2_max_frame_num: u8Log2 of MaxFrameNum (from SPS); used to mask frame_num.
Implementations§
Source§impl SliceHeaderReader
impl SliceHeaderReader
Sourcepub fn new(log2_max_frame_num: u8) -> Self
pub fn new(log2_max_frame_num: u8) -> Self
Creates a new reader with the given log2_max_frame_num.
Sourcepub fn read_type(&self, data: &[u8]) -> Option<SliceType>
pub fn read_type(&self, data: &[u8]) -> Option<SliceType>
Reads the slice type from the first byte of data.
Returns None if data is empty or the value is out of range.
Trait Implementations§
Source§impl Debug for SliceHeaderReader
impl Debug for SliceHeaderReader
Source§impl Default for SliceHeaderReader
impl Default for SliceHeaderReader
Source§fn default() -> SliceHeaderReader
fn default() -> SliceHeaderReader
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SliceHeaderReader
impl RefUnwindSafe for SliceHeaderReader
impl Send for SliceHeaderReader
impl Sync for SliceHeaderReader
impl Unpin for SliceHeaderReader
impl UnsafeUnpin for SliceHeaderReader
impl UnwindSafe for SliceHeaderReader
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