summaryrefslogtreecommitdiffstats
path: root/third_party/aom/test/reconinter_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/test/reconinter_test.cc')
-rw-r--r--third_party/aom/test/reconinter_test.cc40
1 files changed, 29 insertions, 11 deletions
diff --git a/third_party/aom/test/reconinter_test.cc b/third_party/aom/test/reconinter_test.cc
index 4f74c817e..9b849404c 100644
--- a/third_party/aom/test/reconinter_test.cc
+++ b/third_party/aom/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 @@ void BuildCompDiffwtdMaskD16Test::RunSpeedTest(
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 @@ void BuildCompDiffwtdMaskTest::RunTest(const int sb_type, const int is_speed,
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 @@ void BuildCompDiffwtdMaskTest::RunTest(const int sb_type, const int is_speed,
}
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 @@ TEST_P(BuildCompDiffwtdMaskD16Test, DISABLED_Speed) {
#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,