Add rate_ctrl flag
authorangiebird <angiebird@google.com>
Thu, 24 Oct 2019 20:59:00 +0000 (13:59 -0700)
committerangiebird <angiebird@google.com>
Tue, 29 Oct 2019 23:34:18 +0000 (16:34 -0700)
BDRate Changes (negative means improvement)
lowres: 0.565%
midres: 0.361%
lowres: 0.233%
ugc360: -0.242%

Make gop size independent from coding results

Change-Id: I1f54c48b12dc45ee5162ca2527a877c1610528bd

configure
vp9/encoder/vp9_firstpass.c

index 4f58161..79a1b33 100755 (executable)
--- a/configure
+++ b/configure
@@ -272,6 +272,7 @@ EXPERIMENT_LIST="
     fp_mb_stats
     emulate_hardware
     non_greedy_mv
+    rate_ctrl
 "
 CONFIG_LIST="
     dependency_tracking
index 3554f48..f026160 100644 (file)
@@ -2580,6 +2580,21 @@ static RANGE get_active_gf_inverval_range(
     const FRAME_INFO *frame_info, const RATE_CONTROL *rc, int arf_active_or_kf,
     int gf_start_show_idx, int active_worst_quality, int last_boosted_qindex) {
   RANGE active_gf_interval;
+#if CONFIG_RATE_CTRL
+  (void)frame_info;
+  (void)gf_start_show_idx;
+  (void)active_worst_quality;
+  (void)last_boosted_qindex;
+  active_gf_interval.min = rc->min_gf_interval + arf_active_or_kf + 2;
+
+  active_gf_interval.max = 16 + arf_active_or_kf;
+
+  if ((active_gf_interval.max <= rc->frames_to_key) &&
+      (active_gf_interval.max >= (rc->frames_to_key - rc->min_gf_interval))) {
+    active_gf_interval.min = rc->frames_to_key / 2;
+    active_gf_interval.max = rc->frames_to_key / 2;
+  }
+#else
   int int_max_q = (int)(vp9_convert_qindex_to_q(active_worst_quality,
                                                 frame_info->bit_depth));
   int q_term = (gf_start_show_idx == 0)
@@ -2617,6 +2632,7 @@ static RANGE get_active_gf_inverval_range(
   }
   active_gf_interval.max =
       VPXMAX(active_gf_interval.max, active_gf_interval.min);
+#endif
   return active_gf_interval;
 }