Fix a few mis-use cases of MAX_MV_REF_CANDIDATES

Fix several use cases where MAX_MV_REF_CANDIDATES is mixed up with
is_compound flag to avoid potential coding interruption.

Change-Id: Ifdee1ef8a81ef6d1c155315c6c6a3074aa7a8b5e
diff --git a/vp10/decoder/decodemv.c b/vp10/decoder/decodemv.c
index b52696d..728ec9f 100644
--- a/vp10/decoder/decodemv.c
+++ b/vp10/decoder/decodemv.c
@@ -1317,7 +1317,7 @@
       nearestmv[0] = xd->ref_mv_stack[ref_frame_type][0].this_mv;
       nearestmv[1] = xd->ref_mv_stack[ref_frame_type][0].comp_mv;
 
-      for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i)
+      for (i = 0; i < 1 + is_compound; ++i)
         lower_mv_precision(&nearestmv[i].as_mv, allow_hp);
 #if CONFIG_EXT_INTER
       } else if (mbmi->mode == NEAREST_NEWMV || mbmi->mode == NEAREST_NEARMV) {
@@ -1351,7 +1351,7 @@
       nearmv[0] = xd->ref_mv_stack[ref_frame_type][ref_mv_idx].this_mv;
       nearmv[1] = xd->ref_mv_stack[ref_frame_type][ref_mv_idx].comp_mv;
 
-      for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) {
+      for (i = 0; i < 1 + is_compound; ++i) {
         lower_mv_precision(&nearestmv[i].as_mv, allow_hp);
         lower_mv_precision(&nearmv[i].as_mv, allow_hp);
       }
diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c
index 05cb75c..a986c4b 100644
--- a/vp10/encoder/rdopt.c
+++ b/vp10/encoder/rdopt.c
@@ -8832,7 +8832,7 @@
         nearestmv[1] = mbmi_ext->ref_mv_stack[rf_type][0].comp_mv;
       }
 
-      for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) {
+      for (i = 0; i < 2; ++i) {
         lower_mv_precision(&nearestmv[i].as_mv, allow_hp);
         lower_mv_precision(&nearmv[i].as_mv, allow_hp);
       }