diff options
author | Mark Thompson <sw@jkqxz.net> | 2016-09-30 17:27:58 +0200 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2016-11-21 22:13:41 +0000 |
commit | ded1859df17f5974dd2fc41a1b7d8eb0d3aaeceb (patch) | |
tree | e920ad25d8fcbc3f6e401715da07cef8e648c99f | |
parent | ee1d04f970b0297953a6b547f615297f1343654f (diff) | |
download | ffmpeg-ded1859df17f5974dd2fc41a1b7d8eb0d3aaeceb.tar.gz |
vaapi_encode: Decide on GOP setup before initialising sequence parameters
This was always too late; several fields related to it have been incorrectly
zero since the encoder was added.
(cherry picked from commit 314b421dd8910ebed7a8d419a0dbea239a00044e)
-rw-r--r-- | libavcodec/vaapi_encode.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index dc52ba5439..262968a0ec 100644 --- a/libavcodec/vaapi_encode.c +++ b/libavcodec/vaapi_encode.c @@ -1369,6 +1369,12 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) ctx->decode_delay = 1; ctx->output_order = - ctx->output_delay - 1; + // Currently we never generate I frames, only IDR. + ctx->i_per_idr = 0; + ctx->p_per_i = ((avctx->gop_size + avctx->max_b_frames) / + (avctx->max_b_frames + 1)); + ctx->b_per_p = avctx->max_b_frames; + if (ctx->codec->sequence_params_size > 0) { ctx->codec_sequence_params = av_mallocz(ctx->codec->sequence_params_size); @@ -1395,12 +1401,6 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) } } - // All I are IDR for now. - ctx->i_per_idr = 0; - ctx->p_per_i = ((avctx->gop_size + avctx->max_b_frames) / - (avctx->max_b_frames + 1)); - ctx->b_per_p = avctx->max_b_frames; - // This should be configurable somehow. (Needs testing on a machine // where it actually overlaps properly, though.) ctx->issue_mode = ISSUE_MODE_MAXIMISE_THROUGHPUT; |