diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-05-11 19:40:30 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-05-11 19:40:39 +0100 |
commit | 8ed427f9f92fd45c2510c019dba932acda74817f (patch) | |
tree | 860dca02a5cf782100e7abf6a64a35ddab5f967d /libavcodec/vaapi_encode.c | |
parent | bc3d2f25783a4f61b7018800a12182dc46ff8325 (diff) | |
parent | 92fdea37477b5a2d1329e5ef0773e24473fa8f12 (diff) | |
download | ffmpeg-8ed427f9f92fd45c2510c019dba932acda74817f.tar.gz |
Merge commit '92fdea37477b5a2d1329e5ef0773e24473fa8f12'
These are all trivial to merge.
* commit '92fdea37477b5a2d1329e5ef0773e24473fa8f12':
vaapi_h265: Add -qp option, use it to replace use of -global_quality
vaapi_h265: Add constant-bitrate encode support
vaapi_h264: Add encode quality option (for quality-speed tradeoff)
vaapi_h264: Add -qp option, use it to replace use of -global_quality
vaapi_encode: Add support for codec-local options
vaapi_h264: Add constant-bitrate encode support
vaapi_encode: Refactor slightly to allow easier setting of global options
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/vaapi_encode.c')
-rw-r--r-- | libavcodec/vaapi_encode.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index 24b05a9031..329b33cbee 100644 --- a/libavcodec/vaapi_encode.c +++ b/libavcodec/vaapi_encode.c @@ -202,6 +202,19 @@ static int vaapi_encode_issue(AVCodecContext *avctx, pic->nb_param_buffers = 0; + if (pic->encode_order == 0) { + // Global parameter buffers are set on the first picture only. + + for (i = 0; i < ctx->nb_global_params; i++) { + err = vaapi_encode_make_param_buffer(avctx, pic, + VAEncMiscParameterBufferType, + (char*)ctx->global_params[i], + ctx->global_params_size[i]); + if (err < 0) + goto fail; + } + } + if (pic->type == PICTURE_TYPE_IDR && ctx->codec->init_sequence_params) { err = vaapi_encode_make_param_buffer(avctx, pic, VAEncSequenceParameterBufferType, @@ -892,6 +905,7 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx, } ctx->codec = type; + ctx->codec_options = ctx->codec_options_data; ctx->priv_data = av_mallocz(type->priv_data_size); if (!ctx->priv_data) { |