Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: nowrep <code@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH] vulkan_encode_av1: Fix setting QP (PR #20174)
Date: Fri,  8 Aug 2025 14:28:12 +0300 (EEST)
Message-ID: <20250808112812.3BBFE68C4D1@ffbox0-bg.ffmpeg.org> (raw)

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".

                 reply	other threads:[~2025-08-08 11:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250808112812.3BBFE68C4D1@ffbox0-bg.ffmpeg.org \
    --to=code@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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