// Copyright 2020-2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0
// Common H.265 Parameter Set descriptions
// "operationType" attribute specifies whether this is included in the encode or decode section

[[{operationType}-h265-vps]]

H.265 Video Parameter Sets (VPS)::

Represented by code:StdVideoH265VideoParameterSet structures and interpreted
as follows:

  * code:reserved1, code:reserved2, and code:reserved3 are used only for
    padding purposes and are otherwise ignored;
  * code:vps_video_parameter_set_id is used as the key of the VPS entry;
  * the code:max_latency_increase_plus1, code:max_dec_pic_buffering_minus1,
    and code:max_num_reorder_pics members of the
    code:StdVideoH265DecPicBufMgr structure pointed to by code:pDecPicBufMgr
    correspond to `vps_max_latency_increase_plus1`,
    `vps_max_dec_pic_buffering_minus1`, and `vps_max_num_reorder_pics`,
    respectively, as defined in section 7.4.3.1 of the <<itu-t-h265,ITU-T
    H.265 Specification>>;
  * the code:StdVideoH265HrdParameters structure pointed to by
    code:pHrdParameters is interpreted as follows:
  ** code:reserved is used only for padding purposes and is otherwise
     ignored;
  ** code:flags.fixed_pic_rate_general_flag is a bitmask where bit index
     [eq]#i# corresponds to `fixed_pic_rate_general_flag[i]` as defined in
     section E.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  ** code:flags.fixed_pic_rate_within_cvs_flag is a bitmask where bit index
     [eq]#i# corresponds to `fixed_pic_rate_within_cvs_flag[i]` as defined
     in section E.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  ** code:flags.low_delay_hrd_flag is a bitmask where bit index [eq]#i#
     corresponds to `low_delay_hrd_flag[i]` as defined in section E.3.2 of
     the <<itu-t-h265,ITU-T H.265 Specification>>;
  ** if code:flags.nal_hrd_parameters_present_flag is set, then
     code:pSubLayerHrdParametersNal is a pointer to an array of
     [eq]#code:vps_max_sub_layers_minus1 + 1# number of
     code:StdVideoH265SubLayerHrdParameters structures where
     code:vps_max_sub_layers_minus1 is the corresponding member of the
     encompassing code:StdVideoH265VideoParameterSet structure and each
     element is interpreted as follows:
  *** code:cbr_flag is a bitmask where bit index [eq]#i# corresponds to
      `cbr_flag[i]` as defined in section E.3.3 of the <<itu-t-h265,ITU-T
      H.265 Specification>>;
  *** all other members of the code:StdVideoH265SubLayerHrdParameters
      structure are interpreted as defined in section E.3.3 of the
      <<itu-t-h265,ITU-T H.265 Specification>>;
  ** if code:flags.vcl_hrd_parameters_present_flag is set, then
     code:pSubLayerHrdParametersVcl is a pointer to an array of
     [eq]#code:vps_max_sub_layers_minus1 + 1# number of
     code:StdVideoH265SubLayerHrdParameters structures where
     code:vps_max_sub_layers_minus1 is the corresponding member of the
     encompassing code:StdVideoH265VideoParameterSet structure and each
     element is interpreted as follows:
  *** code:cbr_flag is a bitmask where bit index [eq]#i# corresponds to
      `cbr_flag[i]` as defined in section E.3.3 of the <<itu-t-h265,ITU-T
      H.265 Specification>>;
  *** all other members of the code:StdVideoH265SubLayerHrdParameters
      structure are interpreted as defined in section E.3.3 of the
      <<itu-t-h265,ITU-T H.265 Specification>>;
  ** all other members of code:StdVideoH265HrdParameters are interpreted as
     defined in section E.3.2 of the <<itu-t-h265,ITU-T H.265
     Specification>>;
  * the code:StdVideoH265ProfileTierLevel structure pointed to by
    code:pProfileTierLevel are interpreted as follows:
  ** code:general_level_idc is one of the enum constants
     `STD_VIDEO_H265_LEVEL_IDC_<major>_<minor>` identifying the H.265 level
     `<major>.<minor>` as defined in section A.4 of the <<itu-t-h265,ITU-T
     H.265 Specification>>;
  ** all other members of code:StdVideoH265ProfileTierLevel are interpreted
     as defined in section 7.4.4 of the <<itu-t-h265,ITU-T H.265
     Specification>>;
  * all other members of code:StdVideoH265VideoParameterSet are interpreted
    as defined in section 7.4.3.1 of the <<itu-t-h265,ITU-T H.265
    Specification>>.

[[{operationType}-h265-sps]]

H.265 Sequence Parameter Sets (SPS)::

