C Specification
To create a video session parameters object, call:
// Provided by VK_KHR_video_queue
VkResult vkCreateVideoSessionParametersKHR(
VkDevice device,
const VkVideoSessionParametersCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkVideoSessionParametersKHR* pVideoSessionParameters);
Parameters
-
deviceis the logical device that creates the video session parameters object. -
pCreateInfois a pointer to VkVideoSessionParametersCreateInfoKHR structure containing parameters to be used to create the video session parameters object. -
pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter. -
pVideoSessionParametersis a pointer to a VkVideoSessionParametersKHR handle in which the resulting video session parameters object is returned.
Description
The resulting video session parameters object is said to be created with the
video codec operation pCreateInfo->videoSession was created with.
Video session parameters objects created with an encode operation are always
created with respect to a video encode quality
level.
By default, the created video session parameters objects are created with
quality level zero, unless otherwise specified by including a
VkVideoEncodeQualityLevelInfoKHR structure in the
pCreateInfo->pNext chain, in which case the video session parameters
object is created with the quality level specified in
VkVideoEncodeQualityLevelInfoKHR::qualityLevel.
If pCreateInfo->videoSessionParametersTemplate is not
VK_NULL_HANDLE, then it will be used as a template for constructing
the new video session parameters object.
This happens by first adding any parameters according to the additional
creation parameters provided in the pCreateInfo->pNext chain, followed
by adding any parameters from the template object that have a key that does
not match the key of any of the already added parameters.
For video session parameters objects created with an encode operation, the
template object specified in
pCreateInfo->videoSessionParametersTemplate must have been created
with the same video encode quality level as the
newly created object.
|
Note
|
This means that codec-specific parameters stored in video session parameters objects can only be reused across different video encode quality levels by re-specifying them, as previously created video session parameters against other quality levels cannot be used as template because the original codec-specific parameters (before the implementation may have applied parameter overrides) may no longer be available in them for the purposes of constructing the derived object. |
Video session parameters objects are only compatible with
quantization maps if they are created with
pCreateInfo->flags including
VK_VIDEO_SESSION_PARAMETERS_CREATE_QUANTIZATION_MAP_COMPATIBLE_BIT_KHR.
Video session parameters objects created with
VK_VIDEO_SESSION_PARAMETERS_CREATE_QUANTIZATION_MAP_COMPATIBLE_BIT_KHR
against a video session object that was created with
VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR or
VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_EMPHASIS_MAP_BIT_KHR are created
with a specific compatible quantization
map texel size specified in the quantizationMapTexelSize member of
the VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR
structure included in the pNext chain of pCreateInfo.
|
Note
|
This means that the quantization map texel size that such a video session parameters object is compatible with is fixed for the lifetime of the object. Applications have to create separate video session parameters objects to use different quantization map texel sizes with a single video session object. This is necessary because the used quantization map texel size may affect the parameter overrides the implementation has to perform and thus the final values of the used codec-specific parameters. |
For video session parameters objects created with
VK_VIDEO_SESSION_PARAMETERS_CREATE_QUANTIZATION_MAP_COMPATIBLE_BIT_KHR,
the template object specified in
pCreateInfo->videoSessionParametersTemplate must also have been
created with
VK_VIDEO_SESSION_PARAMETERS_CREATE_QUANTIZATION_MAP_COMPATIBLE_BIT_KHR
and the same compatible quantization
map texel size specified in
VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR::quantizationMapTexelSize.
|
Note
|
This means that codec-specific parameters stored in video session parameters objects can only be reused with different quantization map texel sizes by re-specifying them, as previously created video session parameters against other quantization map texel sizes cannot be used as template because the original codec-specific parameters (before the implementation may have applied parameter overrides) may no longer be available in them for the purposes of constructing the derived object. |
For video session parameters objects created without
VK_VIDEO_SESSION_PARAMETERS_CREATE_QUANTIZATION_MAP_COMPATIBLE_BIT_KHR,
the template object specified in
pCreateInfo->videoSessionParametersTemplate must also have been
created without
VK_VIDEO_SESSION_PARAMETERS_CREATE_QUANTIZATION_MAP_COMPATIBLE_BIT_KHR.
If pCreateInfo->videoSession was created with the video codec
operation VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the
created video session parameters object will initially contain the following
sets of parameter entries:
-
StdVideoH264SequenceParameterSetstructures representing H.264 SPS entries, as follows:-
If the
pParametersAddInfomember of the VkVideoDecodeH264SessionParametersCreateInfoKHR structure provided in thepCreateInfo->pNextchain is notNULL, then the set ofStdVideoH264SequenceParameterSetentries specified inpParametersAddInfo->pStdSPSsare added first; -
If
pCreateInfo->videoSessionParametersTemplateis notVK_NULL_HANDLE, then eachStdVideoH264SequenceParameterSetentry stored in it is copied to the created video session parameters object if the created object does not already contain such an entry with the sameseq_parameter_set_id.
-
-
StdVideoH264PictureParameterSetstructures representing H.264 PPS entries, as follows:-
If the
pParametersAddInfomember of the VkVideoDecodeH264SessionParametersCreateInfoKHR structure provided in thepCreateInfo->pNextchain is notNULL, then the set ofStdVideoH264PictureParameterSetentries specified inpParametersAddInfo->pStdPPSsare added first; -
If
pCreateInfo->videoSessionParametersTemplateis notVK_NULL_HANDLE, then eachStdVideoH264PictureParameterSetentry stored in it is copied to the created video session parameters object if the created object does not already contain such an entry with the sameseq_parameter_set_idandpic_parameter_set_id.
-
If pCreateInfo->videoSession was created with the video codec
operation VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the
created video session parameters object will initially contain the following
sets of parameter entries:
-
StdVideoH265VideoParameterSetstructures representing H.265 VPS entries, as follows:-
If the
pParametersAddInfomember of the VkVideoDecodeH265SessionParametersCreateInfoKHR structure provided in thepCreateInfo->pNextchain is notNULL, then the set ofStdVideoH265VideoParameterSetentries specified inpParametersAddInfo->pStdVPSsare added first; -
If
pCreateInfo->videoSessionParametersTemplateis notVK_NULL_HANDLE, then eachStdVideoH265VideoParameterSetentry stored in it is copied to the created video session parameters object if the created object does not already contain such an entry with the samevps_video_parameter_set_id.
-
-
StdVideoH265SequenceParameterSetstructures representing H.265 SPS entries, as follows:-
If the
pParametersAddInfomember of the VkVideoDecodeH265SessionParametersCreateInfoKHR structure provided in thepCreateInfo->pNextchain is notNULL, then the set ofStdVideoH265SequenceParameterSetentries specified inpParametersAddInfo->pStdSPSsare added first; -
If
pCreateInfo->videoSessionParametersTemplateis notVK_NULL_HANDLE, then eachStdVideoH265SequenceParameterSetentry stored in it is copied to the created video session parameters object if the created object does not already contain such an entry with the samesps_video_parameter_set_idandsps_seq_parameter_set_id.
-
-
StdVideoH265PictureParameterSetstructures representing H.265 PPS entries, as follows:-
If the
pParametersAddInfomember of the VkVideoDecodeH265SessionParametersCreateInfoKHR structure provided in thepCreateInfo->pNextchain is notNULL, then the set ofStdVideoH265PictureParameterSetentries specified inpParametersAddInfo->pStdPPSsare added first; -
If
pCreateInfo->videoSessionParametersTemplateis notVK_NULL_HANDLE, then eachStdVideoH265PictureParameterSetentry stored in it is copied to the created video session parameters object if the created object does not already contain such an entry with the samesps_video_parameter_set_id,pps_seq_parameter_set_id, andpps_pic_parameter_set_id.
-
If pCreateInfo->videoSession was created with the video codec
operation VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR, then the
created video session parameters object will contain a single
AV1 sequence header represented by a
StdVideoAV1SequenceHeader structure specified through the
pStdSequenceHeader member of the
VkVideoDecodeAV1SessionParametersCreateInfoKHR structure provided in
the pCreateInfo->pNext chain.
As such video session parameters objects can only contain a single
AV1 sequence header, it is not possible to
use a previously created object as a template or subsequently update the
created video session parameters object.
If pCreateInfo->videoSession was created with the video codec
operation VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR, then the
created video session parameters object will initially contain the following
sets of parameter entries:
-
StdVideoH264SequenceParameterSetstructures representing H.264 SPS entries, as follows:-
If the
pParametersAddInfomember of the VkVideoEncodeH264SessionParametersCreateInfoKHR structure provided in thepCreateInfo->pNextchain is notNULL, then the set ofStdVideoH264SequenceParameterSetentries specified inpParametersAddInfo->pStdSPSsare added first; -
If
pCreateInfo->videoSessionParametersTemplateis notVK_NULL_HANDLE, then eachStdVideoH264SequenceParameterSetentry stored in it is copied to the created video session parameters object if the created object does not already contain such an entry with the sameseq_parameter_set_id.
-
-
StdVideoH264PictureParameterSetstructures representing H.264 PPS entries, as follows:-
If the
pParametersAddInfomember of the VkVideoEncodeH264SessionParametersCreateInfoKHR structure provided in thepCreateInfo->pNextchain is notNULL, then the set ofStdVideoH264PictureParameterSetentries specified inpParametersAddInfo->pStdPPSsare added first; -
If
pCreateInfo->videoSessionParametersTemplateis notVK_NULL_HANDLE, then eachStdVideoH264PictureParameterSetentry stored in it is copied to the created video session parameters object if the created object does not already contain such an entry with the sameseq_parameter_set_idandpic_parameter_set_id.
-
If pCreateInfo->videoSession was created with the video codec
operation VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR, then the
created video session parameters object will initially contain the following
sets of parameter entries:
-
StdVideoH265VideoParameterSetstructures representing H.265 VPS entries, as follows:-
If the
pParametersAddInfomember of the VkVideoEncodeH265SessionParametersCreateInfoKHR structure provided in thepCreateInfo->pNextchain is notNULL, then the set ofStdVideoH265VideoParameterSetentries specified inpParametersAddInfo->pStdVPSsare added first; -
If
pCreateInfo->videoSessionParametersTemplateis notVK_NULL_HANDLE, then eachStdVideoH265VideoParameterSetentry stored in it is copied to the created video session parameters object if the created object does not already contain such an entry with the samevps_video_parameter_set_id.
-
-
StdVideoH265SequenceParameterSetstructures representing H.265 SPS entries, as follows:-
If the
pParametersAddInfomember of the VkVideoEncodeH265SessionParametersCreateInfoKHR structure provided in thepCreateInfo->pNextchain is notNULL, then the set ofStdVideoH265SequenceParameterSetentries specified inpParametersAddInfo->pStdSPSsare added first; -
If
pCreateInfo->videoSessionParametersTemplateis notVK_NULL_HANDLE, then eachStdVideoH265SequenceParameterSetentry stored in it is copied to the created video session parameters object if the created object does not already contain such an entry with the samesps_video_parameter_set_idandsps_seq_parameter_set_id.
-
-
StdVideoH265PictureParameterSetstructures representing H.265 PPS entries, as follows:-
If the
pParametersAddInfomember of the VkVideoEncodeH265SessionParametersCreateInfoKHR structure provided in thepCreateInfo->pNextchain is notNULL, then the set ofStdVideoH265PictureParameterSetentries specified inpParametersAddInfo->pStdPPSsare added first; -
If
pCreateInfo->videoSessionParametersTemplateis notVK_NULL_HANDLE, then eachStdVideoH265PictureParameterSetentry stored in it is copied to the created video session parameters object if the created object does not already contain such an entry with the samesps_video_parameter_set_id,pps_seq_parameter_set_id, andpps_pic_parameter_set_id.
-
If pCreateInfo->videoSession was created with the video codec
operation VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR, then the
created video session parameters object will contain a single
AV1 sequence header specified through the
members of the VkVideoEncodeAV1SessionParametersCreateInfoKHR
structure provided in the pCreateInfo->pNext chain.
As such video session parameters objects can only contain a single
AV1 sequence header, it is not possible to
use a previously created object as a template or subsequently update the
created video session parameters object.
In case of video session parameters objects created with a video encode
operation, implementations may return the
VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR error if any of the
specified Video Std parameters do not adhere to the syntactic or semantic
requirements of the used video compression standard, or if values derived
from parameters according to the rules defined by the used video compression
standard do not adhere to the capabilities of the video compression standard
or the implementation.
|
Note
|
Applications should not rely on the
|
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.