// Copyright 2018-2021 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

[[encode-h264]]
== Encode H.264

This extension adds H.264 codec specific structures/types needed to support
H.264 encoding.
Unless otherwise noted, all references to the H.264 specification are to the
2010 edition published by the ITU-T, dated March 2010.
This specification is available at http://www.itu.int/rec/T-REC-H.264.


=== H.264 encode profile

A H.264 encode profile is specified using slink:VkVideoEncodeH264ProfileEXT
chained to slink:VkVideoProfileKHR when the codec-operation in
slink:VkVideoProfileKHR is
ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT.

[open,refpage='VkVideoEncodeH264ProfileEXT',desc='Structure specifying H.264 encode profile',type='structs']
--
The slink:VkVideoEncodeH264ProfileEXT structure is defined as:

include::{generated}/api/structs/VkVideoEncodeH264ProfileEXT.txt[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:stdProfileIdc is a code:StdVideoH264ProfileIdc value specifying
    the H.264 codec profile IDC.

include::{generated}/validity/structs/VkVideoEncodeH264ProfileEXT.txt[]
--


=== Capabilities

[open,refpage='VkVideoEncodeH264CapabilitiesEXT',desc='Structure specifying H.264 encode capabilities',type='structs']
--
When flink:vkGetPhysicalDeviceVideoCapabilitiesKHR is called to query the
capabilities with parameter pname:videoCodecOperation specified as
ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT, an instance of
slink:VkVideoEncodeH264CapabilitiesEXT structure can: be chained to
slink:VkVideoCapabilitiesKHR to retrieve H.264 extension specific
capabilities.

The slink:VkVideoEncodeH264CapabilitiesEXT structure is defined as:

include::{generated}/api/structs/VkVideoEncodeH264CapabilitiesEXT.txt[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:flags is a bitmask of elink:VkVideoEncodeH264CapabilityFlagBitsEXT
    describing supported encoding tools.
  * pname:inputModeFlags is a bitmask of
    elink:VkVideoEncodeH264InputModeFlagBitsEXT describing supported command
    buffer input granularities/modes.
  * pname:outputModeFlags is a bitmask of
    elink:VkVideoEncodeH264OutputModeFlagBitsEXT describing supported output
    (bitstream size reporting) granularities/modes.
  * pname:maxPictureSizeInMbs reports the maximum encoded picture width and
    height in Macroblocks.
  * pname:minPictureSizeInMbs reports the minimum encoded picture width and
    height in Macroblocks.
  * pname:inputImageDataAlignment reports alignment of data that must: be
    filled in the input image horizontally and vertically in pixels.
    Max is 16: Data must: be filled up to Macroblock boundary (no
    extrapolation/filling is supported by implementation).
    Min is 1: The implementation will take care of all needed
    extrapolation/filling up to the next Macroblock boundary.
  * pname:maxNumL0ReferenceForP reports the maximum number of reference
    pictures the encoder supports as list0 references for P pictures.
  * pname:maxNumL0ReferenceForB reports the maximum number of reference
    pictures the encoder supports as list0 references for B pictures.
    Reports 0 if B pictures are not supported.
  * pname:maxNumL1Reference reports the maximum number of reference pictures
    the encoder supports as list1 references if B pictures are supported.
    Reports 0 if B pictures are not supported.
  * pname:qualityLevelCount is the number of discrete quality levels
    supported.
  * pname:stdExtensionVersion is the specific H.264 extension name and
    version supported by this implementation.

include::{generated}/validity/structs/VkVideoEncodeH264CapabilitiesEXT.txt[]
--

[open,refpage='VkVideoEncodeH264CapabilityFlagBitsEXT',desc='Video encode H.264 capability flags',type='enums']
--
The pname:flags field reports various encoding tools supported as defined
with the following bitfield:

include::{generated}/api/enums/VkVideoEncodeH264CapabilityFlagBitsEXT.txt[]

  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT reports if CABAC
    entropy coding is supported.
  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT reports if CAVLC
    entropy coding is supported.
    An implementation must: support at least one entropy coding mode.
  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BI_PRED_IMPLICIT_BIT_EXT
    reports if using weighted_bipred_idc_flag from StdVideoH264PpsFlags is
    supported.
  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT reports if
    enabling transform_8x8_mode_flag in StdVideoH264PpsFlags is supported.
  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT reports
    if setting chroma_qp_index_offset in StdVideoH264PictureParameterSet is
    supported.
  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT
    reports if setting second_chroma_qp_index_offset in
    StdVideoH264PictureParameterSet is supported.
  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT
    reports if using std_video_h264_disable_deblocking_filter_idc_disabled
    from StdVideoH264DisableDeblockingFilterIdc is supported.
  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT
    reports if using std_video_h264_disable_deblocking_filter_idc_enabled
    from StdVideoH264DisableDeblockingFilterIdc is supported.
  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT
    reports if using std_video_h264_disable_deblocking_filter_idc_partial
    from StdVideoH264DisableDeblockingFilterIdc is supported.
    An implementation must: support at least one deblocking filter mode.
  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT
  * ename:VK_VIDEO_ENCODE_H264_CAPABILITY_EVENLY_DISTRIBUTED_SLICE_SIZE_BIT_EXT
--

[open,refpage='VkVideoEncodeH264InputModeFlagBitsEXT',desc='Video encode H.264 input modes',type='enums']
--
The pname:inputModeFlags field reports the various commmand buffer input
granularities supported by the implementation as follows:

include::{generated}/api/enums/VkVideoEncodeH264InputModeFlagBitsEXT.txt[]

  * ename:VK_VIDEO_ENCODE_H264_INPUT_MODE_FRAME_BIT_EXT indicates a single
    command buffer must: at least encode an entire frame.
    Any non-VCL NALUs must: be encoded using the same command buffer as the
    frame if ename:VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT is not
    supported.
  * ename:VK_VIDEO_ENCODE_H264_INPUT_MODE_SLICE_BIT_EXT indicates a single
    command buffer must: at least encode a single slice.
    Any non-VCL NALUs must: be encoded using the same command buffer as the
    first slice of the frame if
    ename:VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT is not supported.
  * ename:VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT indicates a single
    command buffer may: encode a non-VCL NALU by itself.

An implementation must: support at least one of
ename:VK_VIDEO_ENCODE_H264_INPUT_MODE_FRAME_BIT_EXT or
ename:VK_VIDEO_ENCODE_H264_INPUT_MODE_SLICE_BIT_EXT.
--

[open,refpage='VkVideoEncodeH264OutputModeFlagBitsEXT',desc='Video encode H.264 output modes',type='enums']
--
The pname:outputModeFlags field reports the minimum bitstream generation
commands that must: be included between each flink:vkCmdBeginVideoCodingKHR
and flink:vkCmdEncodeVideoKHR pair (henceforth simply begin/end pair).
The various output modes are:

include::{generated}/api/enums/VkVideoEncodeH264OutputModeFlagBitsEXT.txt[]

  * ename:VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FRAME_BIT_EXT indicates calls to
    generate all NALUs of a frame must: be included within a single
    begin/end pair.
    Any non-VCL NALUs must: be encoded within the same begin/end pair if
    ename:VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT is not supported.
  * ename:VK_VIDEO_ENCODE_H264_OUTPUT_MODE_SLICE_BIT_EXT indicates each
    begin/end pair must: encode at least one slice.
    Any non-VCL NALUs must: be encoded within the same begin/end pair as the
    first slice of the frame if
    ename:VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT is not supported.
  * ename:VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT indicates each
    begin/end pair may: encode only a non-VCL NALU by itself.
    An implementation must: support at least one of
    ename:VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FRAME_BIT_EXT or
    ename:VK_VIDEO_ENCODE_H264_OUTPUT_MODE_SLICE_BIT_EXT.

A single begin/end pair must: not encode more than a single frame.

The bitstreams of NALUs generated within a single begin/end pair are written
continuously into the same bitstream buffer (any padding between the NALUs
must: be compliant to the H.264 standard).

The supported input modes must: be coarser or equal to the supported output
modes.
For example, it is illegal to report slice input is supported but only frame
output is supported.

An implementation must: report one of the following combinations of
input/output modes:
  ** Input: Frame, Output: Frame
  ** Input: Frame, Output: Frame and Non-VCL
  ** Input: Frame, Output: Slice
  ** Input: Frame, Output: Slice and Non-VCL
  ** Input: Slice, Output: Slice
  ** Input: Slice, Output: Slice and Non-VCL
  ** Input: Frame and Non-VCL, Output: Frame and Non-VCL
  ** Input: Frame and Non-VCL, Output: Slice and Non-VCL
  ** Input: Slice and Non-VCL, Output: Slice and Non-VCL
--


=== Create Information

[open,refpage='VkVideoEncodeH264SessionCreateInfoEXT', desc='Structure specifies H.264 encoder creation parameters', type='structs']
--
An instance of slink:VkVideoEncodeH264SessionCreateInfoEXT structure must:
be chained to slink:VkVideoSessionCreateInfoKHR when the function
flink:vkCreateVideoSessionKHR is called with pname:videoCodecOperation in
slink:VkVideoSessionCreateInfoKHR set to
ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT.

The slink:VkVideoEncodeH264SessionCreateInfoEXT structure is defined as:

include::{generated}/api/structs/VkVideoEncodeH264SessionCreateInfoEXT.txt[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:flags is a bitmask of tlink:VkVideoEncodeH264CreateFlagsEXT
    specifying H.264 encoder creation flags.
  * pname:maxPictureSizeInMbs specifies the syntax element
    pic_width_in_mbs_minus1 + 1 and the syntax element
    pic_height_in_map_units_minus1 + 1.
  * pname:pStdExtensionVersion is a pointer to a slink:VkExtensionProperties
    structure specifying H.264 codec extensions.

include::{generated}/validity/structs/VkVideoEncodeH264SessionCreateInfoEXT.txt[]
--

[open,refpage='VkVideoEncodeH264CreateFlagBitsEXT',desc='Video encode session creation flags',type='enums']
--
Flags which can: be set for a tlink:VkVideoEncodeH264CreateFlagsEXT value
are:

include::{generated}/api/enums/VkVideoEncodeH264CreateFlagBitsEXT.txt[]

  * ename:VK_VIDEO_ENCODE_H264_CREATE_DEFAULT_EXT is 0, and specifies no
    additional creation flags.
  * ename:VK_VIDEO_ENCODE_H264_CREATE_RESERVED_0_BIT_EXT The current version
    of the specification has reserved this value for future use.
--

[open,refpage='VkVideoEncodeH264CreateFlagsEXT',desc='Bitmask specifying the video encode session creation flags',type='flags']
--
include::{generated}/api/flags/VkVideoEncodeH264CreateFlagsEXT.txt[]

tlink:VkVideoEncodeH264CreateFlagsEXT is a bitmask type for setting a mask
of zero or more elink:VkVideoEncodeH264CreateFlagBitsEXT.
--



=== Encoder Parameter Sets

To reduce parameter traffic during encoding, the encoder parameter set
object supports storing H.264 SPS/PPS parameter sets that may: be later
referenced during encoding.

[open,refpage='VkVideoEncodeH264SessionParametersCreateInfoEXT',desc='Structure specifies H.264 encoder parameter set information',type='structs']
--
An instance of slink:VkVideoEncodeH264SessionParametersCreateInfoEXT holding
one H.264 SPS and at least one H.264 PPS paramater set must: be chained to
slink:VkVideoSessionParametersCreateInfoKHR when calling
flink:vkCreateVideoSessionParametersKHR to store these parameter set(s) with
the encoder parameter set object for later reference.
The provided H.264 SPS/PPS parameters must: be within the limits specified
during encoder creation for the encoder specified in
slink:VkVideoSessionParametersCreateInfoKHR.

The slink:VkVideoEncodeH264SessionParametersCreateInfoEXT structure is
defined as:

include::{generated}/api/structs/VkVideoEncodeH264SessionParametersCreateInfoEXT.txt[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:maxSpsStdCount is the maximum number of SPS parameters that the
    sname:VkVideoSessionParametersKHR can contain.
  * pname:maxPpsStdCount is the maximum number of PPS parameters that the
    sname:VkVideoSessionParametersKHR can contain.
  * pname:pParametersAddInfo is `NULL` or a pointer to a
    sname:VkVideoEncodeH264SessionParametersAddInfoEXT structure specifying
    H.264 parameters to add upon object creation.

include::{generated}/validity/structs/VkVideoEncodeH264SessionParametersCreateInfoEXT.txt[]
--

[open,refpage='VkVideoEncodeH264SessionParametersAddInfoEXT',desc='Structure specifies H.264 encoder parameter set information',type='structs']
--
include::{generated}/api/structs/VkVideoEncodeH264SessionParametersAddInfoEXT.txt[]
  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:spsStdCount is the number of SPS elements in the pname:pSpsStd.
    Its value must: be less than or equal to the value of
    pname:maxSpsStdCount.
  * pname:pSpsStd is a pointer to an array of
    code:StdVideoH264SequenceParameterSet structures representing H.264
    sequence parameter sets.
    Each element of the array must: have a unique H.264 SPS ID.
  * pname:ppsStdCount is the number of PPS provided in pname:pPpsStd.
    Its value must: be less than or equal to the value of
    pname:maxPpsStdCount.
  * pname:pPpsStd is a pointer to an array of
    code:StdVideoH264PictureParameterSet structures representing H.264
    picture parameter sets.
    Each element of the array must: have a unique H.264 SPS-PPS ID pair.

.Valid Usage
****
  * [[VUID-VkVideoEncodeH264SessionParametersAddInfoEXT-spsStdCount-04837]]
    The values of pname:spsStdCount and pname:ppsStdCount must: be less than
    or equal to the values of pname:maxSpsStdCount and pname:maxPpsStdCount,
    respectively.
  * [[VUID-VkVideoEncodeH264SessionParametersAddInfoEXT-maxSpsStdCount-04838]]
    When the pname:maxSpsStdCount number of parameters of type
    StdVideoH264SequenceParameterSet in the Video Session Parameters object
    is reached, no additional parameters of that type can be added to the
    object.
    ename:VK_ERROR_TOO_MANY_OBJECTS will be returned if an attempt is made
    to add additional data to this object at this point.
  * [[VUID-VkVideoEncodeH264SessionParametersAddInfoEXT-maxPpsStdCount-04839]]
    When the pname:maxPpsStdCount number of parameters of type
    StdVideoH264PictureParameterSet in the Video Session Parameters object
    is reached, no additional parameters of that type can be added to the
    object.
    ename:VK_ERROR_TOO_MANY_OBJECTS will be returned if an attempt is made
    to add additional data to this object at this point.
  * [[VUID-VkVideoEncodeH264SessionParametersAddInfoEXT-None-04840]]
    Each entry to be added must: have a unique, to the rest of the parameter
    array entries and the existing parameters in the Video Session
    Parameters Object that is being updated, SPS-PPS IDs.
  * [[VUID-VkVideoEncodeH264SessionParametersAddInfoEXT-None-04841]]
    Parameter entries that already exist in Video Session Parameters object
    with a particular SPS-PPS IDs cannot: be replaced nor updated.
  * [[VUID-VkVideoEncodeH264SessionParametersAddInfoEXT-None-04842]]
    When creating a new object using a Video Session Parameters as a
    template, the array's parameters with the same SPS-PPS IDs as the ones
    from the template take precedence.
  * [[VUID-VkVideoEncodeH264SessionParametersAddInfoEXT-None-04843]]
    SPS/PPS parameters must: comply with the limits specified in
    slink:VkVideoSessionCreateInfoKHR during Video Session creation.
****

include::{generated}/validity/structs/VkVideoEncodeH264SessionParametersAddInfoEXT.txt[]
--


=== Frame Encoding

To encode a frame the structure slink:VkVideoEncodeH264VclFrameInfoEXT may:
be chained to slink:VkVideoEncodeInfoKHR when calling
flink:vkCmdEncodeVideoKHR.

[open,refpage='VkVideoEncodeH264VclFrameInfoEXT',desc='Structure specifies H.264 encode frame parameters',type='structs']
--
The structure slink:VkVideoEncodeH264VclFrameInfoEXT representing a frame
encode operation is defined as:

include::{generated}/api/structs/VkVideoEncodeH264VclFrameInfoEXT.txt[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:refDefaultFinalList0EntryCount is the default number of reference
    List0 entries for all slices of this frame.
    Each slice may: override this by providing its own List0 entries.
  * pname:pRefDefaultFinalList0Entries is a pointer to an array of
    slink:VkVideoEncodeH264DpbSlotInfoEXT structures providing information
    for each reference List0 entry.
    The entries provided must: be ordered after all reference List0
    modification operations are applied (i.e. final list order).
    The entires provided must: not reflect decoded picture marking
    operations in this frame that are applicable to references; the impact
    of such operations must: be reflected in future frame encode cmds.
    The slot index in each entry must: match one of the slot indexes
    provided in pname:pReferenceSlots of the slink:VkVideoEncodeInfoKHR
    structure to which this structure is chained.
  * pname:refDefaultFinalList1EntryCount is the default number of reference
    List1 entries for all slices of this frame.
    Each slice may: override this by providing its own List1 entries.
  * pname:pRefDefaultFinalList1Entries is a pointer to an array of
    slink:VkVideoEncodeH264DpbSlotInfoEXT structures providing information
    related to each reference List1 entry.
    The entries provided must: be ordered after all reference List1
    modification operations are applied (i.e. final list order).
    The entires provided must: not reflect decoded picture marking
    operations in this frame that are applicable to references; the impact
    of such operations must: be reflected in future frame encode cmds.
    The slot index in each entry must: match one of the slot indexes
    provided in pname:pReferenceSlots of the slink:VkVideoEncodeInfoKHR
    structure to which this structure is chained.
  * pname:naluSliceEntryCount is the number of NALUs in this frame.
  * pname:pNaluSliceEntries is a pointer to an array of pname:naluCount
    slink:VkVideoEncodeH264NaluSliceEXT structures that make up the frame.
    This is an ordered sequence; the NALUs are generated consecutively in
    the bitstream buffer (provided in pname:bitstreamBuffer in
    slink:VkVideoBeginCodingInfoKHR) in the same order as in this array.
  * pname:pCurrentPictureInfo is a pointer to a
    slink:VkVideoEncodeH264DpbSlotInfoEXT structure specifying information
    for the reconstructed picture for this frame.
    Info provided must: reflect decoded picture marking operations in this
    frame that are applicable to this frame.
    The slot index in pCurrentPictureInfo must: match the slot index
    provided in pname:pSetupReferenceSlot of slink:VkVideoEncodeInfoKHR
    structure to which this structure is chained to.

include::{generated}/validity/structs/VkVideoEncodeH264VclFrameInfoEXT.txt[]
--

[open,refpage='VkVideoEncodeH264DpbSlotInfoEXT',desc='Structure specifies H.264 encode DPB picture information',type='structs']
--
The slink:VkVideoEncodeH264DpbSlotInfoEXT structure correlates a DPB Slot
index with codec-specific information and is defined as:

include::{generated}/api/structs/VkVideoEncodeH264DpbSlotInfoEXT.txt[]
  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:slotIndex is the slot index for this picture.
    pname:slotIndex must: match the pname:slotIndex in
    pname:pSetupReferenceSlot of slink:VkVideoEncodeInfoKHR in the command
    used to encode the corresponding picture.
  * pname:pStdPictureInfo is a pointer to a
    code:StdVideoEncodeH264PictureInfo structure specifying codec standard
    specific syntax/information associated with this picture from the H.264
    specification.

include::{generated}/validity/structs/VkVideoEncodeH264DpbSlotInfoEXT.txt[]
--

[open,refpage='VkVideoEncodeH264NaluSliceEXT',desc='Structure specifies H.264 encode slice NALU parameters',type='structs']
--
The structure slink:VkVideoEncodeH264NaluSliceEXT representing a slice is
defined as:

include::{generated}/api/structs/VkVideoEncodeH264NaluSliceEXT.txt[]
  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:pSliceHeaderStd is a pointer to a
    code:StdVideoEncodeH264SliceHeader specifying the standard slice header
    from the H.264 specification.
  * pname:mbCount is the number of macroblocks in this slice.
  * pname:refFinalList0EntryCount is the number of active references in
    List0.
    If zero, the default frame List0 provided in the enclosing
    slink:VkVideoEncodeH264VclFrameInfoEXT is used.
    If non-zero, it overrides the default frame List0 for this slice.
  * pname:pRefFinalList0Entries is a pointer to a
    slink:VkVideoEncodeH264DpbSlotInfoEXT specifying DPB information for the
    active List0 references.
    The same restrictions related to order of entries and decoded picture
    marking operations described for List0 in
    slink:VkVideoEncodeH264VclFrameInfoEXT apply here.
  * pname:refFinalList1EntryCount is the number of active references in
    List1.
    If zero, the default frame List1 provided in the enclosing
    slink:VkVideoEncodeH264VclFrameInfoEXT is used.
    If non-zero, it overrides the default frame List1 for this slice.
  * pname:pRefFinalList1Entries is a pointer to a
    slink:VkVideoEncodeH264DpbSlotInfoEXT structure specifying DPB
    information for the active List1 references.
    The same restrictions related to order of entries and decoded picture
    marking operations described for List1 in
    slink:VkVideoEncodeH264VclFrameInfoEXT apply here.
  * pname:precedingNaluBytes specifies the number of bytes consumed by
    non-VCL NALUs inserted before this slice (not through this API).
  * pname:minQp is the minimum quantization parameter when rate control is
    enabled.
  * pname:maxQp is the maximum quantization parameter when rate control is
    enabled.

ifdef::editing-notes[]
[NOTE]
.editing-note
====
TODO: move pname:precedingNaluBytes, pname:minQp, and pname:maxQP to the
Frame/SliceRC struct?
====
endif::editing-notes[]

When rate control is disabled, pname:minQp and pname:maxQp must: be set to
the same QP value.

include::{generated}/validity/structs/VkVideoEncodeH264NaluSliceEXT.txt[]
--

[open,refpage='VkVideoEncodeH264EmitPictureParametersEXT',desc='Structure specifies H.264 encode SPS NALU insertion parameters',type='structs']
--
The structure slink:VkVideoEncodeH264EmitPictureParametersEXT is defined as:

include::{generated}/api/structs/VkVideoEncodeH264EmitPictureParametersEXT.txt[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:spsId is the H.264 SPS ID for the H.264 SPS to insert in the
    bitstream.
    The SPS ID must: match the SPS provided in pname:spsStd of
    slink:VkVideoEncodeH264SessionParametersCreateInfoEXT.
    This is retrieved from the slink:VkVideoSessionParametersKHR object
    provided in slink:VkVideoBeginCodingInfoKHR.
  * pname:emitSpsEnable enables the emitting of the SPS structure with id of
    pname:spsId.
  * pname:ppsIdEntryCount is the number of entries in the
    pname:ppsIdEntries.
    If this parameter is "0" then no pps entries are going to be emitted in
    the bitstream.
  * pname:ppsIdEntries is a pointer to an array of H.264 PPS IDs for the
    H.264 PPS to insert in the bitstream.
    The PPS IDs must: match one of the IDs of the PPS(s) provided in
    pname:pPpsStd of slink:VkVideoEncodeH264SessionParametersCreateInfoEXT
    to identify the PPS parameter set to insert in the bitstream.
    This is retrieved from the slink:VkVideoSessionParametersKHR object
    provided in slink:VkVideoBeginCodingInfoKHR.

include::{generated}/validity/structs/VkVideoEncodeH264EmitPictureParametersEXT.txt[]
--