Represented by code:StdVideoH265SequenceParameterSet structures and
interpreted as follows:

  * code:reserved1 and code:reserved2 are used only for padding purposes and
    are otherwise ignored;
  * the pair constructed from code:sps_video_parameter_set_id and
    code:sps_seq_parameter_set_id is used as the key of the SPS entry;
  * the code:StdVideoH265ProfileTierLevel structure pointed to by
    code:pProfileTierLevel are interpreted as follows:
  ** code:general_level_idc is one of the enum constants
     `STD_VIDEO_H265_LEVEL_IDC_<major>_<minor>` identifying the H.265 level
     `<major>.<minor>` as defined in section A.4 of the <<itu-t-h265,ITU-T
     H.265 Specification>>;
  ** all other members of code:StdVideoH265ProfileTierLevel are interpreted
     as defined in section 7.4.4 of the <<itu-t-h265,ITU-T H.265
     Specification>>;
  * the code:max_latency_increase_plus1, code:max_dec_pic_buffering_minus1,
    and code:max_num_reorder_pics members of the
    code:StdVideoH265DecPicBufMgr structure pointed to by code:pDecPicBufMgr
    correspond to `sps_max_latency_increase_plus1`,
    `sps_max_dec_pic_buffering_minus1`, and `sps_max_num_reorder_pics`,
    respectively, as defined in section 7.4.3.2 of the <<itu-t-h265,ITU-T
    H.265 Specification>>;
  * if code:flags.sps_scaling_list_data_present_flag is set, then the
    code:StdVideoH265ScalingLists structure pointed to by code:pScalingLists
    is interpreted as follows:
  ** code:ScalingList4x4, code:ScalingList8x8, code:ScalingList16x16, and
     code:ScalingList32x32 correspond to `ScalingList[0]`, `ScalingList[1]`,
     `ScalingList[2]`, and `ScalingList[3]`, respectively, as defined in
     section 7.3.4 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  ** code:ScalingListDCCoef16x16 and code:ScalingListDCCoef32x32 correspond
     to `scaling_list_dc_coef_minus8[0]` and
     `scaling_list_dc_coef_minus8[1]`, respectively, as defined in section
     7.3.4 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  * code:pShortTermRefPicSet is a pointer to an array of
    code:num_short_term_ref_pic_sets number of
    code:StdVideoH265ShortTermRefPicSet structures where each element is
    interpreted as follows:
  ** code:reserved1, code:reserved2, and code:reserved3 are used only for
     padding purposes and are otherwise ignored;
  ** code:used_by_curr_pic_flag is a bitmask where bit index [eq]#i#
     corresponds to `used_by_curr_pic_flag[i]` as defined in section 7.4.8
     of the <<itu-t-h265,ITU-T H.265 Specification>>;
  ** code:use_delta_flag is a bitmask where bit index [eq]#i# corresponds to
     `use_delta_flag[i]` as defined in section 7.4.8 of the <<itu-t-h265,
     ITU-T H.265 Specification>>;
  ** code:used_by_curr_pic_s0_flag is a bitmask where bit index [eq]#i#
     corresponds to `used_by_curr_pic_s0_flag[i]` as defined in section
     7.4.8 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  ** code:used_by_curr_pic_s1_flag is a bitmask where bit index [eq]#i#
     corresponds to `used_by_curr_pic_s1_flag[i]` as defined in section
     7.4.8 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  ** all other members of code:StdVideoH265ShortTermRefPicSet are
     interpreted as defined in section 7.4.8 of the <<itu-t-h265,ITU-T H.265
     Specification>>;
  * if code:flags.long_term_ref_pics_present_flag is set then the
    code:StdVideoH265LongTermRefPicsSps structure pointed to by
    code:pLongTermRefPicsSps is interpreted as follows:
  ** code:used_by_curr_pic_lt_sps_flag is a bitmask where bit index [eq]#i#
     corresponds to `used_by_curr_pic_lt_sps_flag[i]` as defined in section
     7.4.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  ** all other members of code:StdVideoH265LongTermRefPicsSps are
     interpreted as defined in section 7.4.3.2 of the <<itu-t-h265,ITU-T
     H.265 Specification>>;
  * if code:flags.vui_parameters_present_flag is set, then the
    code:StdVideoH265SequenceParameterSetVui structure pointed to by
    code:pSequenceParameterSetVui is interpreted as follows:
  ** code:reserved1, code:reserved2, and code:reserved3 are used only for
     padding purposes and are otherwise ignored;
  ** the code:StdVideoH265HrdParameters structure pointed to by
     code:pHrdParameters is interpreted as follows:
  *** code:flags.fixed_pic_rate_general_flag is a bitmask where bit index
      [eq]#i# corresponds to `fixed_pic_rate_general_flag[i]` as defined in
      section E.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  *** code:flags.fixed_pic_rate_within_cvs_flag is a bitmask where bit index
      [eq]#i# corresponds to `fixed_pic_rate_within_cvs_flag[i]` as defined
      in section E.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  *** code:flags.low_delay_hrd_flag is a bitmask where bit index [eq]#i#
      corresponds to `low_delay_hrd_flag[i]` as defined in section E.3.2 of
      the <<itu-t-h265,ITU-T H.265 Specification>>;
  *** if code:flags.nal_hrd_parameters_present_flag is set, then
      code:pSubLayerHrdParametersNal is a pointer to an array of
      [eq]#code:sps_max_sub_layers_minus1 + 1# number of
      code:StdVideoH265SubLayerHrdParameters structures where
      code:sps_max_sub_layers_minus1 is the corresponding member of the
      encompassing code:StdVideoH265SequenceParameterSet structure and each
      element is interpreted as follows:
  **** code:cbr_flag is a bitmask where bit index [eq]#i# corresponds to
       `cbr_flag[i]` as defined in section E.3.3 of the <<itu-t-h265,ITU-T
       H.265 Specification>>;
  **** all other members of the code:StdVideoH265SubLayerHrdParameters
       structure are interpreted as defined in section E.3.3 of the
       <<itu-t-h265,ITU-T H.265 Specification>>;
  *** if code:flags.vcl_hrd_parameters_present_flag is set, then
      code:pSubLayerHrdParametersVcl is a pointer to an array of
      [eq]#code:sps_max_sub_layers_minus1 + 1# number of
      code:StdVideoH265SubLayerHrdParameters structures where
      code:sps_max_sub_layers_minus1 is the corresponding member of the
      encompassing code:StdVideoH265SequenceParameterSet structure and each
      element is interpreted as follows:
  **** code:cbr_flag is a bitmask where bit index [eq]#i# corresponds to
       `cbr_flag[i]` as defined in section E.3.3 of the <<itu-t-h265,ITU-T
       H.265 Specification>>;
  **** all other members of the code:StdVideoH265SubLayerHrdParameters
       structure are interpreted as defined in section E.3.3 of the
       <<itu-t-h265,ITU-T H.265 Specification>>;
  *** all other members of code:StdVideoH265HrdParameters are interpreted as
      defined in section E.3.2 of the <<itu-t-h265,ITU-T H.265
      Specification>>;
  ** all other members of code:pSequenceParameterSetVui are interpreted as
     defined in section E.3.1 of the <<itu-t-h265,ITU-T H.265
     Specification>>;
  * if code:flags.sps_palette_predictor_initializer_present_flag is set,
    then the code:PredictorPaletteEntries member of the
    code:StdVideoH265PredictorPaletteEntries structure pointed to by
    code:pPredictorPaletteEntries is interpreted as defined in section
    7.4.9.13 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  * all other members of code:StdVideoH265SequenceParameterSet are
    interpreted as defined in section 7.4.3.1 of the <<itu-t-h265,ITU-T
    H.265 Specification>>.

