[FFmpeg-devel] [PATCH 2/2] lavc/libaomenc: Support lossless encoding

Ryo Hirafuji ryo.hirafuji at link-u.co.jp
Sat Apr 4 19:46:26 EEST 2020


> In an ideal world, crf 0 would force all other settings for a lossless
encoding.

I forgot to say that if "-lossless 1" is set, "crf" will also be 0 (in
libaom, internally).

All those conditions will be forced (ot at least checked by libaom) if we
execute this line:

> codecctl_int(avctx, AV1E_SET_LOSSLESS, ctx->lossless);

So, how about executing this line if the "-crf 0" is set?
libaom changes so fast, so this might be a more robust way to ensure
lossless encoding, rather than setting those settings by hand.

If it's okay, I will make an additional patch.

2020年4月5日(日) 0:34 Carl Eugen Hoyos <ceffmpeg at gmail.com>:

> Am Sa., 4. Apr. 2020 um 13:17 Uhr schrieb Ryo Hirafuji
> <ryo.hirafuji at link-u.co.jp>:
> >
> > > So "crf 0" already has a meaning different from all other crf values?
> >
> > No. "crf 0" has the same meanings. It just makes the quality better than
> > "crf 1".
>
> That was my question, sorry for being unclear.
>
> > I read libaom again, and I apologize for my wrong explanation:
> > I found that if certain conditions are met, "crf 0" also generates
> > lossless videos.
> >
> > If these conditions are not met, "-crf 0" will be lossless:
> >
> > <<FFmpeg options>>
> >   "-bit_rate 0" (which means, enccfg.rc_end_usage = AOM_Q)
> >   "-aq-mode none"
> >   "-enable_restoration 0"
> >
> > <<the libaom settings which can't be configured from FFmpeg yet>>
> >   AV1E_SET_ENABLE_CHROMA_DELTAQ must be 0
> >   AV1E_SET_ENABLE_SUPERRES must be 0
> >
> > Thus, at least, "-lossless" does have a different meaning from "-crf 0",
> > so I think it would be useful to add "-lossless" flags.
>
> In an ideal world, crf 0 would force all other settings for a lossless
> encoding.
>
> Carl Eugen
> _______________________________________________
> 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