Skip to main content

H264SliceHeader

Struct H264SliceHeader 

Source
pub struct H264SliceHeader {
    pub first_mb_in_slice: u32,
    pub slice_type: H264SliceType,
    pub pic_parameter_set_id: u8,
    pub is_idr: bool,
    pub frame_num: u32,
    pub field_pic_flag: bool,
    pub bottom_field_flag: bool,
    pub colour_plane_id: Option<u8>,
    pub idr_pic_id: Option<u32>,
    pub pic_order_cnt_lsb: Option<u32>,
    pub delta_pic_order_cnt_bottom: Option<i32>,
    pub delta_pic_order_cnt: [Option<i32>; 2],
}
Expand description

Parsed H.264 slice header — just the fields the Vulkan Video decoder + our DPB manager need. See ITU-T H.264 §7.3.3. Full slice header has ref_pic_list_modification, weighted_prediction tables, dec_ref_pic_marking, etc., which we don’t consume (the driver re-derives them from the PPS + StdVideoDecodeH264PictureInfo flags).

Fields§

§first_mb_in_slice: u32§slice_type: H264SliceType§pic_parameter_set_id: u8§is_idr: bool

From the NAL header: nal_unit_type == 5 — set by the caller when it picks the NAL to parse. Affects whether idr_pic_id is carried.

§frame_num: u32§field_pic_flag: bool

True when the slice encodes a single field of an interlaced frame (spec: !frame_mbs_only_flag && field_pic_flag). False for progressive frames or MBAFF pairs.

§bottom_field_flag: bool§colour_plane_id: Option<u8>§idr_pic_id: Option<u32>

Set when is_idr; otherwise None.

§pic_order_cnt_lsb: Option<u32>

Set when SPS pic_order_cnt_type == 0.

§delta_pic_order_cnt_bottom: Option<i32>§delta_pic_order_cnt: [Option<i32>; 2]

Set when SPS pic_order_cnt_type == 1 and !delta_pic_order_always_zero_flag. [0] always present in that branch, [1] present only when the PPS carried bottom_field_pic_order_in_frame_present_flag and we’re in a frame (not field) slice.

Trait Implementations§

Source§

impl Clone for H264SliceHeader

Source§

fn clone(&self) -> H264SliceHeader

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for H264SliceHeader

Source§

impl Debug for H264SliceHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for H264SliceHeader

Source§

impl PartialEq for H264SliceHeader

Source§

fn eq(&self, other: &H264SliceHeader) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for H264SliceHeader

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more