VkVideoEncodeH264PictureInfoKHR
The VkVideoEncodeH264PictureInfoKHR structure is defined as:
typedef struct VkVideoEncodeH264PictureInfoKHR {
VkStructureType sType;
const void* pNext;
uint32_t naluSliceEntryCount;
const VkVideoEncodeH264NaluSliceInfoKHR* pNaluSliceEntries;
const StdVideoEncodeH264PictureInfo* pStdPictureInfo;
VkBool32 generatePrefixNalu;
} VkVideoEncodeH264PictureInfoKHR;
sType
is a VkStructureType value identifying this structure.pNext
isNULL
or a pointer to a structure extending this structure.naluSliceEntryCount
is the number of elements inpNaluSliceEntries
.pNaluSliceEntries
is a pointer to an array ofnaluSliceEntryCount
VkVideoEncodeH264NaluSliceInfoKHR structures specifying the parameters of the individual H.264 slices to encode for the input picture.pStdPictureInfo
is a pointer to aStdVideoEncodeH264PictureInfo
structure specifying H.264 picture information.generatePrefixNalu
controls whether prefix NALUs are generated before slice NALUs into the target bitstream, as defined in sections 7.3.2.12 and 7.4.2.12 of the ITU-T H.264 Specification.
This structure is specified in the pNext
chain of the
VkVideoEncodeInfoKHR structure passed to vkCmdEncodeVideoKHR to
specify the codec-specific picture information for an H.264
encode operation.
Encode Input Picture Information
When this structure is specified in the pNext
chain of the
VkVideoEncodeInfoKHR structure passed to vkCmdEncodeVideoKHR,
the information related to the encode input
picture is defined as follows:
- The image subregion used is determined according to the H.264 Encode Picture Data Access section.
- The encode input picture is associated with the
H.264 picture information provided in
pStdPictureInfo
.
Std Picture Information
The members of the StdVideoEncodeH264PictureInfo
structure pointed to
by pStdPictureInfo
are interpreted as follows:
flags.reserved
andreserved1
are used only for padding purposes and are otherwise ignored;flags.IdrPicFlag
as defined in section 7.4.1 of the ITU-T H.264 Specification;flags.is_reference
as defined in section 3.136 of the ITU-T H.264 Specification;seq_parameter_set_id
andpic_parameter_set_id
are used to identify the active parameter sets, as described below;primary_pic_type
as defined in section 7.4.2 of the ITU-T H.264 Specification;PicOrderCnt
as defined in section 8.2 of the ITU-T H.264 Specification;temporal_id
as defined in section G.7.4.1.1 of the ITU-T H.264 Specification;- if
pRefLists
is notNULL
, then it is a pointer to aStdVideoEncodeH264ReferenceListsInfo
structure that is interpreted as follows:flags.reserved
is used only for padding purposes and is otherwise ignored;ref_pic_list_modification_flag_l0
andref_pic_list_modification_flag_l1
as defined in section 7.4.3.1 of the ITU-T H.264 Specification;num_ref_idx_l0_active_minus1
andnum_ref_idx_l1_active_minus1
as defined in section 7.4.3 of the ITU-T H.264 Specification;RefPicList0
andRefPicList1
as defined in section 8.2.4 of the ITU-T H.264 Specification where each element of these arrays either identifies an active reference picture using its DPB slot index or contains the valueSTD_VIDEO_H264_NO_REFERENCE_PICTURE
to indicateno reference picture
;- if
refList0ModOpCount
is not zero, thenpRefList0ModOperations
is a pointer to an array ofrefList0ModOpCount
number ofStdVideoEncodeH264RefListModEntry
structures specifying the modification parameters for the reference list L0 as defined in section 7.4.3.1 of the ITU-T H.264 Specification; - if
refList1ModOpCount
is not zero, thenpRefList1ModOperations
is a pointer to an array ofrefList1ModOpCount
number ofStdVideoEncodeH264RefListModEntry
structures specifying the modification parameters for the reference list L1 as defined in section 7.4.3.1 of the ITU-T H.264 Specification; - if
refPicMarkingOpCount
is not zero, thenrefPicMarkingOperations
is a pointer to an array ofrefPicMarkingOpCount
number ofStdVideoEncodeH264RefPicMarkingEntry
structures specifying the reference picture marking parameters as defined in section 7.4.3.3 of the ITU-T H.264 Specification;
- all other members are interpreted as defined in section 7.4.3 of the ITU-T H.264 Specification.
Reference picture setup is controlled by the value of
StdVideoEncodeH264PictureInfo
::flags.is_reference
.
If it is set and a reconstructed
picture is specified, then the latter is used as the target of picture
reconstruction to activate the DPB slot
specified in pEncodeInfo→pSetupReferenceSlot→slotIndex
.
If StdVideoEncodeH264PictureInfo
::flags.is_reference
is not set,
but a reconstructed picture is
specified, then the corresponding picture reference associated with the
DPB slot is invalidated, as described in the
DPB Slot States section.
Active Parameter Sets
The members of the StdVideoEncodeH264PictureInfo
structure pointed to
by pStdPictureInfo
are used to select the active parameter sets to use
from the bound video session parameters object, as follows:
- The active SPS is the
SPS identified by the key specified in
StdVideoEncodeH264PictureInfo
::seq_parameter_set_id
. - The active PPS is the
PPS identified by the key specified by the pair
constructed from
StdVideoEncodeH264PictureInfo
::seq_parameter_set_id
andStdVideoEncodeH264PictureInfo
::pic_parameter_set_id
.
H.264 encoding uses explicit weighted sample prediction for a slice, as
defined in section 8.4.2.3 of the ITU-T H.264 Specification,
if any of the following conditions are true for the active
PPS and the pStdSliceHeader
member of the
corresponding element of pNaluSliceEntries
:
pStdSliceHeader→slice_type
isSTD_VIDEO_H264_SLICE_TYPE_P
andweighted_pred_flag
is enabled in the active PPS.pStdSliceHeader→slice_type
isSTD_VIDEO_H264_SLICE_TYPE_B
andweighted_bipred_idc
in the active PPS equalsSTD_VIDEO_H264_WEIGHTED_BIPRED_IDC_EXPLICIT
.
Valid Usage
VUID-VkVideoEncodeH264PictureInfoKHR-naluSliceEntryCount-08301
naluSliceEntryCount
must be between 1
and
VkVideoEncodeH264CapabilitiesKHR::maxSliceCount
, inclusive,
as returned by vkGetPhysicalDeviceVideoCapabilitiesKHR for the
used video profile
VUID-VkVideoEncodeH264PictureInfoKHR-flags-08304
If VkVideoEncodeH264CapabilitiesKHR::flags
, as returned by
vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video
profile, does not include
VK_VIDEO_ENCODE_H264_CAPABILITY_GENERATE_PREFIX_NALU_BIT_KHR
, then
generatePrefixNalu
must be VK_FALSE
VUID-VkVideoEncodeH264PictureInfoKHR-flags-08314
If VkVideoEncodeH264CapabilitiesKHR::flags
, as returned by
vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video
profile, does not include
VK_VIDEO_ENCODE_H264_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR
and the slice corresponding to any element of pNaluSliceEntries
uses explicit weighted sample prediction,
then
VkVideoEncodeH264NaluSliceInfoKHR::pStdSliceHeader→pWeightTable
must not be NULL
for that element of pNaluSliceEntries
VUID-VkVideoEncodeH264PictureInfoKHR-flags-08315
If VkVideoEncodeH264CapabilitiesKHR::flags
, as returned by
vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video
profile, does not include
VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_KHR
, then
VkVideoEncodeH264NaluSliceInfoKHR::pStdSliceHeader→slice_type
must be identical for all elements of pNaluSliceEntries
Valid Usage (Implicit)
VUID-VkVideoEncodeH264PictureInfoKHR-sType-sType
sType
must be VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PICTURE_INFO_KHR
VUID-VkVideoEncodeH264PictureInfoKHR-pNaluSliceEntries-parameter
pNaluSliceEntries
must be a valid pointer to an array of naluSliceEntryCount
valid VkVideoEncodeH264NaluSliceInfoKHR structures
VUID-VkVideoEncodeH264PictureInfoKHR-pStdPictureInfo-parameter
pStdPictureInfo
must be a valid pointer to a valid StdVideoEncodeH264PictureInfo
value
VUID-VkVideoEncodeH264PictureInfoKHR-naluSliceEntryCount-arraylength
naluSliceEntryCount
must be greater than 0