ref: 2f97b7cbfe0f4cdc26991e506c6bea02e5c3ab60
parent: b2ccb9c189069d45d201c988184e9e0796b96270
author: Alex Converse <[email protected]>
date: Wed Apr 27 12:53:33 EDT 2016
Port convolve test refactor to master. Brings f03e238f to master. Change-Id: I7f7754e7d1288b103a4510303d10afc68a7d8ca8
--- a/test/convolve_test.cc
+++ b/test/convolve_test.cc
@@ -69,6 +69,21 @@
typedef std::tr1::tuple<int, int, const ConvolveFunctions *> ConvolveParam;
+#define ALL_SIZES(convolve_fn) \
+ make_tuple(4, 4, &convolve_fn), \
+ make_tuple(8, 4, &convolve_fn), \
+ make_tuple(4, 8, &convolve_fn), \
+ make_tuple(8, 8, &convolve_fn), \
+ make_tuple(16, 8, &convolve_fn), \
+ make_tuple(8, 16, &convolve_fn), \
+ make_tuple(16, 16, &convolve_fn), \
+ make_tuple(32, 16, &convolve_fn), \
+ make_tuple(16, 32, &convolve_fn), \
+ make_tuple(32, 32, &convolve_fn), \
+ make_tuple(64, 32, &convolve_fn), \
+ make_tuple(32, 64, &convolve_fn), \
+ make_tuple(64, 64, &convolve_fn)
+
// Reference 8-tap subpixel filter, slightly modified to fit into this test.
#define VP9_FILTER_WEIGHT 128
#define VP9_FILTER_SHIFT 7
@@ -1034,20 +1049,6 @@
wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8,
wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8,
wrap_convolve8_c_8, wrap_convolve8_avg_c_8, 8);
-INSTANTIATE_TEST_CASE_P(C_8, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve8_c),
- make_tuple(8, 4, &convolve8_c),
- make_tuple(4, 8, &convolve8_c),
- make_tuple(8, 8, &convolve8_c),
- make_tuple(16, 8, &convolve8_c),
- make_tuple(8, 16, &convolve8_c),
- make_tuple(16, 16, &convolve8_c),
- make_tuple(32, 16, &convolve8_c),
- make_tuple(16, 32, &convolve8_c),
- make_tuple(32, 32, &convolve8_c),
- make_tuple(64, 32, &convolve8_c),
- make_tuple(32, 64, &convolve8_c),
- make_tuple(64, 64, &convolve8_c)));
const ConvolveFunctions convolve10_c(
wrap_convolve_copy_c_10, wrap_convolve_avg_c_10,
wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10,
@@ -1056,20 +1057,6 @@
wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10,
wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10,
wrap_convolve8_c_10, wrap_convolve8_avg_c_10, 10);
-INSTANTIATE_TEST_CASE_P(C_10, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve10_c),
- make_tuple(8, 4, &convolve10_c),
- make_tuple(4, 8, &convolve10_c),
- make_tuple(8, 8, &convolve10_c),
- make_tuple(16, 8, &convolve10_c),
- make_tuple(8, 16, &convolve10_c),
- make_tuple(16, 16, &convolve10_c),
- make_tuple(32, 16, &convolve10_c),
- make_tuple(16, 32, &convolve10_c),
- make_tuple(32, 32, &convolve10_c),
- make_tuple(64, 32, &convolve10_c),
- make_tuple(32, 64, &convolve10_c),
- make_tuple(64, 64, &convolve10_c)));
const ConvolveFunctions convolve12_c(
wrap_convolve_copy_c_12, wrap_convolve_avg_c_12,
wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
@@ -1078,23 +1065,13 @@
wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12,
wrap_convolve8_c_12, wrap_convolve8_avg_c_12, 12);
-INSTANTIATE_TEST_CASE_P(C_12, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve12_c),
- make_tuple(8, 4, &convolve12_c),
- make_tuple(4, 8, &convolve12_c),
- make_tuple(8, 8, &convolve12_c),
- make_tuple(16, 8, &convolve12_c),
- make_tuple(8, 16, &convolve12_c),
- make_tuple(16, 16, &convolve12_c),
- make_tuple(32, 16, &convolve12_c),
- make_tuple(16, 32, &convolve12_c),
- make_tuple(32, 32, &convolve12_c),
- make_tuple(64, 32, &convolve12_c),
- make_tuple(32, 64, &convolve12_c),
- make_tuple(64, 64, &convolve12_c)));
+const ConvolveParam kArrayConvolve_c[] = {
+ ALL_SIZES(convolve8_c),
+ ALL_SIZES(convolve10_c),
+ ALL_SIZES(convolve12_c)
+};
#else
-
const ConvolveFunctions convolve8_c(
vpx_convolve_copy_c, vpx_convolve_avg_c,
vpx_convolve8_horiz_c, vpx_convolve8_avg_horiz_c,
@@ -1103,22 +1080,10 @@
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
-
-INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve8_c),
- make_tuple(8, 4, &convolve8_c),
- make_tuple(4, 8, &convolve8_c),
- make_tuple(8, 8, &convolve8_c),
- make_tuple(16, 8, &convolve8_c),
- make_tuple(8, 16, &convolve8_c),
- make_tuple(16, 16, &convolve8_c),
- make_tuple(32, 16, &convolve8_c),
- make_tuple(16, 32, &convolve8_c),
- make_tuple(32, 32, &convolve8_c),
- make_tuple(64, 32, &convolve8_c),
- make_tuple(32, 64, &convolve8_c),
- make_tuple(64, 64, &convolve8_c)));
+const ConvolveParam kArrayConvolve_c[] = { ALL_SIZES(convolve8_c) };
#endif
+INSTANTIATE_TEST_CASE_P(C, ConvolveTest,
+ ::testing::ValuesIn(kArrayConvolve_c));
#if HAVE_SSE2 && ARCH_X86_64
#if CONFIG_VP9_HIGHBITDEPTH
@@ -1158,46 +1123,11 @@
wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12,
wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12,
wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12, 12);
-INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve8_sse2),
- make_tuple(8, 4, &convolve8_sse2),
- make_tuple(4, 8, &convolve8_sse2),
- make_tuple(8, 8, &convolve8_sse2),
- make_tuple(16, 8, &convolve8_sse2),
- make_tuple(8, 16, &convolve8_sse2),
- make_tuple(16, 16, &convolve8_sse2),
- make_tuple(32, 16, &convolve8_sse2),
- make_tuple(16, 32, &convolve8_sse2),
- make_tuple(32, 32, &convolve8_sse2),
- make_tuple(64, 32, &convolve8_sse2),
- make_tuple(32, 64, &convolve8_sse2),
- make_tuple(64, 64, &convolve8_sse2),
- make_tuple(4, 4, &convolve10_sse2),
- make_tuple(8, 4, &convolve10_sse2),
- make_tuple(4, 8, &convolve10_sse2),
- make_tuple(8, 8, &convolve10_sse2),
- make_tuple(16, 8, &convolve10_sse2),
- make_tuple(8, 16, &convolve10_sse2),
- make_tuple(16, 16, &convolve10_sse2),
- make_tuple(32, 16, &convolve10_sse2),
- make_tuple(16, 32, &convolve10_sse2),
- make_tuple(32, 32, &convolve10_sse2),
- make_tuple(64, 32, &convolve10_sse2),
- make_tuple(32, 64, &convolve10_sse2),
- make_tuple(64, 64, &convolve10_sse2),
- make_tuple(4, 4, &convolve12_sse2),
- make_tuple(8, 4, &convolve12_sse2),
- make_tuple(4, 8, &convolve12_sse2),
- make_tuple(8, 8, &convolve12_sse2),
- make_tuple(16, 8, &convolve12_sse2),
- make_tuple(8, 16, &convolve12_sse2),
- make_tuple(16, 16, &convolve12_sse2),
- make_tuple(32, 16, &convolve12_sse2),
- make_tuple(16, 32, &convolve12_sse2),
- make_tuple(32, 32, &convolve12_sse2),
- make_tuple(64, 32, &convolve12_sse2),
- make_tuple(32, 64, &convolve12_sse2),
- make_tuple(64, 64, &convolve12_sse2)));
+const ConvolveParam kArrayConvolve_sse2[] = {
+ ALL_SIZES(convolve8_sse2),
+ ALL_SIZES(convolve10_sse2),
+ ALL_SIZES(convolve12_sse2)
+};
#else
const ConvolveFunctions convolve8_sse2(
#if CONFIG_USE_X86INC
@@ -1212,21 +1142,10 @@
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
-INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve8_sse2),
- make_tuple(8, 4, &convolve8_sse2),
- make_tuple(4, 8, &convolve8_sse2),
- make_tuple(8, 8, &convolve8_sse2),
- make_tuple(16, 8, &convolve8_sse2),
- make_tuple(8, 16, &convolve8_sse2),
- make_tuple(16, 16, &convolve8_sse2),
- make_tuple(32, 16, &convolve8_sse2),
- make_tuple(16, 32, &convolve8_sse2),
- make_tuple(32, 32, &convolve8_sse2),
- make_tuple(64, 32, &convolve8_sse2),
- make_tuple(32, 64, &convolve8_sse2),
- make_tuple(64, 64, &convolve8_sse2)));
+const ConvolveParam kArrayConvolve_sse2[] = { ALL_SIZES(convolve8_sse2) };
#endif // CONFIG_VP9_HIGHBITDEPTH
+INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest,
+ ::testing::ValuesIn(kArrayConvolve_sse2));
#endif
#if HAVE_SSSE3
@@ -1237,22 +1156,11 @@
vpx_convolve8_ssse3, vpx_convolve8_avg_ssse3,
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
- vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
+ vpx_scaled_2d_ssse3, vpx_scaled_avg_2d_c, 0);
-INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve8_ssse3),
- make_tuple(8, 4, &convolve8_ssse3),
- make_tuple(4, 8, &convolve8_ssse3),
- make_tuple(8, 8, &convolve8_ssse3),
- make_tuple(16, 8, &convolve8_ssse3),
- make_tuple(8, 16, &convolve8_ssse3),
- make_tuple(16, 16, &convolve8_ssse3),
- make_tuple(32, 16, &convolve8_ssse3),
- make_tuple(16, 32, &convolve8_ssse3),
- make_tuple(32, 32, &convolve8_ssse3),
- make_tuple(64, 32, &convolve8_ssse3),
- make_tuple(32, 64, &convolve8_ssse3),
- make_tuple(64, 64, &convolve8_ssse3)));
+const ConvolveParam kArrayConvolve8_ssse3[] = { ALL_SIZES(convolve8_ssse3) };
+INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest,
+ ::testing::ValuesIn(kArrayConvolve8_ssse3));
#endif
#if HAVE_AVX2 && HAVE_SSSE3
@@ -1265,20 +1173,9 @@
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
-INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve8_avx2),
- make_tuple(8, 4, &convolve8_avx2),
- make_tuple(4, 8, &convolve8_avx2),
- make_tuple(8, 8, &convolve8_avx2),
- make_tuple(8, 16, &convolve8_avx2),
- make_tuple(16, 8, &convolve8_avx2),
- make_tuple(16, 16, &convolve8_avx2),
- make_tuple(32, 16, &convolve8_avx2),
- make_tuple(16, 32, &convolve8_avx2),
- make_tuple(32, 32, &convolve8_avx2),
- make_tuple(64, 32, &convolve8_avx2),
- make_tuple(32, 64, &convolve8_avx2),
- make_tuple(64, 64, &convolve8_avx2)));
+const ConvolveParam kArrayConvolve8_avx2[] = { ALL_SIZES(convolve8_avx2) };
+INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest,
+ ::testing::ValuesIn(kArrayConvolve8_avx2));
#endif // HAVE_AVX2 && HAVE_SSSE3
#if HAVE_NEON
@@ -1302,20 +1199,9 @@
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
#endif // HAVE_NEON_ASM
-INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve8_neon),
- make_tuple(8, 4, &convolve8_neon),
- make_tuple(4, 8, &convolve8_neon),
- make_tuple(8, 8, &convolve8_neon),
- make_tuple(16, 8, &convolve8_neon),
- make_tuple(8, 16, &convolve8_neon),
- make_tuple(16, 16, &convolve8_neon),
- make_tuple(32, 16, &convolve8_neon),
- make_tuple(16, 32, &convolve8_neon),
- make_tuple(32, 32, &convolve8_neon),
- make_tuple(64, 32, &convolve8_neon),
- make_tuple(32, 64, &convolve8_neon),
- make_tuple(64, 64, &convolve8_neon)));
+const ConvolveParam kArrayConvolve8_neon[] = { ALL_SIZES(convolve8_neon) };
+INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest,
+ ::testing::ValuesIn(kArrayConvolve8_neon));
#endif // HAVE_NEON
#if HAVE_DSPR2
@@ -1328,22 +1214,11 @@
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
-INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve8_dspr2),
- make_tuple(8, 4, &convolve8_dspr2),
- make_tuple(4, 8, &convolve8_dspr2),
- make_tuple(8, 8, &convolve8_dspr2),
- make_tuple(16, 8, &convolve8_dspr2),
- make_tuple(8, 16, &convolve8_dspr2),
- make_tuple(16, 16, &convolve8_dspr2),
- make_tuple(32, 16, &convolve8_dspr2),
- make_tuple(16, 32, &convolve8_dspr2),
- make_tuple(32, 32, &convolve8_dspr2),
- make_tuple(64, 32, &convolve8_dspr2),
- make_tuple(32, 64, &convolve8_dspr2),
- make_tuple(64, 64, &convolve8_dspr2)));
-#endif
-
+const ConvolveParam kArrayConvolve8_dspr2[] = { ALL_SIZES(convolve8_dspr2) };
+INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest,
+ ::testing::ValuesIn(kArrayConvolve8_dspr2));
+#endif // HAVE_DSPR2
+
#if HAVE_MSA
const ConvolveFunctions convolve8_msa(
vpx_convolve_copy_msa, vpx_convolve_avg_msa,
@@ -1354,19 +1229,8 @@
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
-INSTANTIATE_TEST_CASE_P(MSA, ConvolveTest, ::testing::Values(
- make_tuple(4, 4, &convolve8_msa),
- make_tuple(8, 4, &convolve8_msa),
- make_tuple(4, 8, &convolve8_msa),
- make_tuple(8, 8, &convolve8_msa),
- make_tuple(16, 8, &convolve8_msa),
- make_tuple(8, 16, &convolve8_msa),
- make_tuple(16, 16, &convolve8_msa),
- make_tuple(32, 16, &convolve8_msa),
- make_tuple(16, 32, &convolve8_msa),
- make_tuple(32, 32, &convolve8_msa),
- make_tuple(64, 32, &convolve8_msa),
- make_tuple(32, 64, &convolve8_msa),
- make_tuple(64, 64, &convolve8_msa)));
+const ConvolveParam kArrayConvolve8_msa[] = { ALL_SIZES(convolve8_msa) };
+INSTANTIATE_TEST_CASE_P(MSA, ConvolveTest,
+ ::testing::ValuesIn(kArrayConvolve8_msa));
#endif // HAVE_MSA
} // namespace