Do not call av1_setup_motion_field unconditionally

We only need to call av1_setup_motion_field() if cm->allow_ref_frame_mvs
is true. Section 5.9.2 of the AV1 spec says:

uncompressed_header( ) {
    ...
    if ( use_ref_frame_mvs == 1 )
        motion_field_estimation( )
    ...
}

BUG=aomedia:2287

Change-Id: I08658880b7497f8245ddc65dabc2c86d5bcff79a
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index a06857c..e3b39fa 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -5482,7 +5482,7 @@
 
   cm->setup_mi(cm);
 
-  av1_setup_motion_field(cm);
+  if (cm->allow_ref_frame_mvs) av1_setup_motion_field(cm);
 
   av1_setup_block_planes(xd, cm->seq_params.subsampling_x,
                          cm->seq_params.subsampling_y, num_planes);
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index acc0cbd..071e9f5 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -6440,7 +6440,7 @@
   memcpy(cm->cur_frame->global_motion, cm->global_motion,
          REF_FRAMES * sizeof(WarpedMotionParams));
 
-  av1_setup_motion_field(cm);
+  if (cm->allow_ref_frame_mvs) av1_setup_motion_field(cm);
 
   cpi->all_one_sided_refs =
       frame_is_intra_only(cm) ? 0 : av1_refs_are_one_sided(cm);