diff options
author | Jun Zhao <jun.zhao@intel.com> | 2017-03-29 17:18:59 +0800 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2017-04-02 23:28:54 +0100 |
commit | 08087f54626780b6955e470d59b1c7eff6c57f72 (patch) | |
tree | 38353b4e37da282639f5a5ffd0f41eec81e35a79 | |
parent | 3cbf717425b68ef1a731147748edd5c087af15a1 (diff) | |
download | ffmpeg-08087f54626780b6955e470d59b1c7eff6c57f72.tar.gz |
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@intel.com>
Signed-off-by: Leilei <leilei.shang@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
-rw-r--r-- | libavcodec/vaapi_encode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index 070ff5f244..7e9c00f51d 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; |