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