Struct SpsRbsp

Source
pub struct SpsRbsp {
Show 33 fields pub sps_video_parameter_set_id: u8, pub sps_max_sub_layers_minus1: u8, pub sps_temporal_id_nesting_flag: bool, pub profile_tier_level: ProfileTierLevel, pub sps_seq_parameter_set_id: u64, pub chroma_format_idc: u8, pub separate_colour_plane_flag: bool, pub pic_width_in_luma_samples: NonZero<u64>, pub pic_height_in_luma_samples: NonZero<u64>, pub conformance_window: ConformanceWindow, pub bit_depth_luma_minus8: u8, pub bit_depth_chroma_minus8: u8, pub log2_max_pic_order_cnt_lsb_minus4: u8, pub sub_layer_ordering_info: SubLayerOrderingInfo, pub log2_min_luma_coding_block_size_minus3: u64, pub log2_diff_max_min_luma_coding_block_size: u64, pub log2_min_luma_transform_block_size_minus2: u64, pub log2_diff_max_min_luma_transform_block_size: u64, pub max_transform_hierarchy_depth_inter: u64, pub max_transform_hierarchy_depth_intra: u64, pub scaling_list_data: Option<ScalingListData>, pub amp_enabled_flag: bool, pub sample_adaptive_offset_enabled_flag: bool, pub pcm: Option<Pcm>, pub short_term_ref_pic_sets: ShortTermRefPicSets, pub long_term_ref_pics: Option<LongTermRefPics>, pub sps_temporal_mvp_enabled_flag: bool, pub strong_intra_smoothing_enabled_flag: bool, pub vui_parameters: Option<VuiParameters>, pub range_extension: Option<SpsRangeExtension>, pub multilayer_extension: Option<SpsMultilayerExtension>, pub sps_3d_extension: Option<Sps3dExtension>, pub scc_extension: Option<SpsSccExtension>,
}
Expand description

Sequence parameter set RBSP.

For parsing SPS RBSPs that are part of NAL units, please use SpsNALUnit::parse.

seq_parameter_set_rbsp()

  • ISO/IEC 23008-2 - 7.3.2.2
  • ISO/IEC 23008-2 - 7.4.3.2

Fields§

§sps_video_parameter_set_id: u8

Specifies the value of the vps_video_parameter_set_id of the active VPS.

§sps_max_sub_layers_minus1: u8

This value plus 1 specifies the maximum number of temporal sub-layers that may be present in each CVS referring to the SPS.

The value is in range [0, 6]. The value must be less than or equal to vps_max_sub_layers_minus1.

§sps_temporal_id_nesting_flag: bool

Specifies whether inter prediction is additionally restricted for CVSs referring to the SPS.

When sps_max_sub_layers_minus1 == 0, this flag is true.

§profile_tier_level: ProfileTierLevel

The ProfileTierLevel structure contained in this SPS.

§sps_seq_parameter_set_id: u64

Provides an identifier for the SPS for reference by other syntax elements.

The value is in range [0, 15].

§chroma_format_idc: u8

Specifies the chroma sampling relative to the luma sampling as specified in ISO/IEC 23008-2 - 6.2.

The value is in range [0, 3].

§separate_colour_plane_flag: bool

Equal to true specifies that the three colour components of the 4:4:4 chroma format are coded separately.

Equal to false specifies that the colour components are not coded separately.

Defines ChromaArrayType.

§pic_width_in_luma_samples: NonZero<u64>

Specifies the width of each decoded picture in units of luma samples.

This value is never zero and an integer multiple of MinCbSizeY.

§pic_height_in_luma_samples: NonZero<u64>

Specifies the height of each decoded picture in units of luma samples.

This value is never zero and an integer multiple of MinCbSizeY.

§conformance_window: ConformanceWindow

conf_win_left_offset, conf_win_right_offset, conf_win_top_offset, and conf_win_bottom_offset.

See ConformanceWindow for details.

§bit_depth_luma_minus8: u8

Specifies the bit depth of the samples of the luma array BitDepth_Y and the value of the luma quantization parameter range offset QpBdOffset_Y.

The value is in range [0, 8].

§bit_depth_chroma_minus8: u8

specifies the bit depth of the samples of the chroma arrays BitDepth_C and the value of the chroma quantization parameter range offset QpBdOffset_C

The value is in range [0, 8].

§log2_max_pic_order_cnt_lsb_minus4: u8

Specifies the value of the variable MaxPicOrderCntLsb that is used in the decoding process for picture order count.

The value is in range [0, 12].

§sub_layer_ordering_info: SubLayerOrderingInfo

sps_max_dec_pic_buffering_minus1, sps_max_num_reorder_pics, and sps_max_latency_increase_plus1 for each sub-layer.

See SubLayerOrderingInfo for details.

