Add flag to turn off ref frame mvs

This is required to make the ParseAbilityTest work
for lag_in_frames > 0, since control settings are not
currently stored in the lookahead buffer.

Change-Id: I52e2d38151bde6b269c74e8365ba06c8c4bd4955
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 4299346..95073b6 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -4513,6 +4513,7 @@
     cpi->refresh_alt2_ref_frame = cpi->ext_refresh_alt2_ref_frame;
     cpi->ext_refresh_frame_flags_pending = 0;
   }
+  cpi->common.allow_ref_frame_mvs = cpi->ext_use_ref_frame_mvs;
 }
 
 static int setup_interp_filter_search_mask(AV1_COMP *cpi) {
@@ -4679,8 +4680,7 @@
 
   // S_FRAMEs are always error resilient
   cm->error_resilient_mode = oxcf->error_resilient_mode || frame_is_sframe(cm);
-  cm->allow_ref_frame_mvs =
-      cpi->oxcf.allow_ref_frame_mvs && frame_might_allow_ref_frame_mvs(cm);
+  cm->allow_ref_frame_mvs &= frame_might_allow_ref_frame_mvs(cm);
   cm->allow_warped_motion =
       cpi->oxcf.allow_warped_motion && frame_might_allow_warped_motion(cm);
 
@@ -5566,6 +5566,7 @@
       *size = 0;
       return -1;
     }
+    av1_apply_encoding_flags(cpi, source->flags);
     cpi->source = &source->img;
     // TODO(zoeliu): To track down to determine whether it's needed to adjust
     // the frame rate.
@@ -6060,6 +6061,9 @@
     av1_update_reference(cpi, upd);
   }
 
+  cpi->ext_use_ref_frame_mvs = cpi->oxcf.allow_ref_frame_mvs &
+                               ((flags & AOM_EFLAG_NO_REF_FRAME_MVS) == 0);
+
   if (flags & AOM_EFLAG_NO_UPD_ENTROPY) {
     av1_update_entropy(cpi, 0);
   }