1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

vulkan_encode_h265: fix rate control VBV values

The values written were placeholder values.
This commit is contained in:
Lynne 2024-09-27 09:52:14 +02:00
parent 934be0ff50
commit 81c6e6c9ee
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464

View File

@ -124,12 +124,12 @@ static int init_pic_rc(AVCodecContext *avctx, FFHWBaseEncodePicture *pic,
.consecutiveBFrameCount = FFMAX(ctx->base.b_per_p - 1, 0),
.subLayerCount = 0,
};
rc_info->pNext = &hp->vkrc_info;
rc_info->virtualBufferSizeInMs = 1000;
rc_info->initialVirtualBufferSizeInMs = 500;
if (rc_info->rateControlMode > VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR) {
rc_info->virtualBufferSizeInMs = (enc->hrd_buffer_size * 1000LL) / avctx->bit_rate;
rc_info->initialVirtualBufferSizeInMs = (enc->initial_buffer_fullness * 1000LL) / avctx->bit_rate;
hp->vkrc_layer_info = (VkVideoEncodeH265RateControlLayerInfoKHR) {
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_KHR,