aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi, Zhong <zhong.li@intel.com>2017-12-01 16:48:45 +0800
committerMaxym Dmytrychenko <maxim.d33@gmail.com>2017-12-12 13:58:18 +0100
commit6ff29343b01923e9b125fe7404ac8701cdfb1fe5 (patch)
tree11ceb583e8e1bdfe1bc32af8ff6cc424bc84e68d
parent18a0f420269ff4c730422361c5c4d8eea096e900 (diff)
downloadffmpeg-6ff29343b01923e9b125fe7404ac8701cdfb1fe5.tar.gz
lavc/qsvenc: set HRD buffer size
Hypothetical Reference Decoding (HRD) model assumes that data flows into a buffer of the fixed size BufferSizeInKB with a constant bitrate. Smaller BufferSizeInKB means smaller frame size variations, but more difficult to maintain HRD. Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
-rw-r--r--libavcodec/qsvenc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 9db9eb375c..f6034c443d 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -503,6 +503,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
#if QSV_HAVE_VCM
case MFX_RATECONTROL_VCM:
#endif
+ q->param.mfx.BufferSizeInKB = avctx->rc_buffer_size / 8000;
q->param.mfx.InitialDelayInKB = avctx->rc_initial_buffer_occupancy / 1000;
q->param.mfx.TargetKbps = avctx->bit_rate / 1000;
q->param.mfx.MaxKbps = avctx->rc_max_rate / 1000;