C Specification

The VkVideoEncodeRateControlLayerInfoKHR structure is defined as:

// Provided by VK_KHR_video_encode_queue
typedef struct VkVideoEncodeRateControlLayerInfoKHR {
    VkStructureType    sType;
    const void*        pNext;
    uint64_t           averageBitrate;
    uint64_t           maxBitrate;
    uint32_t           frameRateNumerator;
    uint32_t           frameRateDenominator;
} VkVideoEncodeRateControlLayerInfoKHR;

Members

  • sType is the type of this structure.

  • pNext is a pointer to a structure extending this structure.

  • averageBitrate is the average bitrate in bits/second. Valid when rate control mode is VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR or VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR.

  • maxBitrate is the peak bitrate in bits/second. Valid when rate control mode is VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR.

  • frameRateNumerator is the numerator of the frame rate. Valid when rate control mode is VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR or VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR.

  • frameRateDenominator is the denominator of the frame rate. Valid when rate control mode is VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR or VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR.

Description

A codec-specific structure specifying additional per-layer rate control settings must be chained to VkVideoEncodeRateControlLayerInfoKHR. If multiple rate control layers are enabled (VkVideoEncodeRateControlInfoKHR::layerCount is greater than 1), then the chained codec-specific extension structure also identifies the specific video coding layer its parent VkVideoEncodeRateControlLayerInfoKHR applies to. If multiple rate control layers are enabled, the number of rate control layers must match the number of video coding layers. The specification for an encode codec-specific extension would describe how multiple video coding layers are enabled for the corresponding codec.

Per-layer rate control settings for all enabled rate control layers must be initialized or re-initialized whenever stream rate control settings are provided via VkVideoEncodeRateControlInfoKHR. This is done by specifying settings for all enabled rate control layers in VkVideoEncodeRateControlInfoKHR::pLayers.

It is possible for an application to enable multiple video coding layers (via codec-specific extensions to encoding operations) while only enabling a single layer of rate control for the entire video stream. To achieve this, layerCount in VkVideoEncodeRateControlInfoKHR must be set to 1, and the single VkVideoEncodeRateControlLayerInfoKHR provided in pLayers would apply to all encoded segments of the video stream, regardless of which codec-defined video coding layer they belong to. In this case, the implementation decides bitrate distribution across video coding layers (if applicable to the specified stream rate control mode).

Valid Usage (Implicit)
  • VUID-VkVideoEncodeRateControlLayerInfoKHR-sType-sType
    sType must be VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR

  • VUID-VkVideoEncodeRateControlLayerInfoKHR-pNext-pNext
    Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkVideoEncodeH264RateControlLayerInfoEXT or VkVideoEncodeH265RateControlLayerInfoEXT

  • VUID-VkVideoEncodeRateControlLayerInfoKHR-sType-unique
    The sType value of each struct in the pNext chain must be unique

See Also

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.

Copyright 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0