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

Fixes lossless encoding without setting qmax to 0.
pull/362/head
Carl Eugen Hoyos 4 years ago
parent 9f8c81efc5
commit 288ca1c667
  1. 5
      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) {

Loading…
Cancel
Save