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

Fixes lossless encoding without setting qmax to 0.
This commit is contained in:
Carl Eugen Hoyos 2021-03-20 19:27:48 +01:00
parent 9f8c81efc5
commit 288ca1c667
1 changed files with 4 additions and 1 deletions

View File

@ -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) {