Pass conv_param to av1_make_masked_inter_predictor

Change-Id: Ifdf75f61f0c0cc2f95545f79439bae2accbe7b01
diff --git a/av1/common/reconinter.c b/av1/common/reconinter.c
index 69e469b..8f54fb3 100644
--- a/av1/common/reconinter.c
+++ b/av1/common/reconinter.c
@@ -702,7 +702,7 @@
                                      uint8_t *dst, int dst_stride,
                                      const int subpel_x, const int subpel_y,
                                      const struct scale_factors *sf, int w,
-                                     int h,
+                                     int h, ConvolveParams *conv_params,
 #if CONFIG_DUAL_FILTER
                                      const InterpFilter *interp_filter,
 #else
@@ -731,10 +731,6 @@
 #endif  // CONFIG_COMPOUND_SEGMENT
     mi->mbmi.interinter_compound_type
   };
-#if !CONFIG_GLOBAL_MOTION && !CONFIG_WARPED_MOTION
-  int ref = 0;
-#endif  // !CONFIG_GLOBAL_MOTION && !CONFIG_WARPED_MOTION
-  ConvolveParams conv_params = get_conv_params(ref, 0, plane);
 
 #if CONFIG_HIGHBITDEPTH
   DECLARE_ALIGNED(16, uint8_t, tmp_dst_[2 * MAX_SB_SQUARE]);
@@ -742,7 +738,7 @@
                          ? CONVERT_TO_BYTEPTR(tmp_dst_)
                          : tmp_dst_;
   av1_make_inter_predictor(pre, pre_stride, tmp_dst, MAX_SB_SIZE, subpel_x,
-                           subpel_y, sf, w, h, &conv_params, interp_filter,
+                           subpel_y, sf, w, h, conv_params, interp_filter,
 #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
                            warp_types, p_col, p_row, plane, ref,
 #endif  // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
@@ -785,7 +781,7 @@
 #else  // CONFIG_HIGHBITDEPTH
   DECLARE_ALIGNED(16, uint8_t, tmp_dst[MAX_SB_SQUARE]);
   av1_make_inter_predictor(pre, pre_stride, tmp_dst, MAX_SB_SIZE, subpel_x,
-                           subpel_y, sf, w, h, &conv_params, interp_filter,
+                           subpel_y, sf, w, h, conv_params, interp_filter,
 #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
                            warp_types, p_col, p_row, plane, ref,
 #endif  // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
@@ -1025,7 +1021,6 @@
           uint8_t *pre;
           int xs, ys, subpel_x, subpel_y;
           const int is_scaled = av1_is_scaled(sf);
-          ConvolveParams conv_params = get_conv_params(ref, ref, plane);
 #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
           WarpTypesAllowed warp_types;
 #if CONFIG_GLOBAL_MOTION
@@ -1081,11 +1076,16 @@
                   (x + (mv_q4.col >> SUBPEL_BITS));
           }
 
+          ConvolveParams conv_params = get_conv_params(ref, ref, plane);
 #if CONFIG_EXT_INTER
+          if (is_masked_compound_type(mi->mbmi.interinter_compound_type)) {
+            // masked compound type has its own average mechanism
+            conv_params = get_conv_params(ref, 0, plane);
+          }
           if (ref && is_masked_compound_type(mi->mbmi.interinter_compound_type))
             av1_make_masked_inter_predictor(
                 pre, pre_buf->stride, dst, dst_buf->stride, subpel_x, subpel_y,
-                sf, w, h, mi->mbmi.interp_filter, xs, ys,
+                sf, w, h, &conv_params, mi->mbmi.interp_filter, xs, ys,
 #if CONFIG_SUPERTX
                 wedge_offset_x, wedge_offset_y,
 #endif  // CONFIG_SUPERTX
@@ -1242,14 +1242,16 @@
       conv_params.ref = ref;
       conv_params.do_average = ref;
 #if CONFIG_EXT_INTER
-      if (is_masked_compound_type(mi->mbmi.interinter_compound_type))
-        conv_params = get_conv_params(ref, ref, plane);
+      if (is_masked_compound_type(mi->mbmi.interinter_compound_type)) {
+        // masked compound type has its own average mechanism
+        conv_params = get_conv_params(ref, 0, plane);
+      }
 
       if (ref && is_masked_compound_type(mi->mbmi.interinter_compound_type))
         av1_make_masked_inter_predictor(
             pre[ref], pre_buf->stride, dst, dst_buf->stride,
             subpel_params[ref].subpel_x, subpel_params[ref].subpel_y, sf, w, h,
-            mi->mbmi.interp_filter, subpel_params[ref].xs,
+            &conv_params, mi->mbmi.interp_filter, subpel_params[ref].xs,
             subpel_params[ref].ys,
 #if CONFIG_SUPERTX
             wedge_offset_x, wedge_offset_y,
diff --git a/av1/common/reconinter.h b/av1/common/reconinter.h
index 9ad6d37..2296460 100644
--- a/av1/common/reconinter.h
+++ b/av1/common/reconinter.h
@@ -490,7 +490,7 @@
                                      uint8_t *dst, int dst_stride,
                                      const int subpel_x, const int subpel_y,
                                      const struct scale_factors *sf, int w,
-                                     int h,
+                                     int h, ConvolveParams *conv_params,
 #if CONFIG_DUAL_FILTER
                                      const InterpFilter *interp_filter,
 #else