[FFmpeg-cvslog] qsvenc: export CPB props side data

Anton Khirnov git at videolan.org
Thu Dec 17 13:43:10 CET 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Oct  3 15:19:10 2015 +0200| [825900248b4053515803152d3165efdb034b660b] | committer: Anton Khirnov

qsvenc: export CPB props side data

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

 libavcodec/qsvenc.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 4fc3861..f19ca76 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -523,6 +523,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];
 
@@ -589,6 +591,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;



More information about the ffmpeg-cvslog mailing list