Remove gf_zeromotion_pct.

The use of this value is preventing rate adjustment on clips
or sections that have very little motion but high noise and
this can give rise to some sections with massive overshoot/undershoot.

Cherry-picked from VP9:
https://chromium-review.googlesource.com/c/webm/libvpx/+/349170

On a test clip (VBR 150 frames)
-------------------------------
Earlier, the per-frame PSNR for AV1 was gradually getting worse, as 'q'
was fixed from 2nd frame onwards.
Now, a gradually better q is used, so that per-frame PSNR stays
relatively stable.

AV1 before: PSNR = 52.940, bitrate = 11971]
AV1 after:  PSNR = 53.556, bitrate = 12457]
[VP9:       PSNR = 53.866, bitrate = 13372]

Standard sets (VBR 150 frames)
-------------------------------
lowres: 0.082
- All neutral except one
- bridge_close_cif.y4m which looks worse in metrics at very high bitrate
end. But we reduced a massive overshoot in that video:
e.g. at target-bitrate=2800, actual bitrate = 6920 before, 4758 after.

midres: -0.013
- A few clips slightly better.
- And we reduced a massive overshoot in snow_mnt_480p.y4m:
e.g. at target-bitrate=3600, actual bitrate = 6300 before, 5375 after.

hdres (60 frames): -0.013
- mobcal_720p50.y4m: -0.377
- Others neutral

STATS_CHANGED

BUG=b/119104564

Change-Id: I08450c507ee3bdbef6d9bf317721a5b5b03303aa
diff --git a/av1/encoder/firstpass.h b/av1/encoder/firstpass.h
index 3849d69..750a77a 100644
--- a/av1/encoder/firstpass.h
+++ b/av1/encoder/firstpass.h
@@ -162,7 +162,6 @@
 
   int kf_zeromotion_pct;
   int last_kfgroup_zeromotion_pct;
-  int gf_zeromotion_pct;
   int active_worst_quality;
   int baseline_active_worst_quality;
   int extend_minq;
diff --git a/av1/encoder/pass2_strategy.c b/av1/encoder/pass2_strategy.c
index b64ef30..f09183c 100644
--- a/av1/encoder/pass2_strategy.c
+++ b/av1/encoder/pass2_strategy.c
@@ -911,7 +911,6 @@
     }
     *this_frame = next_frame;
   }
-  twopass->gf_zeromotion_pct = (int)(zero_motion_accumulator * 1000.0);
 
   // Was the group length constrained by the requirement for a new KF?
   rc->constrained_gf_group = (i >= rc->frames_to_key) ? 1 : 0;
@@ -1766,9 +1765,7 @@
   twopass->kf_group_bits = AOMMAX(twopass->kf_group_bits, 0);
 
   // If the rate control is drifting consider adjustment to min or maxq.
-  if ((cpi->oxcf.rc_mode != AOM_Q) &&
-      (cpi->twopass.gf_zeromotion_pct < VLOW_MOTION_THRESHOLD) &&
-      !cpi->rc.is_src_frame_alt_ref) {
+  if ((cpi->oxcf.rc_mode != AOM_Q) && !cpi->rc.is_src_frame_alt_ref) {
     const int maxq_adj_limit =
         rc->worst_quality - twopass->active_worst_quality;
     const int minq_adj_limit =
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c
index 4e9464f..f5b3851 100644
--- a/av1/encoder/ratectrl.c
+++ b/av1/encoder/ratectrl.c
@@ -1169,8 +1169,7 @@
 
   // Extension to max or min Q if undershoot or overshoot is outside
   // the permitted range.
-  if ((cpi->oxcf.rc_mode != AOM_Q) &&
-      (cpi->twopass.gf_zeromotion_pct < VLOW_MOTION_THRESHOLD)) {
+  if (cpi->oxcf.rc_mode != AOM_Q) {
     if (frame_is_intra_only(cm) ||
         (!rc->is_src_frame_alt_ref &&
          (cpi->refresh_golden_frame || is_intrl_arf_boost ||