avcodec/qsvenc: Set MaxKpbs to rc_max_rate for CBR and VBR (bitrate is equal to rc_ma...
authorSven Dueking <sven@nablet.com>
Fri, 14 Aug 2015 10:46:22 +0000 (12:46 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 14 Aug 2015 12:51:47 +0000 (14:51 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/qsvenc.c

index 57f5fe4..e5d3fa6 100644 (file)
@@ -121,7 +121,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
     case MFX_RATECONTROL_VBR:
         q->param.mfx.InitialDelayInKB = avctx->rc_initial_buffer_occupancy / 1000;
         q->param.mfx.TargetKbps       = avctx->bit_rate / 1000;
-        q->param.mfx.MaxKbps          = avctx->bit_rate / 1000;
+        q->param.mfx.MaxKbps          = avctx->rc_max_rate / 1000;
         break;
     case MFX_RATECONTROL_CQP:
         quant = avctx->global_quality / FF_QP2LAMBDA;