C Specification
The VkVideoEncodeRateControlInfoKHR
structure is defined as:
// Provided by VK_KHR_video_encode_queue
typedef struct VkVideoEncodeRateControlInfoKHR {
VkStructureType sType;
const void* pNext;
VkVideoEncodeRateControlFlagsKHR flags;
VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode;
uint32_t layerCount;
const VkVideoEncodeRateControlLayerInfoKHR* pLayers;
uint32_t virtualBufferSizeInMs;
uint32_t initialVirtualBufferSizeInMs;
} VkVideoEncodeRateControlInfoKHR;
Members
-
sType
is a VkStructureType value identifying this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
flags
is reserved for future use. -
rateControlMode
is a VkVideoEncodeRateControlModeFlagBitsKHR value specifying the rate control mode. -
layerCount
specifies the number of rate control layers to use. -
pLayers
is a pointer to an array oflayerCount
VkVideoEncodeRateControlLayerInfoKHR structures, each specifying the rate control configuration of the corresponding rate control layer. -
virtualBufferSizeInMs
is the size in milliseconds of the virtual buffer used by the implementation’s rate control algorithm for the leaky bucket model, with respect to the average bitrate of the stream calculated by summing the values of theaverageBitrate
members of the elements of thepLayers
array. -
initialVirtualBufferSizeInMs
is the initial occupancy in milliseconds of the virtual buffer used by the implementation’s rate control algorithm for the leaky bucket model.
Description
If layerCount
is zero then the values of virtualBufferSizeInMs
and initialVirtualBufferSizeInMs
are ignored.
This structure can be specified in the following places:
-
In the
pNext
chain of VkVideoBeginCodingInfoKHR to specify the current rate control state expected to be configured when beginning a video coding scope. -
In the
pNext
chain of VkVideoCodingControlInfoKHR to change the rate control configuration of the bound video session.
Including this structure in the pNext
chain of
VkVideoCodingControlInfoKHR and including
VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR
in
VkVideoCodingControlInfoKHR::flags
enables updating the rate
control configuration of the bound video session.
This replaces the entire rate control configuration of the bound video
session and may reset the state of all enabled rate control layers to an
initial state according to the codec-specific rate control semantics defined
in the corresponding sections listed below.
When layerCount
is greater than one, multiple
rate control layers are configured, and each
rate control layer is applied to the corresponding video coding layer
identified by the index of the corresponding element of pLayer
.
-
If the video session was created with the video codec operation
VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR
, then this index specifies the H.264 temporal layer ID of the video coding layer the rate control layer is applied to. -
If the video session was created with the video codec operation
VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR
, then this index specifies the H.265 temporal ID of the video coding layer the rate control layer is applied to.
Additional structures providing codec-specific rate control parameters can
be included in the pNext
chain of VkVideoCodingControlInfoKHR
depending on the video profile the bound video session
was created.
For further details see:
The new rate control configuration takes effect when the corresponding vkCmdControlVideoCodingKHR is executed on the device, and only impacts video encode operations that follow in execution order.
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.