]> granicus.if.org Git - libvpx/commitdiff
Avoid two GF only groups just before a kf
authorDeepa K G <deepa.kg@ittiam.com>
Mon, 29 Apr 2019 13:09:14 +0000 (18:39 +0530)
committerDeepa K G <deepa.kg@ittiam.com>
Fri, 3 May 2019 05:31:52 +0000 (11:01 +0530)
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

index 5fdca8d0dc365f5f0c2abbc47c5fe395ce8945b4..70a45a1d6d914f4389888337f4008312ecb40cd2 100644 (file)
@@ -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;