aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-12-17 13:42:53 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-12-17 13:42:53 +0100
commitb2d8b91cf0a21537c893d52dc487bfd79988f234 (patch)
tree937ca79ddcd61f27244004026a6d7fc4d109a178
parent5fc17edc7dcec5ea2989a0d764f3cfb666a7e663 (diff)
parent825900248b4053515803152d3165efdb034b660b (diff)
downloadffmpeg-b2d8b91cf0a21537c893d52dc487bfd79988f234.tar.gz
Merge commit '825900248b4053515803152d3165efdb034b660b'
* commit '825900248b4053515803152d3165efdb034b660b': qsvenc: export CPB props side data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
-rw-r--r--libavcodec/qsvenc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index d00fdfff88..04b8e200cd 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -543,6 +543,8 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q)
{
+ AVCPBProperties *cpb_props;
+
uint8_t sps_buf[128];
uint8_t pps_buf[128];
@@ -609,6 +611,14 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q)
avctx->extradata_size = extradata.SPSBufSize + need_pps * extradata.PPSBufSize;
memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+ cpb_props = ff_add_cpb_side_data(avctx);
+ if (!cpb_props)
+ return AVERROR(ENOMEM);
+ cpb_props->max_bitrate = avctx->rc_max_rate;
+ cpb_props->min_bitrate = avctx->rc_min_rate;
+ cpb_props->avg_bitrate = avctx->bit_rate;
+ cpb_props->buffer_size = avctx->rc_buffer_size;
+
dump_video_param(avctx, q, ext_buffers + 1);
return 0;