§log2_min_luma_coding_block_size_minus3: u64

This value plus 3 defines the minimum luma coding block size.

Defines MinCbLog2SizeY.

§log2_diff_max_min_luma_coding_block_size: u64

Specifies the difference between the maximum and minimum luma coding block size.

§log2_min_luma_transform_block_size_minus2: u64

This value plus 2 specifies the minimum luma transform block size.

Defines MinTbLog2SizeY.

§log2_diff_max_min_luma_transform_block_size: u64

Specifies the difference between the maximum and minimum luma transform block size.

Defines MaxTbLog2SizeY.

§max_transform_hierarchy_depth_inter: u64

Specifies the maximum hierarchy depth for transform units of coding units coded in inter prediction mode.

This value is in range [0, CtbLog2SizeY - MinTbLog2SizeY].

§max_transform_hierarchy_depth_intra: u64

Specifies the maximum hierarchy depth for transform units of coding units coded in intra prediction mode.

This value is in range [0, CtbLog2SizeY - MinTbLog2SizeY].

§scaling_list_data: Option<ScalingListData>

The ScalingListData structure contained in this SPS, if present.

§amp_enabled_flag: bool

Equal to true specifies that asymmetric motion partitions, i.e. PartMode equal to PART_2NxnU, PART_2NxnD, PART_nLx2N, or PART_nRx2N, may be used in CTBs.

Equal to false specifies that asymmetric motion partitions cannot be used in CTBs.

§sample_adaptive_offset_enabled_flag: bool

Equal to true specifies that the sample adaptive offset process is applied to the reconstructed picture after the deblocking filter process.

Equal to false specifies that the sample adaptive offset process is not applied to the reconstructed picture after the deblocking filter process.

§pcm: Option<Pcm>

pcm_sample_bit_depth_luma_minus1, pcm_sample_bit_depth_chroma_minus1, log2_min_pcm_luma_coding_block_size_minus3, log2_diff_max_min_pcm_luma_coding_block_size and pcm_loop_filter_disabled_flag, if pcm_enabled_flag is true.

See Pcm for details.

§short_term_ref_pic_sets: ShortTermRefPicSets

The ShortTermRefPicSets structure contained in this SPS.

§long_term_ref_pics: Option<LongTermRefPics>

lt_ref_pic_poc_lsb_sps[i] and used_by_curr_pic_lt_sps_flag[i], if long_term_ref_pics_present_flag is true.

See LongTermRefPics for details.

§sps_temporal_mvp_enabled_flag: bool

Equal to true specifies that slice_temporal_mvp_enabled_flag is present in the slice headers of non-IDR pictures in the CVS.

Equal to false specifies that slice_temporal_mvp_enabled_flag is not present in slice headers and that temporal motion vector predictors are not used in the CVS.

§strong_intra_smoothing_enabled_flag: bool

Equal to true specifies that bi-linear interpolation is conditionally used in the intra prediction filtering process in the CVS as specified in ISO/IEC 23008-2 - 8.4.4.2.3.

Equal to false specifies that the bi-linear interpolation is not used in the CVS.

§vui_parameters: Option<VuiParameters>

The VuiParameters structure contained in this SPS, if present.

§range_extension: Option<SpsRangeExtension>

The SpsRangeExtension structure contained in this SPS, if present.

§multilayer_extension: Option<SpsMultilayerExtension>

The SpsMultilayerExtension structure contained in this SPS, if present.

§sps_3d_extension: Option<Sps3dExtension>

The Sps3dExtension structure contained in this SPS, if present.

§scc_extension: Option<SpsSccExtension>

The SpsSccExtension structure contained in this SPS, if present.

Implementations§

Source§

impl SpsRbsp

Source

pub fn parse(reader: impl Read, nuh_layer_id: u8) -> Result<Self>

Parses an SPS RBSP from the given reader.

Uses [EmulationPreventionIo] to handle emulation prevention bytes.

Returns an SpsRbsp struct.

Source

pub fn cropped_width(&self) -> u64

The croppedWidth as a u64.

This is computed from other fields, and doesn’t directly appear in the bitstream.

croppedWidth = pic_width_in_luma_samples - SubWidthC * (conf_win_right_offset + conf_win_left_offset) (D-28)

ISO/IEC 23008-2 - D.3.29

Source

pub fn cropped_height(&self) -> u64

The croppedHeight as a u64.

This is computed from other fields, and doesn’t directly appear in the bitstream.

croppedHeight = pic_height_in_luma_samples - SubHeightC * (conf_win_top_offset + conf_win_bottom_offset) (D-29)

ISO/IEC 23008-2 - D.3.29

Source

pub fn chroma_array_type(&self) -> u8

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn sub_width_c(&self) -> u8

ISO/IEC 23008-2 - Table 6-1

Source

pub fn sub_height_c(&self) -> u8

