[FFmpeg-cvslog] lavc/vaapi_encode: fix p_per_i calculate issue.
Jun Zhao
git at videolan.org
Mon Apr 3 01:46:25 EEST 2017
ffmpeg | branch: master | Jun Zhao <jun.zhao at intel.com> | Wed Mar 29 17:18:59 2017 +0800| [08087f54626780b6955e470d59b1c7eff6c57f72] | committer: 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: Jun Zhao <jun.zhao at intel.com>
Signed-off-by: Leilei <leilei.shang at intel.com>
Signed-off-by: Mark Thompson <sw at jkqxz.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=08087f54626780b6955e470d59b1c7eff6c57f72
---
libavcodec/vaapi_encode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 070ff5f..7e9c00f 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list