From 2b8e2731052adb84c32727f04e23a2c654abe04c Mon Sep 17 00:00:00 2001 From: Deepa K G Date: Mon, 29 Apr 2019 18:39:14 +0530 Subject: [PATCH] Avoid two GF only groups just before a kf Trap the case where we end up with two short GF only groups just before a key frame. For example, if the KF is 22 frames away we are better doing one ARF group of size 16 followed by a GF only group of 6 than two GF only groups of size 11 (when min_gf_interval is 12). Change-Id: Ie598a8a21c6e104cbe381b4792e77fd92d047725 --- vp9/encoder/vp9_firstpass.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 5fdca8d0d..70a45a1d6 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -2525,6 +2525,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { (active_max_gf_interval >= (rc->frames_to_key - rc->min_gf_interval))) active_max_gf_interval = rc->frames_to_key / 2; } + active_max_gf_interval = + VPXMAX(active_max_gf_interval, active_min_gf_interval); if (cpi->multi_layer_arf) { int layers = 0; -- 2.40.0