Conduct diff wtd type search once per coding block

Reuse the prior search results of diff wtd type.

STATS_CHANGED

Change-Id: I7606778284658389b640379c97ce584c8ff00493
diff --git a/av1/encoder/compound_type.c b/av1/encoder/compound_type.c
index 6594bce..fd39bde 100644
--- a/av1/encoder/compound_type.c
+++ b/av1/encoder/compound_type.c
@@ -1470,7 +1470,8 @@
       }
 
       if (need_mask_search) {
-        args->diffwtd_index = best_mask_index;
+        if (have_newmv_in_inter_mode(this_mode))
+          args->diffwtd_index = best_mask_index;
       } else {
         mbmi->interinter_comp.mask_type = args->diffwtd_index;
         rs2 = masked_type_cost[cur_type];
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index c6b2d16..d9cbc90 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -2656,8 +2656,6 @@
     save_mv[i][1].as_int = INVALID_MV;
   }
 
-  args->diffwtd_index = -1;
-
   // Main loop of this function. This will  iterate over all of the ref mvs
   // in the dynamic reference list and do the following:
   //    1.) Get the current MV. Create newmv MV if necessary
@@ -5230,7 +5228,7 @@
                                0,
                                -1,
                                -1,
-                               0 };
+                               -1 };
   // Indicates the appropriate number of simple translation winner modes for
   // exhaustive motion mode evaluation
   const int max_winner_motion_mode_cand =
diff --git a/test/horz_superres_test.cc b/test/horz_superres_test.cc
index 09fc101..b8a268e 100644
--- a/test/horz_superres_test.cc
+++ b/test/horz_superres_test.cc
@@ -55,7 +55,7 @@
   { "park_joy_90p_8_420.y4m", AOM_IMG_FMT_I420, AOM_BITS_8, 0, 5, 0, 25.7,
     45.0 },
 #if CONFIG_AV1_HIGHBITDEPTH
-  { "park_joy_90p_10_444.y4m", AOM_IMG_FMT_I44416, AOM_BITS_10, 1, 5, 0, 28.0,
+  { "park_joy_90p_10_444.y4m", AOM_IMG_FMT_I44416, AOM_BITS_10, 1, 5, 0, 27.0,
     48.0 },
 #endif
   { "screendata.y4m", AOM_IMG_FMT_I420, AOM_BITS_8, 0, 4, 1, 23.0, 56.0 },