pub struct Sps {Show 20 fields
pub profile_idc: u8,
pub level_idc: u8,
pub seq_parameter_set_id: u32,
pub log2_max_frame_num: u32,
pub pic_order_cnt_type: u32,
pub log2_max_pic_order_cnt_lsb: u32,
pub delta_pic_order_always_zero: bool,
pub gaps_in_frame_num_allowed: bool,
pub direct_8x8_inference: bool,
pub max_num_ref_frames: u32,
pub pic_width_in_mbs: usize,
pub pic_height_in_mbs: usize,
pub frame_crop_left: u32,
pub frame_crop_right: u32,
pub frame_crop_top: u32,
pub frame_crop_bottom: u32,
pub chroma_format_idc: u32,
pub scaling_4x4: [[u8; 16]; 6],
pub scaling_8x8: [[u8; 64]; 2],
pub has_scaling: bool,
}Expand description
Parsed sequence parameter set fields the decoder needs.
Fields§
§profile_idc: u8§level_idc: u8§seq_parameter_set_id: u32§log2_max_frame_num: u32§pic_order_cnt_type: u32§log2_max_pic_order_cnt_lsb: u32§delta_pic_order_always_zero: booldelta_pic_order_always_zero_flag (only meaningful for POC type 1).
gaps_in_frame_num_allowed: boolgaps_in_frame_num_value_allowed_flag: when set, frame_num may skip
values and the decoder must synthesize placeholder reference frames.
direct_8x8_inference: booldirect_8x8_inference_flag: when set, B direct/skip derives one motion per
8×8 from the co-located corner 4×4 (vs per-4×4).
max_num_ref_frames: u32§pic_width_in_mbs: usize§pic_height_in_mbs: usize§frame_crop_left: u32§frame_crop_right: u32§frame_crop_top: u32§frame_crop_bottom: u32§chroma_format_idc: u32chroma_format_idc (1 = 4:2:0; the only value we decode).
scaling_4x4: [[u8; 16]; 6]Sequence scaling lists in zig-zag order (six 4×4, two 8×8); 16
everywhere = flat (no weighting). High-profile only.
scaling_8x8: [[u8; 64]; 2]§has_scaling: boolWhether custom scaling matrices are active (else flat dequant).
Implementations§
Source§impl Sps
impl Sps
Sourcepub fn coded_width(&self) -> usize
pub fn coded_width(&self) -> usize
Coded luma width/height in samples (MB grid * 16).
pub fn coded_height(&self) -> usize
Sourcepub fn display_width(&self) -> usize
pub fn display_width(&self) -> usize
Displayed luma width after cropping (CropUnitX = 2 for 4:2:0).
Sourcepub fn display_height(&self) -> usize
pub fn display_height(&self) -> usize
Displayed luma height after cropping (CropUnitY = 2 for 4:2:0, frame-only).
Sourcepub fn parse(rbsp: &[u8]) -> Result<Self, DecodeError>
pub fn parse(rbsp: &[u8]) -> Result<Self, DecodeError>
Parses an SPS RBSP (emulation bytes already removed). Rejects anything outside Constrained Baseline cleanly; never panics.