Skip to main content

H264SpsInfo

Struct H264SpsInfo 

Source
pub struct H264SpsInfo {
Show 29 fields pub profile_idc: u8, pub constraint_set_flags: u8, pub level_idc: u8, pub chroma_format_idc: u8, pub separate_colour_plane_flag: bool, pub bit_depth_luma: u8, pub bit_depth_chroma: u8, pub frame_mbs_only: bool, pub width: Option<u32>, pub height: Option<u32>, pub log2_max_frame_num_minus4: Option<u8>, pub pic_order_cnt_type: Option<u8>, pub log2_max_pic_order_cnt_lsb_minus4: Option<u8>, pub delta_pic_order_always_zero_flag: Option<bool>, pub qpprime_y_zero_transform_bypass_flag: Option<bool>, pub seq_scaling_matrix_present_flag: Option<bool>, pub max_num_ref_frames: Option<u8>, pub gaps_in_frame_num_value_allowed_flag: Option<bool>, pub mb_adaptive_frame_field_flag: Option<bool>, pub direct_8x8_inference_flag: Option<bool>, pub frame_cropping_flag: Option<bool>, pub frame_crop_left_offset: Option<u32>, pub frame_crop_right_offset: Option<u32>, pub frame_crop_top_offset: Option<u32>, pub frame_crop_bottom_offset: Option<u32>, pub offset_for_non_ref_pic: Option<i32>, pub offset_for_top_to_bottom_field: Option<i32>, pub num_ref_frames_in_pic_order_cnt_cycle: Option<u8>, pub offset_for_ref_frame: Vec<i32>,
}
Expand description

Parsed H.264 SPS fields relevant to the pipeline.

Populated by parse_h264_sps which walks the SPS through the frame cropping offsets per ITU-T H.264 §7.3.2.1.1 and applies the display rectangle derivation of §7.4.2.1.1 + Table 6-1 (SubWidthC / SubHeightC) to produce the post-crop displayable width/height.

Width/height are Option<u32> because the full SPS walk can bail on a malformed scaling list or an exotic pic_order_cnt_type branch; profile_idc / chroma_format_idc are always populated on a successful Some(_) return since they live in the SPS prefix before any of the variable-length sections.

Fields§

§profile_idc: u8§constraint_set_flags: u8

Packed 8-bit constraint_set_flags (Ch) — constraint_set0..5_flag in the high 6 bits, 2 reserved_zero bits. Preserved verbatim for Std struct output.

§level_idc: u8§chroma_format_idc: u8§separate_colour_plane_flag: bool§bit_depth_luma: u8§bit_depth_chroma: u8§frame_mbs_only: bool§width: Option<u32>

Post-crop width in luma samples, or None if the parse stopped before reaching the cropping fields.

§height: Option<u32>§log2_max_frame_num_minus4: Option<u8>

log2_max_frame_num_minus4 — slice headers carry frame_num as u(log2_max_frame_num_minus4 + 4) bits. None if the dims parse bailed before reaching this field.

§pic_order_cnt_type: Option<u8>

0 / 1 / 2 per §7.4.2.1. Controls which POC fields the slice header carries.

§log2_max_pic_order_cnt_lsb_minus4: Option<u8>

Valid when pic_order_cnt_type == 0. Bit width of pic_order_cnt_lsb in the slice header: log2_max_pic_order_cnt_lsb_minus4 + 4.

§delta_pic_order_always_zero_flag: Option<bool>

Valid when pic_order_cnt_type == 1. Gates the slice header’s delta_pic_order_cnt[0..1] branch.

§qpprime_y_zero_transform_bypass_flag: Option<bool>§seq_scaling_matrix_present_flag: Option<bool>§max_num_ref_frames: Option<u8>§gaps_in_frame_num_value_allowed_flag: Option<bool>§mb_adaptive_frame_field_flag: Option<bool>

Only meaningful when !frame_mbs_only.

§direct_8x8_inference_flag: Option<bool>§frame_cropping_flag: Option<bool>§frame_crop_left_offset: Option<u32>§frame_crop_right_offset: Option<u32>§frame_crop_top_offset: Option<u32>§frame_crop_bottom_offset: Option<u32>§offset_for_non_ref_pic: Option<i32>

Valid when pic_order_cnt_type == 1.

§offset_for_top_to_bottom_field: Option<i32>§num_ref_frames_in_pic_order_cnt_cycle: Option<u8>§offset_for_ref_frame: Vec<i32>

Populated only when pic_order_cnt_type == 1. Length equals num_ref_frames_in_pic_order_cnt_cycle (0..=255). Spec allows up to 256 entries but no real-world stream exercises the full range.

Trait Implementations§

Source§

impl Clone for H264SpsInfo

Source§

fn clone(&self) -> H264SpsInfo

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 Debug for H264SpsInfo

Source§

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

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

impl Eq for H264SpsInfo

Source§

impl PartialEq for H264SpsInfo

Source§

fn eq(&self, other: &H264SpsInfo) -> 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 H264SpsInfo

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