[[{operationType}-h265-pps]]

H.265 Picture Parameter Sets (PPS)::

Represented by code:StdVideoH265PictureParameterSet structures and
interpreted as follows:

  * code:reserved1, code:reserved2, and code:reserved3 are used only for
    padding purposes and are otherwise ignored;
  * the triplet constructed from code:sps_video_parameter_set_id,
    code:pps_seq_parameter_set_id, and code:pps_pic_parameter_set_id is used
    as the key of the PPS entry;
  * if code:flags.pps_scaling_list_data_present_flag is set, then the
    code:StdVideoH265ScalingLists structure pointed to by code:pScalingLists
    is interpreted as follows:
  ** code:ScalingList4x4, code:ScalingList8x8, code:ScalingList16x16, and
     code:ScalingList32x32 correspond to `ScalingList[0]`, `ScalingList[1]`,
     `ScalingList[2]`, and `ScalingList[3]`, respectively, as defined in
     section 7.3.4 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  ** code:ScalingListDCCoef16x16 and code:ScalingListDCCoef32x32 correspond
     to `scaling_list_dc_coef_minus8[0]` and
     `scaling_list_dc_coef_minus8[1]`, respectively, as defined in section
     7.3.4 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  * if code:flags.pps_palette_predictor_initializer_present_flag is set,
    then the code:PredictorPaletteEntries member of the
    code:StdVideoH265PredictorPaletteEntries structure pointed to by
    code:pPredictorPaletteEntries is interpreted as defined in section
    7.4.9.13 of the <<itu-t-h265,ITU-T H.265 Specification>>;
  * all other members of code:StdVideoH265PictureParameterSet are
    interpreted as defined in section 7.4.3.3 of the <<itu-t-h265,ITU-T
    H.265 Specification>>.
