[FFmpeg-devel] [PATCH v4 2/2] libavcodec/libaomenc.c: Support lossless encoding

James Zern jzern at google.com
Wed Apr 15 03:59:40 EEST 2020


On Tue, Apr 7, 2020 at 5:14 PM Ryo Hirafuji <ryo.hirafuji at gmail.com> wrote:
>
> From: Ryo Hirafuji <psi at 7io.org>
>
> AV1 support lossless encoding.
> In this patch, I added a command line flag to enable it.
>
> Fixes ticket #7600
> ---
>  libavcodec/libaomenc.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
>
> [...]
> @@ -574,7 +577,9 @@ static av_cold int aom_init(AVCodecContext *avctx,
>      if (avctx->rc_min_rate == avctx->rc_max_rate &&
>          avctx->rc_min_rate == avctx->bit_rate && avctx->bit_rate) {
>          enccfg.rc_end_usage = AOM_CBR;
> -    } else if (ctx->crf >= 0) {
> +    } else if (ctx->crf == 0) {
> +        enccfg.rc_end_usage = AOM_Q;

I saw the earlier comments around using crf=0 as the trigger for this.
libaom will behave differently with q vs cq mode. This also differs
from the -lossless in libvpxenc where this feature originated; mostly
we've been mapping options one to one with vpx/aomenc. Let me ask
around about the preference for lossless usage in libaom.


More information about the ffmpeg-devel mailing list