aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-12-17 13:34:51 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-12-17 13:34:51 +0100
commitb77061b5caceb07b4487a08e48f78a5b24c15959 (patch)
tree8209bd4dfbf170f600b6115571bfccf0d9515dfc /libavcodec/libx264.c
parentd6322710c5ec51086aefef9037311922c7aa646c (diff)
parent732a37d1466d45b3812509d68c82e783530e291a (diff)
downloadffmpeg-b77061b5caceb07b4487a08e48f78a5b24c15959.tar.gz
Merge commit '732a37d1466d45b3812509d68c82e783530e291a'
* commit '732a37d1466d45b3812509d68c82e783530e291a': libx264: export CPB props side data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 82625b7ae9..c97ae3871f 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -452,6 +452,7 @@ static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
static av_cold int X264_init(AVCodecContext *avctx)
{
X264Context *x4 = avctx->priv_data;
+ AVCPBProperties *cpb_props;
int sw,sh;
if (avctx->global_quality > 0)
@@ -816,6 +817,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
avctx->extradata_size = p - avctx->extradata;
}
+ cpb_props = ff_add_cpb_side_data(avctx);
+ if (!cpb_props)
+ return AVERROR(ENOMEM);
+ cpb_props->buffer_size = x4->params.rc.i_vbv_buffer_size * 1000;
+ cpb_props->max_bitrate = x4->params.rc.i_vbv_max_bitrate * 1000;
+ cpb_props->avg_bitrate = x4->params.rc.i_bitrate * 1000;
+
return 0;
}