ISO/IEC 23008-2 - Table 6-1

Source

pub fn bit_depth_y(&self) -> u8

The bit depth of the samples of the luma array.

BitDepth_Y = 8 + bit_depth_luma_minus8 (7-4)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn qp_bd_offset_y(&self) -> u8

The luma quantization parameter range offset.

QpBdOffset_Y = 6 * bit_depth_luma_minus8 (7-5)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn bit_depth_c(&self) -> u8

The bit depth of the samples of the chroma arrays.

BitDepth_C = 8 + bit_depth_chroma_minus8 (7-6)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn qp_bd_offset_c(&self) -> u8

The chroma quantization parameter range offset.

QpBdOffset_C = 6 * bit_depth_chroma_minus8 (7-7)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn max_pic_order_cnt_lsb(&self) -> u32

Used in the decoding process for picture order count.

MaxPicOrderCntLsb = 2^(log2_max_pic_order_cnt_lsb_minus4 + 4) (7-8)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn min_cb_log2_size_y(&self) -> u64

MinCbLog2SizeY = log2_min_luma_coding_block_size_minus3 + 3 (7-10)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn ctb_log2_size_y(&self) -> u64

CtbLog2SizeY = MinCbLog2SizeY + log2_diff_max_min_luma_coding_block_size (7-11)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn min_cb_size_y(&self) -> u64

MinCbSizeY = 1 << MinCbLog2SizeY (7-12)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn ctb_size_y(&self) -> NonZero<u64>

CtbSizeY = 1 << CtbLog2SizeY (7-13)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn pic_width_in_min_cbs_y(&self) -> u64

PicWidthInMinCbsY = pic_width_in_luma_samples / MinCbSizeY (7-14)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn pic_width_in_ctbs_y(&self) -> u64

PicWidthInCtbsY = Ceil(pic_width_in_luma_samples ÷ CtbSizeY) (7-15)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn pic_height_in_min_cbs_y(&self) -> u64

PicHeightInMinCbsY = pic_height_in_luma_samples / MinCbSizeY (7-16)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn pic_height_in_ctbs_y(&self) -> u64

PicHeightInCtbsY = Ceil(pic_height_in_luma_samples ÷ CtbSizeY) (7-17)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn pic_size_in_min_cbs_y(&self) -> u64

PicSizeInMinCbsY = PicWidthInMinCbsY * PicHeightInMinCbsY (7-18)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn pic_size_in_ctbs_y(&self) -> u64

PicSizeInCtbsY = PicWidthInCtbsY * PicHeightInCtbsY (7-19)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn pic_size_in_samples_y(&self) -> u64

PicSizeInSamplesY = pic_width_in_luma_samples * pic_height_in_luma_samples (7-20)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn pic_width_in_samples_c(&self) -> u64

PicWidthInSamplesC = pic_width_in_luma_samples / SubWidthC (7-21)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn pic_height_in_samples_c(&self) -> u64

PicHeightInSamplesC = pic_height_in_luma_samples / SubHeightC (7-22)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn ctb_width_c(&self) -> u64

  • If chroma_format_idc is equal to 0 (monochrome) or separate_colour_plane_flag is equal to true, CtbWidthC is equal to 0.
  • Otherwise, CtbWidthC is derived as follows: CtbWidthC = CtbSizeY / SubWidthC (7-23)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn ctb_height_c(&self) -> u64

  • If chroma_format_idc is equal to 0 (monochrome) or separate_colour_plane_flag is equal to true, CtbHeightC is equal to 0.
  • Otherwise, CtbHeightC is derived as follows: CtbHeightC = CtbSizeY / SubHeightC (7-24)

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn min_tb_log2_size_y(&self) -> u64

MinTbLog2SizeY is set equal to log2_min_luma_transform_block_size_minus2 + 2.

The CVS shall not contain data that result in MinTbLog2SizeY greater than or equal to MinCbLog2SizeY.

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn max_tb_log2_size_y(&self) -> u64

MaxTbLog2SizeY = log2_min_luma_transform_block_size_minus2 + 2 + log2_diff_max_min_luma_transform_block_size

The CVS shall not contain data that result in MaxTbLog2SizeY greater than Min(CtbLog2SizeY, 5).

ISO/IEC 23008-2 - 7.4.3.2.1

Source

pub fn raw_ctu_bits(&self) -> u64

RawCtuBits = CtbSizeY * CtbSizeY * BitDepthY + 2 * (CtbWidthC * CtbHeightC) * BitDepthC (A-1)

ISO/IEC 23008-2 - A.3.1

Trait Implementations§

Source§

impl Clone for SpsRbsp

Source§

fn clone(&self) -> SpsRbsp

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SpsRbsp

Source§

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

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

impl PartialEq for SpsRbsp

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 SpsRbsp

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, 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.