From: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org> To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH v1] lavc/vaapi_encode_av1: Add qp option explicitly to set base q index Date: Tue, 28 Nov 2023 03:15:45 +0000 Message-ID: <ebb0f30fbb886cb50c37854e39502142dd7fe951.camel@intel.com> (raw) In-Reply-To: <a4ceb246-4e90-48e9-ab5a-129df69581a3@jkqxz.net> On Ma, 2023-11-27 at 13:36 +0000, Mark Thompson wrote: > On 27/11/2023 00:58, fei.w.wang-at-intel.com@ffmpeg.org wrote: > > From: Fei Wang <fei.w.wang@intel.com> > > > > Keep same way with librav1e/libsvtav1/qsv_av1.. to make it more > > acceptable instead of using global option "-global_quality". > > > > Fix #10615 > > > > Signed-off-by: Fei Wang <fei.w.wang@intel.com> > > --- > > doc/encoders.texi | 1 + > > libavcodec/vaapi_encode_av1.c | 6 ++++++ > > 2 files changed, 7 insertions(+) > > > > diff --git a/doc/encoders.texi b/doc/encoders.texi > > index 27a9acf076..2cffc32daf 100644 > > --- a/doc/encoders.texi > > +++ b/doc/encoders.texi > > @@ -4079,6 +4079,7 @@ Each encoder also has its own specific options: > > @table @option > > > > @item av1_vaapi > > +@option{qp} sets the value of @emph{base_q_index}. > > @option{profile} sets the value of @emph{seq_profile}. > > @option{tier} sets the value of @emph{seq_tier}. > > @option{level} sets the value of @emph{seq_level_idx}. > > diff --git a/libavcodec/vaapi_encode_av1.c b/libavcodec/vaapi_encode_av1.c > > index 5a9ff0f798..2e327fec5a 100644 > > --- a/libavcodec/vaapi_encode_av1.c > > +++ b/libavcodec/vaapi_encode_av1.c > > @@ -79,6 +79,7 @@ typedef struct VAAPIEncodeAV1Context { > > int cdef_param_size; > > > > /** user options */ > > + int qp; > > int profile; > > int level; > > int tier; > > @@ -786,6 +787,9 @@ static av_cold int vaapi_encode_av1_init(AVCodecContext > > *avctx) > > return AVERROR(EINVAL); > > } > > > > + if (priv->qp > 0) > > + ctx->explicit_qp = priv->qp; > > + > > ret = ff_vaapi_encode_init(avctx); > > if (ret < 0) > > return ret; > > @@ -864,6 +868,8 @@ static av_cold int vaapi_encode_av1_close(AVCodecContext > > *avctx) > > static const AVOption vaapi_encode_av1_options[] = { > > VAAPI_ENCODE_COMMON_OPTIONS, > > VAAPI_ENCODE_RC_OPTIONS, > > + { "qp", "Base q index (for P-frames; scaled by qfactor/qoffset for > > I/B)", > > + OFFSET(qp), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 255, FLAGS }, > > { "profile", "Set profile (seq_profile)", > > OFFSET(profile), AV_OPT_TYPE_INT, > > { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, > > "profile" }, > > Disagree; QP is not a concept in AV1. Yes, it not a concept in AV1. nvenc h264/hevc/av1 encoders provide the same qp option: libavcodec/nvenc_av1.c: { "qp", "Constant quantization parameter rate control method", libavcodec/nvenc_h264.c: { "qp", "Constant quantization parameter rate control method", libavcodec/nvenc_hevc.c: { "qp", "Constant quantization parameter rate control method", May we provide the same qp option for vaapi h264/hevc/av1 encoders too? User will be able to use same options when using these encoders. Thanks Haihao > Further, your examples from other encoders do not have a consistent view of > what it should mean. > > librav1e.c: > > { "qp", "use constant quantizer mode", OFFSET(quantizer), > AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE }, > > 0-255 is presumably the base_q_idx scale. > > libsvtav1.c: > > { "qp", "Initial Quantizer level value", OFFSET(qp), > AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 63, VE }, > > 0-63 is presumably the H.26x-qp-ish scale used by some VP9/AV1 encoders which > maps nonlinearly to the internal scale. > > qsv_av1 doesn't seem to have such an option. > > Thanks, > > - Mark > _______________________________________________ > 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".
next prev parent reply other threads:[~2023-11-28 3:16 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-11-27 0:58 fei.w.wang-at-intel.com 2023-11-27 13:36 ` Mark Thompson 2023-11-28 3:15 ` Xiang, Haihao [this message] 2023-12-19 6:18 ` Wang, Fei W
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=ebb0f30fbb886cb50c37854e39502142dd7fe951.camel@intel.com \ --to=haihao.xiang-at-intel.com@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