From: Deepa K G Date: Mon, 29 Apr 2019 13:09:14 +0000 (+0530) Subject: Avoid two GF only groups just before a kf X-Git-Tag: v1.8.1~65^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b8e2731052adb84c32727f04e23a2c654abe04c;p=libvpx 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 --- 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;