Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] vulkan_encode_av1: Fix setting QP (PR #20174)
@ 2025-08-08 11:28 nowrep
  0 siblings, 0 replies; only message in thread
From: nowrep @ 2025-08-08 11:28 UTC (permalink / raw)
  To: ffmpeg-devel

PR #20174 opened by nowrep
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20174
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20174.patch

Use the "qp" param instead of "global_quality" to match H264/5.

Note: Currently all codecs use the min QP as default value when no `qp` param has been set. It should instead pick some sane value, and maybe also print warning as VAAPI does.


From eb826726b8b971573f805365b22487b35089f9a0 Mon Sep 17 00:00:00 2001
From: David Rosca <nowrep@gmail.com>
Date: Fri, 8 Aug 2025 13:19:29 +0200
Subject: [PATCH] vulkan_encode_av1: Fix setting QP

Use the "qp" param instead of "global_quality" to match H264/5.
---
 libavcodec/vulkan_encode_av1.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/vulkan_encode_av1.c b/libavcodec/vulkan_encode_av1.c
index 83a8734c93..db70b2dc29 100644
--- a/libavcodec/vulkan_encode_av1.c
+++ b/libavcodec/vulkan_encode_av1.c
@@ -675,9 +675,9 @@ static int init_enc_options(AVCodecContext *avctx)
         enc->initial_buffer_fullness = enc->hrd_buffer_size * 3 / 4;
     }
 
-    if (enc->common.opts.rc_mode == VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR &&
-        avctx->global_quality) {
-        enc->q_idx_p = av_clip_intp2(avctx->global_quality / FF_QP2LAMBDA, 8);
+    if (enc->common.opts.rc_mode == VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR) {
+        enc->q_idx_p = av_clip(enc->common.opts.qp,
+                               enc->caps.minQIndex, enc->caps.maxQIndex);
         if (fabs(avctx->i_quant_factor) > 0.0)
             enc->q_idx_idr =
                 av_clip((fabs(avctx->i_quant_factor) * enc->q_idx_p  +
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-08 11:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-08 11:28 [FFmpeg-devel] [PATCH] vulkan_encode_av1: Fix setting QP (PR #20174) nowrep

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git