summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/vaapi_encode.c3
-rw-r--r--libavcodec/vaapi_encode_h264.c4
-rw-r--r--libavcodec/vaapi_encode_h265.c4
3 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 7aaf263d25..2de5f76cab 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1435,8 +1435,7 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx)
ctx->output_order = - ctx->output_delay - 1;
// Currently we never generate I frames, only IDR.
- ctx->p_per_i = ((avctx->gop_size - 1 + avctx->max_b_frames) /
- (avctx->max_b_frames + 1));
+ ctx->p_per_i = INT_MAX;
ctx->b_per_p = avctx->max_b_frames;
if (ctx->codec->sequence_params_size > 0) {
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 92e29554ed..f9fcd805a4 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;
}
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index 6e008b7b9c..1d648a6d87 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -832,8 +832,8 @@ static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx)
vseq->vui_time_scale = avctx->time_base.den;
}
- 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;
}