qmin and qmax are not necessary for nvenc vbr. Enforcing this constraint, doesn't allow user to use vbr 2 pass mode without explicity setting the qmin and qmax options
Unified · Split
| @@ -589,16 +589,6 @@ static void nvenc_override_rate_control(AVCodecContext *avctx) · 588 unmodified lines | ||
| 589 | 589 | } |
| 590 | 590 | set_constqp(avctx); |
| 591 | 591 | return; |
| 592 | − case NV_ENC_PARAMS_RC_2_PASS_VBR: | |
| 593 | − case NV_ENC_PARAMS_RC_VBR: | |
| 594 | − if (avctx->qmin < 0 && avctx->qmax < 0) { | |
| 595 | − av_log(avctx, AV_LOG_WARNING, | |
| 596 | − "The variable bitrate rate-control requires " | |
| 597 | − "the 'qmin' and/or 'qmax' option set.\n"); | |
| 598 | − set_vbr(avctx); | |
| 599 | − return; | |
| 600 | − } | |
| 601 | − /* fall through */ | |
| 602 | 592 | case NV_ENC_PARAMS_RC_VBR_MINQP: |
| 603 | 593 | if (avctx->qmin < 0) { |
| 604 | 594 | av_log(avctx, AV_LOG_WARNING, |
| @@ -607,6 +597,9 @@ static void nvenc_override_rate_control(AVCodecContext *avctx) · 2 unmodified lines | ||
| 607 | 597 | set_vbr(avctx); |
| 608 | 598 | return; |
| 609 | 599 | } |
| 600 | + /* fall through */ | |
| 601 | + case NV_ENC_PARAMS_RC_2_PASS_VBR: | |
| 602 | + case NV_ENC_PARAMS_RC_VBR: | |
| 610 | 603 | set_vbr(avctx); |
| 611 | 604 | break; |
| 612 | 605 | case NV_ENC_PARAMS_RC_CBR: |