[FFmpeg-devel] [PATCH v2 4/6] avcodec/libsvtav1: Fix CQP mode doesn't work as expection

lance.lmwang at gmail.com lance.lmwang at gmail.com
Sat Sep 25 16:11:53 EEST 2021


On Sat, Sep 25, 2021 at 03:06:23PM +0300, Jan Ekström wrote:
> On Sat, Sep 18, 2021 at 4:27 AM <lance.lmwang at gmail.com> wrote:
> >
> > From: Limin Wang <lance.lmwang at gmail.com>
> >
> > Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> > ---
> 
> Commit message should probably be something along the lines of
> 
> """
> avcodec/libsvtav1: properly enforce CQP mode when set in wrapper
> 
> SVT-AV1 seems to have switched their default from CQP to CRF in February,
> so enforce the controlling option accordingly.
> """

Sure, I'll update it by your suggestion.

> 
> >  libavcodec/libsvtav1.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> > index 0dc25ca..b029e01 100644
> > --- a/libavcodec/libsvtav1.c
> > +++ b/libavcodec/libsvtav1.c
> > @@ -208,6 +208,8 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
> >      if (param->rate_control_mode) {
> >          param->max_qp_allowed       = avctx->qmax;
> >          param->min_qp_allowed       = avctx->qmin;
> > +    } else {
> > +        param->enable_tpl_la = 0; /* CQP need turn off enable_tp_la */
> 
> As the default changing in the underlying library has now shown us, I
> think (for now) it's better to move this next to
> param->rate_control_mode earlier in the function, and then do
> something like:
> 
> param->enable_tpl_la = !!param->rate_control_mode;

Yes, It's better idea. I'll update by your suggestion.

> 
> (I would have utilized param->enable_tpl_la = param->rate_control_mode
> == SVTAV1_RC_MODE_CQP;` but alas SVT-AV1 does not have such
> enums/defines that make such things more readable).
> 
> This way the parameter is set correctly no matter if the default is
> switched over at SVT-AV1. In the future the wrapper can be reworked so
> that by default SVT-AV1's own rate control defaults are utilized, and
> then if either bit rate or cqp or something like that is set, we can
> start enforcing that.
> 
> Jan
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

-- 
Thanks,
Limin Wang


More information about the ffmpeg-devel mailing list