[FFmpeg-cvslog] avcodec/nvenc: honor max bitrate in CQ mode

Roman Arzumanyan git at videolan.org
Thu Jun 4 20:02:14 EEST 2020


ffmpeg | branch: master | Roman Arzumanyan <rarzumanyan at nvidia.com> | Wed Jun  3 16:12:12 2020 +0300| [470bbf60d4cd34abd2cabea40910af6c0fc2366c] | committer: Timo Rothenpieler

avcodec/nvenc: honor max bitrate in CQ mode

Signed-off-by: Timo Rothenpieler <timo at rothenpieler.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=470bbf60d4cd34abd2cabea40910af6c0fc2366c
---

 libavcodec/nvenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 880454c960..e269c716a4 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -956,9 +956,9 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx)
 
         av_log(avctx, AV_LOG_VERBOSE, "CQ(%d) mode enabled.\n", tmp_quality);
 
-        //CQ mode shall discard max & avg bitrate;
-        avctx->bit_rate    = ctx->encode_config.rcParams.averageBitRate = 0;
-        avctx->rc_max_rate = ctx->encode_config.rcParams.maxBitRate     = 0;
+        //CQ mode shall discard avg bitrate & honor max bitrate;
+        ctx->encode_config.rcParams.averageBitRate = avctx->bit_rate = 0;
+        ctx->encode_config.rcParams.maxBitRate = avctx->rc_max_rate;
     }
 }
 



More information about the ffmpeg-cvslog mailing list