VkVideoEncodeRateControlInfoKHR(3)

# VkVideoEncodeRateControlInfoKHR(3) Manual Page

## Name

VkVideoEncodeRateControlInfoKHR - Structure to set encode stream rate control parameters

Loading… please wait.

## 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;
        uint8_t                                        layerCount;
        const VkVideoEncodeRateControlLayerInfoKHR*    pLayerConfigs;
    } VkVideoEncodeRateControlInfoKHR;

## Members

- `sType` is the type of this structure.

- `pNext` is `NULL` or a pointer to a structure extending this structure.

- `flags` is a bitmask of VkVideoEncodeRateControlFlagBitsKHR specifying encode rate control flags.

- `rateControlMode` is a VkVideoEncodeRateControlModeFlagBitsKHR value specifying the encode stream rate control mode.

- `layerCount` specifies the number of rate control layers in the video encode stream.

- `pLayerConfigs` is a pointer to an array of VkVideoEncodeRateControlLayerInfoKHR structures specifying the rate control configurations of `layerCount` rate control layers.

## Description

In order to provide video encode stream rate control settings, add a `VkVideoEncodeRateControlInfoKHR` structure to the `pNext` chain of the VkVideoCodingControlInfoKHR structure passed to the vkCmdControlVideoCodingKHR command.

A codec-specific extension structure for further encode stream rate control parameter settings may be chained to VkVideoEncodeRateControlInfoKHR.

To ensure that the video session is properly initalized with stream-level rate control settings, the application must call vkCmdControlVideoCodingKHR with stream-level rate control settings at least once in execution order before the first vkCmdEncodeVideoKHR command that is executed after video session reset. If not provided, default implementation-specific stream rate control settings will be used.

Stream rate control settings can also be re-initialized during an active video encoding session. The re-initialization takes effect whenever the `VkVideoEncodeRateControlInfoKHR` structure is included in the `pNext` chain of the VkVideoCodingControlInfoKHR structure in the call to vkCmdControlVideoCodingKHR, and only impacts vkCmdEncodeVideoKHR operations that follow in execution order.

Valid Usage

- VUID-VkVideoEncodeH264RateControlInfoEXT-chainrequirement
  VkVideoEncodeH264RateControlInfoEXT must be included in the `pNext` chain of VkVideoEncodeRateControlInfoKHR if and only if VkVideoEncodeRateControlInfoKHR::`rateControlMode` is not `VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR` and the bound video session was created with VkVideoProfileKHR::`videoCodecOperation` set to `VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT`.

- VUID-VkVideoEncodeH264RateControlInfoEXT-temporalLayerCount
  If VkVideoEncodeRateControlInfoKHR::`layerCount` is greater than `1`, then VkVideoEncodeH264RateControlInfoEXT::`temporalLayerCount` must be equal to `layerCount`.

- VUID-VkVideoEncodeH265RateControlInfoEXT-chainrequirement
  VkVideoEncodeH265RateControlInfoEXT must be included in the `pNext` chain of VkVideoEncodeRateControlInfoKHR if and only if VkVideoEncodeRateControlInfoKHR::`rateControlMode` is not `VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR` and the bound video session was created with VkVideoProfileKHR::`videoCodecOperation` set to `VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT`.

- VUID-VkVideoEncodeH265RateControlInfoEXT-subLayerCount
  If VkVideoEncodeRateControlInfoKHR::`layerCount` is greater than `1`, then VkVideoEncodeH265RateControlInfoEXT::`subLayerCount` must be equal to `layerCount`.

Valid Usage (Implicit)

- VUID-VkVideoEncodeRateControlInfoKHR-sType-sType
  `sType` must be `VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR`

- VUID-VkVideoEncodeRateControlInfoKHR-rateControlMode-parameter
  `rateControlMode` must be a valid VkVideoEncodeRateControlModeFlagBitsKHR value

- VUID-VkVideoEncodeRateControlInfoKHR-pLayerConfigs-parameter
  `pLayerConfigs` must be a valid pointer to an array of `layerCount` valid VkVideoEncodeRateControlLayerInfoKHR structures

- VUID-VkVideoEncodeRateControlInfoKHR-layerCount-arraylength
  `layerCount` must be greater than `0`

## See Also

VK_KHR_video_encode_queue, VkStructureType, VkVideoEncodeRateControlFlagsKHR, VkVideoEncodeRateControlLayerInfoKHR, VkVideoEncodeRateControlModeFlagBitsKHR

## 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

Copyright 2014-2022 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0