[FFmpeg-devel] [PATCH] Change libaom default to crf=28.
James Zern
jzern at google.com
Fri Aug 16 20:51:11 EEST 2019
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."
More information about the ffmpeg-devel
mailing list