[FFmpeg-cvslog] lavc/aomenc: Force default qmax of 0 if crf was set to 0.

Carl Eugen Hoyos git at videolan.org
Sun Mar 21 10:49:26 EET 2021


ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Sat Mar 20 19:27:48 2021 +0100| [288ca1c66740640d5742f2921efbf502d83f8b6a] | committer: Carl Eugen Hoyos

lavc/aomenc: Force default qmax of 0 if crf was set to 0.

Fixes lossless encoding without setting qmax to 0.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=288ca1c66740640d5742f2921efbf502d83f8b6a
---

 libavcodec/libaomenc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 2c3c3eb185..fcf75e835d 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -654,8 +654,11 @@ static av_cold int aom_init(AVCodecContext *avctx,
 
     if (avctx->qmin >= 0)
         enccfg.rc_min_quantizer = avctx->qmin;
-    if (avctx->qmax >= 0)
+    if (avctx->qmax >= 0) {
         enccfg.rc_max_quantizer = avctx->qmax;
+    } else if (!ctx->crf) {
+        enccfg.rc_max_quantizer = 0;
+    }
 
     if (enccfg.rc_end_usage == AOM_CQ || enccfg.rc_end_usage == AOM_Q) {
         if (ctx->crf < enccfg.rc_min_quantizer || ctx->crf > enccfg.rc_max_quantizer) {



More information about the ffmpeg-cvslog mailing list