diff options
Diffstat (limited to 'third_party/aom/test/reconinter_test.cc')
-rw-r--r-- | third_party/aom/test/reconinter_test.cc | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/third_party/aom/test/reconinter_test.cc b/third_party/aom/test/reconinter_test.cc index 9b849404c1..a8536e517c 100644 --- a/third_party/aom/test/reconinter_test.cc +++ b/third_party/aom/test/reconinter_test.cc @@ -83,7 +83,8 @@ class BuildCompDiffwtdMaskD16Test protected: void RunCheckOutput(buildcompdiffwtdmaskd16_func test_impl); - void RunSpeedTest(buildcompdiffwtdmaskd16_func test_impl); + void RunSpeedTest(buildcompdiffwtdmaskd16_func test_impl, + DIFFWTD_MASK_TYPE mask_type); libaom_test::ACMRandom rnd_; }; // class BuildCompDiffwtdMaskD16Test @@ -98,8 +99,7 @@ void BuildCompDiffwtdMaskD16Test::RunCheckOutput( DECLARE_ALIGNED(32, uint16_t, src0[MAX_SB_SQUARE]); DECLARE_ALIGNED(32, uint16_t, src1[MAX_SB_SQUARE]); - ConvolveParams conv_params = - get_conv_params_no_round(0, 0, 0, NULL, 0, 1, bd); + ConvolveParams conv_params = get_conv_params_no_round(0, 0, NULL, 0, 1, bd); int in_precision = bd + 2 * FILTER_BITS - conv_params.round_0 - conv_params.round_1 + 2; @@ -130,7 +130,7 @@ void BuildCompDiffwtdMaskD16Test::RunCheckOutput( } void BuildCompDiffwtdMaskD16Test::RunSpeedTest( - buildcompdiffwtdmaskd16_func test_impl) { + buildcompdiffwtdmaskd16_func test_impl, DIFFWTD_MASK_TYPE mask_type) { const int block_idx = GET_PARAM(2); const int bd = GET_PARAM(0); const int width = block_size_wide[block_idx]; @@ -139,8 +139,7 @@ void BuildCompDiffwtdMaskD16Test::RunSpeedTest( DECLARE_ALIGNED(32, uint16_t, src0[MAX_SB_SQUARE]); DECLARE_ALIGNED(32, uint16_t, src1[MAX_SB_SQUARE]); - ConvolveParams conv_params = - get_conv_params_no_round(0, 0, 0, NULL, 0, 1, bd); + ConvolveParams conv_params = get_conv_params_no_round(0, 0, NULL, 0, 1, bd); int in_precision = bd + 2 * FILTER_BITS - conv_params.round_0 - conv_params.round_1 + 2; @@ -150,31 +149,29 @@ void BuildCompDiffwtdMaskD16Test::RunSpeedTest( src1[i] = rnd_.Rand16() & ((1 << in_precision) - 1); } - const int num_loops = 1000000000 / (width + height); + const int num_loops = 10000000 / (width + height); aom_usec_timer timer; aom_usec_timer_start(&timer); for (int i = 0; i < num_loops; ++i) - av1_build_compound_diffwtd_mask_d16_c(mask, DIFFWTD_38, src0, width, src1, + av1_build_compound_diffwtd_mask_d16_c(mask, mask_type, src0, width, src1, width, height, width, &conv_params, bd); aom_usec_timer_mark(&timer); const int elapsed_time = static_cast<int>(aom_usec_timer_elapsed(&timer)); - printf("av1_build_compound_diffwtd_mask_d16 c_code %3dx%-3d: %7.2f us\n", - width, height, 1000.0 * elapsed_time / num_loops); aom_usec_timer timer1; aom_usec_timer_start(&timer1); for (int i = 0; i < num_loops; ++i) - test_impl(mask, DIFFWTD_38, src0, width, src1, width, height, width, + test_impl(mask, mask_type, src0, width, src1, width, height, width, &conv_params, bd); aom_usec_timer_mark(&timer1); const int elapsed_time1 = static_cast<int>(aom_usec_timer_elapsed(&timer1)); - printf("av1_build_compound_diffwtd_mask_d16 test_code %3dx%-3d: %7.2f us\n", - width, height, 1000.0 * elapsed_time1 / num_loops); + printf("av1_build_compound_diffwtd_mask_d16 %3dx%-3d: %7.2f \n", width, + height, elapsed_time / double(elapsed_time1)); } #if HAVE_SSE4_1 void BuildCompDiffwtdMaskTest::RunTest(buildcompdiffwtdmaskd_func test_impl, @@ -232,7 +229,8 @@ TEST_P(BuildCompDiffwtdMaskD16Test, CheckOutput) { } TEST_P(BuildCompDiffwtdMaskD16Test, DISABLED_Speed) { - RunSpeedTest(GET_PARAM(1)); + RunSpeedTest(GET_PARAM(1), DIFFWTD_38); + RunSpeedTest(GET_PARAM(1), DIFFWTD_38_INV); } #if HAVE_SSE4_1 @@ -244,6 +242,14 @@ INSTANTIATE_TEST_CASE_P( BuildParams(av1_build_compound_diffwtd_mask_d16_sse4_1)); #endif +#if HAVE_AVX2 +INSTANTIATE_TEST_CASE_P(AVX2, BuildCompDiffwtdMaskTest, + BuildParams(av1_build_compound_diffwtd_mask_avx2)); + +INSTANTIATE_TEST_CASE_P(AVX2, BuildCompDiffwtdMaskD16Test, + BuildParams(av1_build_compound_diffwtd_mask_d16_avx2)); +#endif + #if HAVE_NEON INSTANTIATE_TEST_CASE_P(NEON, BuildCompDiffwtdMaskD16Test, BuildParams(av1_build_compound_diffwtd_mask_d16_neon)); |