Commit 3303f864 authored by Ganapathy Kasi's avatar Ganapathy Kasi Committed by Luca Barbato

nvenc: Remove qmin and qmax constraints for nvenc vbr

qmin and qmax are not necessary for nvenc vbr.

Also fix for using 2 pass vbr mode for slow preset through ctx->flag NVENC_TWO_PASSES.
Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
parent aba5b948
...@@ -559,12 +559,8 @@ static void nvenc_override_rate_control(AVCodecContext *avctx, ...@@ -559,12 +559,8 @@ static void nvenc_override_rate_control(AVCodecContext *avctx,
return; return;
case NV_ENC_PARAMS_RC_2_PASS_VBR: case NV_ENC_PARAMS_RC_2_PASS_VBR:
case NV_ENC_PARAMS_RC_VBR: case NV_ENC_PARAMS_RC_VBR:
if (avctx->qmin < 0 && avctx->qmax < 0) { set_vbr(avctx, rc);
av_log(avctx, AV_LOG_WARNING, break;
"The variable bitrate rate-control requires "
"the 'qmin' and/or 'qmax' option set.\n");
return;
}
case NV_ENC_PARAMS_RC_VBR_MINQP: case NV_ENC_PARAMS_RC_VBR_MINQP:
if (avctx->qmin < 0) { if (avctx->qmin < 0) {
av_log(avctx, AV_LOG_WARNING, av_log(avctx, AV_LOG_WARNING,
...@@ -606,8 +602,11 @@ static void nvenc_setup_rate_control(AVCodecContext *avctx) ...@@ -606,8 +602,11 @@ static void nvenc_setup_rate_control(AVCodecContext *avctx)
set_lossless(avctx, rc); set_lossless(avctx, rc);
} else if (avctx->global_quality > 0) { } else if (avctx->global_quality > 0) {
set_constqp(avctx, rc); set_constqp(avctx, rc);
} else if (avctx->qmin >= 0 && avctx->qmax >= 0) { } else {
rc->rateControlMode = NV_ENC_PARAMS_RC_VBR; if (ctx->flags & NVENC_TWO_PASSES)
rc->rateControlMode = NV_ENC_PARAMS_RC_2_PASS_VBR;
else
rc->rateControlMode = NV_ENC_PARAMS_RC_VBR;
set_vbr(avctx, rc); set_vbr(avctx, rc);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment