]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/nvenc: Handle minqp-only case in set_vbr
authorTimo Rothenpieler <timo@rothenpieler.org>
Tue, 31 May 2016 15:00:07 +0000 (17:00 +0200)
committerTimo Rothenpieler <timo@rothenpieler.org>
Tue, 31 May 2016 15:00:07 +0000 (17:00 +0200)
libavcodec/nvenc.c

index f440f5a41fe2f67435460f55ac981ad77bc8d537..409a7b785bba0cf6bea5c20b66dfd904533fd4d1 100644 (file)
@@ -531,6 +531,14 @@ static av_cold void set_vbr(AVCodecContext *avctx)
         rc->maxQP.qpIntra = avctx->qmax;
 
         qp_inter_p = (avctx->qmax + 3 * avctx->qmin) / 4; // biased towards Qmin
+    } else if (avctx->qmin >= 0) {
+        rc->enableMinQP = 1;
+
+        rc->minQP.qpInterB = avctx->qmin;
+        rc->minQP.qpInterP = avctx->qmin;
+        rc->minQP.qpIntra = avctx->qmin;
+
+        qp_inter_p = avctx->qmin;
     } else {
         qp_inter_p = 26; // default to 26
     }