Commit 08087f54 authored by Jun Zhao's avatar Jun Zhao Committed by Mark Thompson

lavc/vaapi_encode: fix p_per_i calculate issue.

now gop_size <= (max_b_frames + 1) * p_per_i + 1 (IDR frame),
so celing p_per_i = (gop_size - 1 + max_b_frames) / (max_b_frames + 1)
Signed-off-by: 's avatarJun Zhao <jun.zhao@intel.com>
Signed-off-by: 's avatarLeilei <leilei.shang@intel.com>
Signed-off-by: 's avatarMark Thompson <sw@jkqxz.net>
parent 3cbf7174
......@@ -1433,7 +1433,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 + avctx->max_b_frames) /
ctx->p_per_i = ((avctx->gop_size - 1 + avctx->max_b_frames) /
(avctx->max_b_frames + 1));
ctx->b_per_p = avctx->max_b_frames;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment