Update unit test of compound_diffwtd_mask

Change-Id: Ifb235b271f186d0972ef92b2a0f1df3c790b71b4
diff --git a/test/reconinter_test.cc b/test/reconinter_test.cc
index 4f74c81..9b84940 100644
--- a/test/reconinter_test.cc
+++ b/test/reconinter_test.cc
@@ -28,12 +28,30 @@
 namespace {
 using libaom_test::ACMRandom;
 
-class BuildCompDiffwtdMaskTest : public ::testing::TestWithParam<int> {
+typedef void (*buildcompdiffwtdmaskd_func)(uint8_t *mask,
+                                           DIFFWTD_MASK_TYPE mask_type,
+                                           const uint8_t *src0, int src0_stride,
+                                           const uint8_t *src1, int src1_stride,
+                                           int h, int w);
+
+typedef ::testing::tuple<BLOCK_SIZE, buildcompdiffwtdmaskd_func>
+    BuildCompDiffwtdMaskDParam;
+
+#if HAVE_SSE4_1
+::testing::internal::ParamGenerator<BuildCompDiffwtdMaskDParam> BuildParams(
+    buildcompdiffwtdmaskd_func filter) {
+  return ::testing::Combine(::testing::Range(BLOCK_4X4, BLOCK_SIZES_ALL),
+                            ::testing::Values(filter));
+}
+#endif
+
+class BuildCompDiffwtdMaskTest
+    : public ::testing::TestWithParam<BuildCompDiffwtdMaskDParam> {
  public:
   virtual ~BuildCompDiffwtdMaskTest() {}
 
   virtual void TearDown() { libaom_test::ClearSystemState(); }
-  void RunTest(const int sb_type, const int is_speed,
+  void RunTest(buildcompdiffwtdmaskd_func test_impl, const int is_speed,
                const DIFFWTD_MASK_TYPE type);
 
  private:
@@ -159,8 +177,10 @@
          width, height, 1000.0 * elapsed_time1 / num_loops);
 }
 #if HAVE_SSE4_1
-void BuildCompDiffwtdMaskTest::RunTest(const int sb_type, const int is_speed,
+void BuildCompDiffwtdMaskTest::RunTest(buildcompdiffwtdmaskd_func test_impl,
+                                       const int is_speed,
                                        const DIFFWTD_MASK_TYPE type) {
+  const int sb_type = GET_PARAM(0);
   const int width = block_size_wide[sb_type];
   const int height = block_size_high[sb_type];
   DECLARE_ALIGNED(16, uint8_t, mask_ref[MAX_SB_SQUARE]);
@@ -182,8 +202,7 @@
   const double t1 = get_time_mark(&timer);
   aom_usec_timer_start(&timer);
   for (int i = 0; i < run_times; ++i) {
-    av1_build_compound_diffwtd_mask_sse4_1(mask_test, type, src0, width, src1,
-                                           width, height, width);
+    test_impl(mask_test, type, src0, width, src1, width, height, width);
   }
   const double t2 = get_time_mark(&timer);
   if (is_speed) {
@@ -200,12 +219,12 @@
 }
 
 TEST_P(BuildCompDiffwtdMaskTest, match) {
-  RunTest(GetParam(), 0, DIFFWTD_38);
-  RunTest(GetParam(), 0, DIFFWTD_38_INV);
+  RunTest(GET_PARAM(1), 0, DIFFWTD_38);
+  RunTest(GET_PARAM(1), 0, DIFFWTD_38_INV);
 }
 TEST_P(BuildCompDiffwtdMaskTest, DISABLED_Speed) {
-  RunTest(GetParam(), 1, DIFFWTD_38);
-  RunTest(GetParam(), 1, DIFFWTD_38_INV);
+  RunTest(GET_PARAM(1), 1, DIFFWTD_38);
+  RunTest(GET_PARAM(1), 1, DIFFWTD_38_INV);
 }
 #endif
 TEST_P(BuildCompDiffwtdMaskD16Test, CheckOutput) {
@@ -218,8 +237,7 @@
 
 #if HAVE_SSE4_1
 INSTANTIATE_TEST_CASE_P(SSE4_1, BuildCompDiffwtdMaskTest,
-                        ::testing::Range(0, static_cast<int>(BLOCK_SIZES_ALL),
-                                         1));
+                        BuildParams(av1_build_compound_diffwtd_mask_sse4_1));
 
 INSTANTIATE_TEST_CASE_P(
     SSE4_1, BuildCompDiffwtdMaskD16Test,