Unify first pass stats pointer operations

Unify the first pass stats pointer operations for both key frame
and other frame types.

Change-Id: Ic9226b520f275e633955522cb1ab6426a0d60ebf
diff --git a/av1/encoder/pass2_strategy.c b/av1/encoder/pass2_strategy.c
index 94ad3d8..27cdf50 100644
--- a/av1/encoder/pass2_strategy.c
+++ b/av1/encoder/pass2_strategy.c
@@ -2760,6 +2760,8 @@
   GF_GROUP *const gf_group = &cpi->gf_group;
   const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 
+  const FIRSTPASS_STATS *const start_pos = twopass->stats_in;
+
   if (is_stat_consumption_stage(cpi) && !twopass->stats_in) return;
 
   const int update_type = gf_group->update_type[gf_group->index];
@@ -2792,14 +2794,8 @@
   av1_zero(this_frame);
   // call above fn
   if (is_stat_consumption_stage(cpi)) {
-    if (gf_group->index < gf_group->size || rc->frames_to_key == 0) {
-      // Do not read if it is overlay for kf arf, since kf already
-      // advanced the first pass stats pointer
-      if (!av1_check_keyframe_overlay(gf_group->index, gf_group,
-                                      rc->frames_since_key)) {
-        process_first_pass_stats(cpi, &this_frame);
-      }
-    }
+    if (gf_group->index < gf_group->size || rc->frames_to_key == 0)
+      process_first_pass_stats(cpi, &this_frame);
   } else {
     rc->active_worst_quality = oxcf->rc_cfg.cq_level;
   }
@@ -2928,6 +2924,10 @@
   }
   assert(gf_group->index < gf_group->size);
 
+  if (gf_group->update_type[gf_group->index] == ARF_UPDATE ||
+      gf_group->update_type[gf_group->index] == INTNL_ARF_UPDATE)
+    reset_fpf_position(twopass, start_pos);
+
   frame_params->frame_type = gf_group->frame_type[gf_group->index];
 
   // Do the firstpass stats indicate that this frame is skippable for the