From 6af014f4028238b4c50f1731b3369a41d65fa9c4 Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Sun, 2 Apr 2017 23:05:13 +0100 Subject: vaapi_encode: Use gop_size consistently in RC parameters The non-H.26[45] codecs already use this form. Since we don't currently generate I frames for codecs which support them separately to IDR, the p_per_i variable is set to infinity by default so that it doesn't interfere with any other calculation. (All the code for I frames still exists, and it works for H.264 if set manually.) --- libavcodec/vaapi_encode_h264.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavcodec/vaapi_encode_h264.c') diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index b918e0d75e..0c3ac34411 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -905,8 +905,8 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) mseq->nal_hrd_parameters_present_flag = 0; } - vseq->intra_period = ctx->p_per_i * (ctx->b_per_p + 1); - vseq->intra_idr_period = vseq->intra_period; + vseq->intra_period = avctx->gop_size; + vseq->intra_idr_period = avctx->gop_size; vseq->ip_period = ctx->b_per_p + 1; } -- cgit v1.2.3