Skip to content
Snippets Groups Projects
Commit ded1859d authored by Mark Thompson's avatar Mark Thompson
Browse files

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 314b421d)
parent ee1d04f9
No related branches found
No related tags found
No related merge requests found
...@@ -1369,6 +1369,12 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) ...@@ -1369,6 +1369,12 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx)
ctx->decode_delay = 1; ctx->decode_delay = 1;
ctx->output_order = - ctx->output_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) { if (ctx->codec->sequence_params_size > 0) {
ctx->codec_sequence_params = ctx->codec_sequence_params =
av_mallocz(ctx->codec->sequence_params_size); av_mallocz(ctx->codec->sequence_params_size);
...@@ -1395,12 +1401,6 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) ...@@ -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 // This should be configurable somehow. (Needs testing on a machine
// where it actually overlaps properly, though.) // where it actually overlaps properly, though.)
ctx->issue_mode = ISSUE_MODE_MAXIMISE_THROUGHPUT; ctx->issue_mode = ISSUE_MODE_MAXIMISE_THROUGHPUT;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment