From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6273443892 for ; Sat, 2 Jul 2022 14:18:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9CB8068B877; Sat, 2 Jul 2022 17:18:31 +0300 (EEST) Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C1A4768B864 for ; Sat, 2 Jul 2022 17:18:25 +0300 (EEST) Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-31c1d580e4bso47425527b3.3 for ; Sat, 02 Jul 2022 07:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=kkF3p6fmOyL9htUYyKUV8E0buMb/DiFVfTkuiaVp3NE=; b=FeDdJjDQUC3pDOWyy/4R3IemjY1zMSaC4D2kOPrvbAwz/Sk3lt80ZNNf7k+588dOs5 uHaFFk2b3x8S9uBBjGH0vkAI+PCsWk0HfucEr/9aZD+mh7HEOMIL5GX86EfVd+rhWavf 323xlYsg/gEn46Al7ZD+lSn0OoLW8K4shixWbaD9CctBwgrWitppoC7erFbhfzleBPOQ vGcZTPQK6LJXPk2zc537MiDy3WBHQWncCHDbArDmEBzkCT4qcGfOe7Ut6BQ8tv61KR/9 8oqYfRlGazKHqvK+eQlfq1FL7jxjS46HQ8E94bPqscKXJ74Vz0JOsJczgdRzQJDKSMjr 7sAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=kkF3p6fmOyL9htUYyKUV8E0buMb/DiFVfTkuiaVp3NE=; b=z7J7k4HiuWnzCXCGbIBHkm9zPFDRTUAWqJSKrFENACFffv+O0f1FeQKl4pk/yiQJ/J zOroYWzDX81qFWnyUf8BDE2o1OoutvON02D5sh9v1+hbRiA99HFHvCdVXV+0yEhVfV5c rEqywYA8FhdVvqKPKtWtyDCZmyaKYktVfC/0fzmNb9G6qX5E3uMXEbs+PqIv+ii9sYfR WJvVwJo7KAx4Y74+CY3CkmuU/KG7fqb502r1zDALEASVz0ciTIq03R5tn07Snf5buVtc 2FpmW89q1fQukv6rW3/ijnFpnc1LfvwihplanBYZeLSXd1kJ6GQ8cAWrUyDJWvw7xS+I tb3w== X-Gm-Message-State: AJIora9SoTjAjnOWenOn2IguH6aPHr5n2mRJ9rIp9xwrI8EDjEg60YpT XZVtCQSWFttEWgFN+hPm5GiQfXWKScYJniPWjeLoEoNYtE4= X-Google-Smtp-Source: AGRyM1t78wKeIRuYqwZeIzQWXAlxN6hj2v6SU19H+BvBYpe+1UbaYiBBol0oCLwSkQ9b9qlI9VA0HyUUKb/riELJJXc= X-Received: by 2002:a81:750a:0:b0:317:da37:4f2d with SMTP id q10-20020a81750a000000b00317da374f2dmr22995065ywc.124.1656771504044; Sat, 02 Jul 2022 07:18:24 -0700 (PDT) MIME-Version: 1.0 References: <20220623053242.360909-1-wenbin.chen@intel.com> <165675474959.31466.10582792568629584963@lain.khirnov.net> In-Reply-To: <165675474959.31466.10582792568629584963@lain.khirnov.net> From: Paul B Mahol Date: Sat, 2 Jul 2022 16:21:08 +0200 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH v3] libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtime X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sat, Jul 2, 2022 at 11:39 AM Anton Khirnov wrote: > Quoting Wenbin Chen (2022-06-23 07:32:42) > > From: Yue Heng > > > > Enable dynamic QP configuration in runtime on qsv encoder. Through > > AVFrame->metadata, we can set key "qsv_config_qp" to change QP > > configuration when we encode video in CQP mode. > > > > Signed-off-by: Yue Heng > > Signed-off-by: Wenbin Chen > > --- > > doc/encoders.texi | 10 +++++ > > libavcodec/qsvenc.c | 89 +++++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 99 insertions(+) > > > > diff --git a/doc/encoders.texi b/doc/encoders.texi > > index 1850c99fe9..02a91ffe96 100644 > > --- a/doc/encoders.texi > > +++ b/doc/encoders.texi > > @@ -3333,6 +3333,16 @@ Forcing I frames as IDR frames. > > For encoders set this flag to ON to reduce power consumption and GPU > usage. > > @end table > > > > +@subsection Runtime Options > > +Following options can be used durning qsv encoding. > > + > > +@table @option > > +@item @var{qsv_config_qp} > > +Supported in h264_qsv and hevc_qsv. > > +This option can be set in per-frame metadata. QP parameter can be > dynamically > > +changed when encoding in CQP mode. > > +@end table > > + > > @subsection H264 options > > These options are used by h264_qsv > > > > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c > > index 902bada55b..2382c2f5f7 100644 > > --- a/libavcodec/qsvenc.c > > +++ b/libavcodec/qsvenc.c > > @@ -146,6 +146,14 @@ static const struct { > > { MFX_RATECONTROL_QVBR, "QVBR" }, > > }; > > > > +#define UPDATE_PARAM(a, b) \ > > +do { \ > > + if ((a) != (b)) { \ > > + a = b; \ > > + updated = 1; \ > > + } \ > > +} while (0) \ > > + > > static const char *print_ratecontrol(mfxU16 rc_mode) > > { > > int i; > > @@ -1613,6 +1621,83 @@ static int set_roi_encode_ctrl(AVCodecContext > *avctx, const AVFrame *frame, > > return 0; > > } > > > > +static int update_qp(AVCodecContext *avctx, QSVEncContext *q, > > + const AVFrame *frame) > > +{ > > + int updated = 0, qp = 0, new_qp; > > + char *tail; > > + AVDictionaryEntry *entry = NULL; > > + > > + if (avctx->codec_id != AV_CODEC_ID_H264 && avctx->codec_id != > AV_CODEC_ID_HEVC) > > + return 0; > > + > > + entry = av_dict_get(frame->metadata, "qsv_config_qp", NULL, 0); > > Why is this using frame metadata rather than the AVVideoEncParams side > data? > > Frame metadata should not be used in encoders at all. Longer term it > should not be used at all by anything. > Disagreed. Stop sharing your agenda. > > -- > Anton Khirnov > _______________________________________________ > 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". > _______________________________________________ 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".