[FFmpeg-devel] [PATCH] Change libaom default to crf=28.

Elliott Karpilovsky elliottk at google.com
Wed Aug 21 03:31:30 EEST 2019


I believe the documentation is out of date. I added some debug
statements and verified that variable was being used to pull CRF
values when AOM_Q mode is set. I have
https://aomedia-review.googlesource.com/c/aom/+/94104 out to update
the documentation.


On Fri, Aug 16, 2019 at 10:59 AM James Zern
<jzern-at-google.com at ffmpeg.org> wrote:
>
> Hi,
>
> On Thu, Aug 15, 2019 at 1:22 PM elliottk
> <elliottk-at-google.com at ffmpeg.org> wrote:
> >
> > Current default is 256kbps, which produces inconsistent
> > results (too high for low-res, too low for hi-res).
> > Use CRF instead, which will adapt.
> > ---
> >  libavcodec/libaomenc.c | 9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
> > index 9b4fb3b4eb..621e897672 100644
> > --- a/libavcodec/libaomenc.c
> > +++ b/libavcodec/libaomenc.c
> > @@ -575,10 +575,11 @@ static av_cold int aom_init(AVCodecContext *avctx,
> >          if (enccfg.rc_end_usage == AOM_CQ) {
> >              enccfg.rc_target_bitrate = 1000000;
> >          } else {
> > -            avctx->bit_rate = enccfg.rc_target_bitrate * 1000;
> > +            enccfg.rc_end_usage = AOM_Q;
>
> Unless the docs are out of date this should be AOM_CQ level since crf
> is mapped to that control [1].
>
> > +            ctx->crf = 28;
> >              av_log(avctx, AV_LOG_WARNING,
> > -                   "Neither bitrate nor constrained quality specified, using default bitrate of %dkbit/sec\n",
> > -                   enccfg.rc_target_bitrate);
> > +                   "Neither bitrate nor constrained quality specified, using default CRF of %d\n",
> > +                   ctx->crf);
> >          }
> >      }
> >
>
> [1] https://aomedia.googlesource.com/aom/+/refs/heads/master/aom/aomcx.h#221
> "For this value to be used aom_codec_enc_cfg_t::rc_end_usage must be
> set to #AOM_CQ."
> _______________________________________________
> 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".


More information about the ffmpeg-devel mailing list