summaryrefslogtreecommitdiff
path: root/media/libaom/src/test/cdef_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'media/libaom/src/test/cdef_test.cc')
-rw-r--r--media/libaom/src/test/cdef_test.cc93
1 files changed, 47 insertions, 46 deletions
diff --git a/media/libaom/src/test/cdef_test.cc b/media/libaom/src/test/cdef_test.cc
index becc072918..a2ec1e31e7 100644
--- a/media/libaom/src/test/cdef_test.cc
+++ b/media/libaom/src/test/cdef_test.cc
@@ -11,6 +11,7 @@
#include <cstdlib>
#include <string>
+#include <tuple>
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
@@ -28,8 +29,8 @@ using libaom_test::ACMRandom;
namespace {
-typedef ::testing::tuple<cdef_filter_block_func, cdef_filter_block_func,
- BLOCK_SIZE, int, int>
+typedef std::tuple<cdef_filter_block_func, cdef_filter_block_func, BLOCK_SIZE,
+ int, int>
cdef_dir_param_t;
class CDEFBlockTest : public ::testing::TestWithParam<cdef_dir_param_t> {
@@ -116,7 +117,7 @@ void test_cdef(int bsize, int iterations, cdef_filter_block_func cdef,
ref_cdef(depth == 8 ? (uint8_t *)ref_d : 0, ref_d, size,
s + CDEF_HBORDER + CDEF_VBORDER * CDEF_BSTRIDE,
pristrength, secstrength, dir, pridamping,
- secdamping, bsize, (1 << depth) - 1, depth - 8);
+ secdamping, bsize, depth - 8);
// If cdef and ref_cdef are the same, we're just testing
// speed
if (cdef != ref_cdef)
@@ -124,7 +125,7 @@ void test_cdef(int bsize, int iterations, cdef_filter_block_func cdef,
cdef(depth == 8 ? (uint8_t *)d : 0, d, size,
s + CDEF_HBORDER + CDEF_VBORDER * CDEF_BSTRIDE,
pristrength, secstrength, dir, pridamping,
- secdamping, bsize, (1 << depth) - 1, depth - 8));
+ secdamping, bsize, depth - 8));
if (ref_cdef != cdef) {
for (pos = 0; pos < max_pos && !error; pos++) {
error = ref_d[pos] != d[pos];
@@ -185,7 +186,7 @@ void test_cdef_speed(int bsize, int iterations, cdef_filter_block_func cdef,
typedef int (*find_dir_t)(const uint16_t *img, int stride, int32_t *var,
int coeff_shift);
-typedef ::testing::tuple<find_dir_t, find_dir_t> find_dir_param_t;
+typedef std::tuple<find_dir_t, find_dir_t> find_dir_param_t;
class CDEFFindDirTest : public ::testing::TestWithParam<find_dir_param_t> {
public:
@@ -285,140 +286,140 @@ TEST_P(CDEFFindDirSpeedTest, DISABLED_TestSpeed) {
test_finddir_speed(finddir, ref_finddir);
}
-using ::testing::make_tuple;
+using std::make_tuple;
// VS compiling for 32 bit targets does not support vector types in
// structs as arguments, which makes the v256 type of the intrinsics
// hard to support, so optimizations for this target are disabled.
#if defined(_WIN64) || !defined(_MSC_VER) || defined(__clang__)
#if HAVE_SSE2
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
SSE2, CDEFBlockTest,
::testing::Combine(::testing::Values(&cdef_filter_block_sse2),
::testing::Values(&cdef_filter_block_c),
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8),
::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
-INSTANTIATE_TEST_CASE_P(SSE2, CDEFFindDirTest,
- ::testing::Values(make_tuple(&cdef_find_dir_sse2,
- &cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(SSE2, CDEFFindDirTest,
+ ::testing::Values(make_tuple(&cdef_find_dir_sse2,
+ &cdef_find_dir_c)));
#endif
#if HAVE_SSSE3
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
SSSE3, CDEFBlockTest,
::testing::Combine(::testing::Values(&cdef_filter_block_ssse3),
::testing::Values(&cdef_filter_block_c),
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8),
::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
-INSTANTIATE_TEST_CASE_P(SSSE3, CDEFFindDirTest,
- ::testing::Values(make_tuple(&cdef_find_dir_ssse3,
- &cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(SSSE3, CDEFFindDirTest,
+ ::testing::Values(make_tuple(&cdef_find_dir_ssse3,
+ &cdef_find_dir_c)));
#endif
#if HAVE_SSE4_1
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
SSE4_1, CDEFBlockTest,
::testing::Combine(::testing::Values(&cdef_filter_block_sse4_1),
::testing::Values(&cdef_filter_block_c),
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8),
::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
-INSTANTIATE_TEST_CASE_P(SSE4_1, CDEFFindDirTest,
- ::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
- &cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(SSE4_1, CDEFFindDirTest,
+ ::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
+ &cdef_find_dir_c)));
#endif
#if HAVE_AVX2
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
AVX2, CDEFBlockTest,
::testing::Combine(::testing::Values(&cdef_filter_block_avx2),
::testing::Values(&cdef_filter_block_c),
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8),
::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
-INSTANTIATE_TEST_CASE_P(AVX2, CDEFFindDirTest,
- ::testing::Values(make_tuple(&cdef_find_dir_avx2,
- &cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(AVX2, CDEFFindDirTest,
+ ::testing::Values(make_tuple(&cdef_find_dir_avx2,
+ &cdef_find_dir_c)));
#endif
#if HAVE_NEON
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
NEON, CDEFBlockTest,
::testing::Combine(::testing::Values(&cdef_filter_block_neon),
::testing::Values(&cdef_filter_block_c),
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8),
::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
-INSTANTIATE_TEST_CASE_P(NEON, CDEFFindDirTest,
- ::testing::Values(make_tuple(&cdef_find_dir_neon,
- &cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(NEON, CDEFFindDirTest,
+ ::testing::Values(make_tuple(&cdef_find_dir_neon,
+ &cdef_find_dir_c)));
#endif
// Test speed for all supported architectures
#if HAVE_SSE2
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
SSE2, CDEFSpeedTest,
::testing::Combine(::testing::Values(&cdef_filter_block_sse2),
::testing::Values(&cdef_filter_block_c),
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8),
::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
-INSTANTIATE_TEST_CASE_P(SSE2, CDEFFindDirSpeedTest,
- ::testing::Values(make_tuple(&cdef_find_dir_sse2,
- &cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(SSE2, CDEFFindDirSpeedTest,
+ ::testing::Values(make_tuple(&cdef_find_dir_sse2,
+ &cdef_find_dir_c)));
#endif
#if HAVE_SSSE3
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
SSSE3, CDEFSpeedTest,
::testing::Combine(::testing::Values(&cdef_filter_block_ssse3),
::testing::Values(&cdef_filter_block_c),
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8),
::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
-INSTANTIATE_TEST_CASE_P(SSSE3, CDEFFindDirSpeedTest,
- ::testing::Values(make_tuple(&cdef_find_dir_ssse3,
- &cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(SSSE3, CDEFFindDirSpeedTest,
+ ::testing::Values(make_tuple(&cdef_find_dir_ssse3,
+ &cdef_find_dir_c)));
#endif
#if HAVE_SSE4_1
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
SSE4_1, CDEFSpeedTest,
::testing::Combine(::testing::Values(&cdef_filter_block_sse4_1),
::testing::Values(&cdef_filter_block_c),
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8),
::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
-INSTANTIATE_TEST_CASE_P(SSE4_1, CDEFFindDirSpeedTest,
- ::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
- &cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(SSE4_1, CDEFFindDirSpeedTest,
+ ::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
+ &cdef_find_dir_c)));
#endif
#if HAVE_AVX2
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
AVX2, CDEFSpeedTest,
::testing::Combine(::testing::Values(&cdef_filter_block_avx2),
::testing::Values(&cdef_filter_block_c),
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8),
::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
-INSTANTIATE_TEST_CASE_P(AVX2, CDEFFindDirSpeedTest,
- ::testing::Values(make_tuple(&cdef_find_dir_avx2,
- &cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(AVX2, CDEFFindDirSpeedTest,
+ ::testing::Values(make_tuple(&cdef_find_dir_avx2,
+ &cdef_find_dir_c)));
#endif
#if HAVE_NEON
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
NEON, CDEFSpeedTest,
::testing::Combine(::testing::Values(&cdef_filter_block_neon),
::testing::Values(&cdef_filter_block_c),
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8),
::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
-INSTANTIATE_TEST_CASE_P(NEON, CDEFFindDirSpeedTest,
- ::testing::Values(make_tuple(&cdef_find_dir_neon,
- &cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(NEON, CDEFFindDirSpeedTest,
+ ::testing::Values(make_tuple(&cdef_find_dir_neon,
+ &cdef_find_dir_c)));
#endif
#endif // defined(_WIN64) || !defined(_MSC_VER)