Hi,

qmin and qmax are not necessary for nvenc vbr. Enforcing this constraint, 
doesn't allow user to use vbr 2 pass mode (

NV_ENC_PARAMS_RC_2_PASS_VBR) without explicity setting the qmin and qmax 
options and reverts to the default vbr mode (

NV_ENC_PARAMS_RC_VBR). If needed user can still set qmin and qmax and those 
will be obeyed. Please review. Thanks.


Regards

Ganapathy Kasi

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
From 41f4541a1137f5a49da2ffb0013d2574f3ad46a0 Mon Sep 17 00:00:00 2001
From: Ganapathy Kasi <gk...@nvidia.com>
Date: Thu, 23 Feb 2017 17:32:21 -0800
Subject: [PATCH] Remove qmin and qmax constraints for nvenc vbr

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
---
 libavcodec/nvenc.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index ba2647b..3c24bc5 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -589,15 +589,6 @@ static void nvenc_override_rate_control(AVCodecContext *avctx)
         }
         set_constqp(avctx);
         return;
-    case NV_ENC_PARAMS_RC_2_PASS_VBR:
-    case NV_ENC_PARAMS_RC_VBR:
-        if (avctx->qmin < 0 && avctx->qmax < 0) {
-            av_log(avctx, AV_LOG_WARNING,
-                   "The variable bitrate rate-control requires "
-                   "the 'qmin' and/or 'qmax' option set.\n");
-            set_vbr(avctx);
-            return;
-        }
         /* fall through */
     case NV_ENC_PARAMS_RC_VBR_MINQP:
         if (avctx->qmin < 0) {
@@ -609,6 +600,10 @@ static void nvenc_override_rate_control(AVCodecContext *avctx)
         }
         set_vbr(avctx);
         break;
+    case NV_ENC_PARAMS_RC_2_PASS_VBR:
+    case NV_ENC_PARAMS_RC_VBR:
+        set_vbr(avctx);
+        break;
     case NV_ENC_PARAMS_RC_CBR:
     case NV_ENC_PARAMS_RC_2_PASS_QUALITY:
     case NV_ENC_PARAMS_RC_2_PASS_FRAMESIZE_CAP:
-- 
2.7.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to