ref: 2b8e2731052adb84c32727f04e23a2c654abe04c
parent: 184af622dd47a4220c4f2e66bc817822e4e705f8
author: Deepa K G <deepa.kg@ittiam.com>
date: Mon Apr 29 14:39:14 EDT 2019
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
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2525,6 +2525,8 @@
(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;