diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-12-17 15:41:29 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-12-17 15:41:29 +0300 |
commit | 5fc17edc7dcec5ea2989a0d764f3cfb666a7e663 (patch) | |
tree | 170cd8636cf774a00333e854229ab880170c8b3d /libavcodec/nvenc.c | |
parent | 31ae2308b3f6c1021d79da69c504490239895d60 (diff) | |
parent | 1520c6ff05d835da4b793318fc88bbbc129c86a1 (diff) |
Merge commit '1520c6ff05d835da4b793318fc88bbbc129c86a1'
* commit '1520c6ff05d835da4b793318fc88bbbc129c86a1':
nvenc: export CPB props side data
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r-- | libavcodec/nvenc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 31f2dfdd33..a3b02fa99f 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -550,6 +550,7 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx) GUID encoder_preset = NV_ENC_PRESET_HQ_GUID; GUID codec; NVENCSTATUS nv_status = NV_ENC_SUCCESS; + AVCPBProperties *cpb_props; int surfaceCount = 0; int i, num_mbs; int isLL = 0; @@ -1095,6 +1096,13 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx) if (ctx->encode_config.rcParams.averageBitRate > 0) avctx->bit_rate = ctx->encode_config.rcParams.averageBitRate; + cpb_props = ff_add_cpb_side_data(avctx); + if (!cpb_props) + return AVERROR(ENOMEM); + cpb_props->max_bitrate = ctx->encode_config.rcParams.maxBitRate; + cpb_props->avg_bitrate = avctx->bit_rate; + cpb_props->buffer_size = ctx->encode_config.rcParams.vbvBufferSize; + return 0; error: |