aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vaapi_encode.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-04-02 23:05:13 +0100
committerMark Thompson <sw@jkqxz.net>2017-06-14 22:26:32 +0100
commitb658b5399e5d75cec44b09d79b00f59fa83cca43 (patch)
tree696788391324986288111f7b092d7c54916c5e48 /libavcodec/vaapi_encode.c
parent28aedeed1961392d6b27f2f3abe4fd4c33393b93 (diff)
downloadffmpeg-b658b5399e5d75cec44b09d79b00f59fa83cca43.tar.gz
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.) (cherry picked from commit 6af014f4028238b4c50f1731b3369a41d65fa9c4)
Diffstat (limited to 'libavcodec/vaapi_encode.c')
-rw-r--r--libavcodec/vaapi_encode.c3
1 files changed, 1 insertions, 2 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) {