blob: f38459aff4eb92cfb4ebd77c31ee6a8e7ab747d4 [file] [log] [blame]
Steinar Midtskogen59782122017-07-20 08:49:43 +02001/*
Krishna Rapaka7319db52021-09-28 20:35:29 -07002 * Copyright (c) 2021, Alliance for Open Media. All rights reserved
Steinar Midtskogen59782122017-07-20 08:49:43 +02003 *
Vibhoothi41c6dd72021-10-12 18:48:26 +00004 * This source code is subject to the terms of the BSD 3-Clause Clear License
5 * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear
6 * License was not distributed with this source code in the LICENSE file, you
7 * can obtain it at aomedia.org/license/software-license/bsd-3-c-c/. If the
8 * Alliance for Open Media Patent License 1.0 was not distributed with this
9 * source code in the PATENTS file, you can obtain it at
10 * aomedia.org/license/patent-license/.
Johann123e8a62017-12-28 14:40:49 -080011 */
Steinar Midtskogen59782122017-07-20 08:49:43 +020012
13#include <cstdlib>
14#include <string>
sarahparkera543df52018-11-02 16:02:05 -070015#include <tuple>
Steinar Midtskogen59782122017-07-20 08:49:43 +020016
17#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
18
Tom Finegan60e653d2018-05-22 11:34:58 -070019#include "config/aom_config.h"
Tom Finegan44702c82018-05-22 13:00:39 -070020#include "config/av1_rtcd.h"
Tom Finegan60e653d2018-05-22 11:34:58 -070021
Steinar Midtskogen59782122017-07-20 08:49:43 +020022#include "aom_ports/aom_timer.h"
23#include "av1/common/cdef_block.h"
24#include "test/acm_random.h"
25#include "test/clear_system_state.h"
26#include "test/register_state_check.h"
27#include "test/util.h"
28
29using libaom_test::ACMRandom;
30
31namespace {
32
sarahparkera543df52018-11-02 16:02:05 -070033typedef std::tuple<cdef_filter_block_func, cdef_filter_block_func, BLOCK_SIZE,
34 int, int>
Steinar Midtskogen59782122017-07-20 08:49:43 +020035 cdef_dir_param_t;
36
37class CDEFBlockTest : public ::testing::TestWithParam<cdef_dir_param_t> {
38 public:
39 virtual ~CDEFBlockTest() {}
40 virtual void SetUp() {
41 cdef = GET_PARAM(0);
42 ref_cdef = GET_PARAM(1);
43 bsize = GET_PARAM(2);
Sarah Parkerf65e5ba2018-03-14 18:33:52 -070044 boundary = GET_PARAM(3);
45 depth = GET_PARAM(4);
Steinar Midtskogen59782122017-07-20 08:49:43 +020046 }
47
48 virtual void TearDown() { libaom_test::ClearSystemState(); }
49
50 protected:
Wan-Teh Changac6bb262023-10-19 17:58:34 -070051 BLOCK_SIZE bsize;
Sarah Parkerf65e5ba2018-03-14 18:33:52 -070052 int boundary;
53 int depth;
Steinar Midtskogen59782122017-07-20 08:49:43 +020054 cdef_filter_block_func cdef;
55 cdef_filter_block_func ref_cdef;
56};
chiyotsai9dfac722020-07-07 17:43:02 -070057GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CDEFBlockTest);
Steinar Midtskogen59782122017-07-20 08:49:43 +020058
59typedef CDEFBlockTest CDEFSpeedTest;
chiyotsai9dfac722020-07-07 17:43:02 -070060GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CDEFSpeedTest);
Steinar Midtskogen59782122017-07-20 08:49:43 +020061
Wan-Teh Changac6bb262023-10-19 17:58:34 -070062void test_cdef(BLOCK_SIZE bsize, int iterations, cdef_filter_block_func cdef,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -070063 cdef_filter_block_func ref_cdef, int boundary, int depth) {
Steinar Midtskogen59782122017-07-20 08:49:43 +020064 const int size = 8;
65 const int ysize = size + 2 * CDEF_VBORDER;
66 ACMRandom rnd(ACMRandom::DeterministicSeed());
67 DECLARE_ALIGNED(16, uint16_t, s[ysize * CDEF_BSTRIDE]);
68 DECLARE_ALIGNED(16, static uint16_t, d[size * size]);
69 DECLARE_ALIGNED(16, static uint16_t, ref_d[size * size]);
70 memset(ref_d, 0, sizeof(ref_d));
71 memset(d, 0, sizeof(d));
72
73 int error = 0, pristrength = 0, secstrength, dir;
Sarah Parkerf65e5ba2018-03-14 18:33:52 -070074 int pridamping, secdamping, bits, level, count,
Steinar Midtskogen59782122017-07-20 08:49:43 +020075 errdepth = 0, errpristrength = 0, errsecstrength = 0, errboundary = 0,
76 errpridamping = 0, errsecdamping = 0;
77 unsigned int pos = 0;
78
Sarah Parkerf65e5ba2018-03-14 18:33:52 -070079 const unsigned int max_pos = size * size >> static_cast<int>(depth == 8);
80 for (pridamping = 3 + depth - 8; pridamping < 7 - 3 * !!boundary + depth - 8;
81 pridamping++) {
82 for (secdamping = 3 + depth - 8;
83 secdamping < 7 - 3 * !!boundary + depth - 8; secdamping++) {
84 for (count = 0; count < iterations; count++) {
85 for (level = 0; level < (1 << depth) && !error;
86 level += (2 + 6 * !!boundary) << (depth - 8)) {
87 for (bits = 1; bits <= depth && !error; bits += 1 + 3 * !!boundary) {
88 for (unsigned int i = 0; i < sizeof(s) / sizeof(*s); i++)
89 s[i] = clamp((rnd.Rand16() & ((1 << bits) - 1)) + level, 0,
90 (1 << depth) - 1);
91 if (boundary) {
92 if (boundary & 1) { // Left
93 for (int i = 0; i < ysize; i++)
94 for (int j = 0; j < CDEF_HBORDER; j++)
95 s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
96 }
97 if (boundary & 2) { // Right
98 for (int i = 0; i < ysize; i++)
99 for (int j = CDEF_HBORDER + size; j < CDEF_BSTRIDE; j++)
100 s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
101 }
102 if (boundary & 4) { // Above
103 for (int i = 0; i < CDEF_VBORDER; i++)
104 for (int j = 0; j < CDEF_BSTRIDE; j++)
105 s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
106 }
107 if (boundary & 8) { // Below
108 for (int i = CDEF_VBORDER + size; i < ysize; i++)
109 for (int j = 0; j < CDEF_BSTRIDE; j++)
110 s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
111 }
112 }
113 for (dir = 0; dir < 8; dir++) {
114 for (pristrength = 0; pristrength <= 19 << (depth - 8) && !error;
115 pristrength += (1 + 4 * !!boundary) << (depth - 8)) {
116 if (pristrength == 16) pristrength = 19;
117 for (secstrength = 0; secstrength <= 4 << (depth - 8) && !error;
118 secstrength += 1 << (depth - 8)) {
119 if (secstrength == 3 << (depth - 8)) continue;
120 ref_cdef(depth == 8 ? (uint8_t *)ref_d : 0, ref_d, size,
121 s + CDEF_HBORDER + CDEF_VBORDER * CDEF_BSTRIDE,
122 pristrength, secstrength, dir, pridamping,
Johann83607dc2018-11-02 11:50:31 -0700123 secdamping, bsize, depth - 8);
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700124 // If cdef and ref_cdef are the same, we're just testing
125 // speed
126 if (cdef != ref_cdef)
127 ASM_REGISTER_STATE_CHECK(
128 cdef(depth == 8 ? (uint8_t *)d : 0, d, size,
129 s + CDEF_HBORDER + CDEF_VBORDER * CDEF_BSTRIDE,
130 pristrength, secstrength, dir, pridamping,
Johann83607dc2018-11-02 11:50:31 -0700131 secdamping, bsize, depth - 8));
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700132 if (ref_cdef != cdef) {
133 for (pos = 0; pos < max_pos && !error; pos++) {
134 error = ref_d[pos] != d[pos];
135 errdepth = depth;
136 errpristrength = pristrength;
137 errsecstrength = secstrength;
138 errboundary = boundary;
139 errpridamping = pridamping;
140 errsecdamping = secdamping;
Steinar Midtskogen59782122017-07-20 08:49:43 +0200141 }
142 }
143 }
144 }
145 }
146 }
147 }
148 }
149 }
150 }
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700151
Steinar Midtskogen59782122017-07-20 08:49:43 +0200152 pos--;
153 EXPECT_EQ(0, error) << "Error: CDEFBlockTest, SIMD and C mismatch."
154 << std::endl
155 << "First error at " << pos % size << "," << pos / size
156 << " (" << (int16_t)ref_d[pos] << " : " << (int16_t)d[pos]
157 << ") " << std::endl
158 << "pristrength: " << errpristrength << std::endl
159 << "pridamping: " << errpridamping << std::endl
160 << "secstrength: " << errsecstrength << std::endl
161 << "secdamping: " << errsecdamping << std::endl
162 << "depth: " << errdepth << std::endl
163 << "size: " << bsize << std::endl
164 << "boundary: " << errboundary << std::endl
165 << std::endl;
166}
167
Wan-Teh Changac6bb262023-10-19 17:58:34 -0700168void test_cdef_speed(BLOCK_SIZE bsize, int iterations,
169 cdef_filter_block_func cdef,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700170 cdef_filter_block_func ref_cdef, int boundary, int depth) {
Steinar Midtskogen59782122017-07-20 08:49:43 +0200171 aom_usec_timer ref_timer;
172 aom_usec_timer timer;
173
174 aom_usec_timer_start(&ref_timer);
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700175 test_cdef(bsize, iterations, ref_cdef, ref_cdef, boundary, depth);
Steinar Midtskogen59782122017-07-20 08:49:43 +0200176 aom_usec_timer_mark(&ref_timer);
177 int ref_elapsed_time = (int)aom_usec_timer_elapsed(&ref_timer);
178
179 aom_usec_timer_start(&timer);
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700180 test_cdef(bsize, iterations, cdef, cdef, boundary, depth);
Steinar Midtskogen59782122017-07-20 08:49:43 +0200181 aom_usec_timer_mark(&timer);
182 int elapsed_time = (int)aom_usec_timer_elapsed(&timer);
183
Steinar Midtskogen59782122017-07-20 08:49:43 +0200184 EXPECT_GT(ref_elapsed_time, elapsed_time)
185 << "Error: CDEFSpeedTest, SIMD slower than C." << std::endl
186 << "C time: " << ref_elapsed_time << " us" << std::endl
187 << "SIMD time: " << elapsed_time << " us" << std::endl;
188}
189
190typedef int (*find_dir_t)(const uint16_t *img, int stride, int32_t *var,
191 int coeff_shift);
192
sarahparkera543df52018-11-02 16:02:05 -0700193typedef std::tuple<find_dir_t, find_dir_t> find_dir_param_t;
Steinar Midtskogen59782122017-07-20 08:49:43 +0200194
195class CDEFFindDirTest : public ::testing::TestWithParam<find_dir_param_t> {
196 public:
197 virtual ~CDEFFindDirTest() {}
198 virtual void SetUp() {
199 finddir = GET_PARAM(0);
200 ref_finddir = GET_PARAM(1);
201 }
202
203 virtual void TearDown() { libaom_test::ClearSystemState(); }
204
205 protected:
206 find_dir_t finddir;
207 find_dir_t ref_finddir;
208};
chiyotsai9dfac722020-07-07 17:43:02 -0700209GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CDEFFindDirTest);
Steinar Midtskogen59782122017-07-20 08:49:43 +0200210
211typedef CDEFFindDirTest CDEFFindDirSpeedTest;
chiyotsai9dfac722020-07-07 17:43:02 -0700212GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CDEFFindDirSpeedTest);
Steinar Midtskogen59782122017-07-20 08:49:43 +0200213
214void test_finddir(int (*finddir)(const uint16_t *img, int stride, int32_t *var,
215 int coeff_shift),
216 int (*ref_finddir)(const uint16_t *img, int stride,
217 int32_t *var, int coeff_shift)) {
218 const int size = 8;
219 ACMRandom rnd(ACMRandom::DeterministicSeed());
220 DECLARE_ALIGNED(16, uint16_t, s[size * size]);
221
222 int error = 0;
223 int depth, bits, level, count, errdepth = 0;
224 int ref_res = 0, res = 0;
225 int32_t ref_var = 0, var = 0;
226
227 for (depth = 8; depth <= 12 && !error; depth += 2) {
228 for (count = 0; count < 512 && !error; count++) {
229 for (level = 0; level < (1 << depth) && !error;
230 level += 1 << (depth - 8)) {
231 for (bits = 1; bits <= depth && !error; bits++) {
232 for (unsigned int i = 0; i < sizeof(s) / sizeof(*s); i++)
233 s[i] = clamp((rnd.Rand16() & ((1 << bits) - 1)) + level, 0,
234 (1 << depth) - 1);
235 for (int c = 0; c < 1 + 9 * (finddir == ref_finddir); c++)
236 ref_res = ref_finddir(s, size, &ref_var, depth - 8);
237 if (finddir != ref_finddir)
238 ASM_REGISTER_STATE_CHECK(res = finddir(s, size, &var, depth - 8));
239 if (ref_finddir != finddir) {
240 if (res != ref_res || var != ref_var) error = 1;
241 errdepth = depth;
242 }
243 }
244 }
245 }
246 }
247
248 EXPECT_EQ(0, error) << "Error: CDEFFindDirTest, SIMD and C mismatch."
249 << std::endl
250 << "return: " << res << " : " << ref_res << std::endl
251 << "var: " << var << " : " << ref_var << std::endl
252 << "depth: " << errdepth << std::endl
253 << std::endl;
254}
255
256void test_finddir_speed(int (*finddir)(const uint16_t *img, int stride,
257 int32_t *var, int coeff_shift),
258 int (*ref_finddir)(const uint16_t *img, int stride,
259 int32_t *var, int coeff_shift)) {
260 aom_usec_timer ref_timer;
261 aom_usec_timer timer;
262
263 aom_usec_timer_start(&ref_timer);
264 test_finddir(ref_finddir, ref_finddir);
265 aom_usec_timer_mark(&ref_timer);
266 int ref_elapsed_time = (int)aom_usec_timer_elapsed(&ref_timer);
267
268 aom_usec_timer_start(&timer);
269 test_finddir(finddir, finddir);
270 aom_usec_timer_mark(&timer);
271 int elapsed_time = (int)aom_usec_timer_elapsed(&timer);
272
Steinar Midtskogen59782122017-07-20 08:49:43 +0200273 EXPECT_GT(ref_elapsed_time, elapsed_time)
274 << "Error: CDEFFindDirSpeedTest, SIMD slower than C." << std::endl
275 << "C time: " << ref_elapsed_time << " us" << std::endl
276 << "SIMD time: " << elapsed_time << " us" << std::endl;
277}
278
279TEST_P(CDEFBlockTest, TestSIMDNoMismatch) {
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700280 test_cdef(bsize, 1, cdef, ref_cdef, boundary, depth);
Steinar Midtskogen59782122017-07-20 08:49:43 +0200281}
282
283TEST_P(CDEFSpeedTest, DISABLED_TestSpeed) {
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700284 test_cdef_speed(bsize, 4, cdef, ref_cdef, boundary, depth);
Steinar Midtskogen59782122017-07-20 08:49:43 +0200285}
286
287TEST_P(CDEFFindDirTest, TestSIMDNoMismatch) {
288 test_finddir(finddir, ref_finddir);
289}
290
291TEST_P(CDEFFindDirSpeedTest, DISABLED_TestSpeed) {
292 test_finddir_speed(finddir, ref_finddir);
293}
294
sarahparkera543df52018-11-02 16:02:05 -0700295using std::make_tuple;
Steinar Midtskogen59782122017-07-20 08:49:43 +0200296
297// VS compiling for 32 bit targets does not support vector types in
298// structs as arguments, which makes the v256 type of the intrinsics
299// hard to support, so optimizations for this target are disabled.
300#if defined(_WIN64) || !defined(_MSC_VER) || defined(__clang__)
301#if HAVE_SSE2
Cheng Chen96786fe2020-02-14 17:28:25 -0800302INSTANTIATE_TEST_SUITE_P(
Steinar Midtskogen59782122017-07-20 08:49:43 +0200303 SSE2, CDEFBlockTest,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700304 ::testing::Combine(::testing::Values(&cdef_filter_block_sse2),
305 ::testing::Values(&cdef_filter_block_c),
Ravi Chaudharybc2bd032018-04-12 13:48:54 +0530306 ::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
307 BLOCK_8X8),
308 ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
Cheng Chen96786fe2020-02-14 17:28:25 -0800309INSTANTIATE_TEST_SUITE_P(SSE2, CDEFFindDirTest,
310 ::testing::Values(make_tuple(&cdef_find_dir_sse2,
311 &cdef_find_dir_c)));
Steinar Midtskogen59782122017-07-20 08:49:43 +0200312#endif
313#if HAVE_SSSE3
Cheng Chen96786fe2020-02-14 17:28:25 -0800314INSTANTIATE_TEST_SUITE_P(
Steinar Midtskogen59782122017-07-20 08:49:43 +0200315 SSSE3, CDEFBlockTest,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700316 ::testing::Combine(::testing::Values(&cdef_filter_block_ssse3),
317 ::testing::Values(&cdef_filter_block_c),
Ravi Chaudharybc2bd032018-04-12 13:48:54 +0530318 ::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
319 BLOCK_8X8),
320 ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
Cheng Chen96786fe2020-02-14 17:28:25 -0800321INSTANTIATE_TEST_SUITE_P(SSSE3, CDEFFindDirTest,
322 ::testing::Values(make_tuple(&cdef_find_dir_ssse3,
323 &cdef_find_dir_c)));
Steinar Midtskogen59782122017-07-20 08:49:43 +0200324#endif
325
326#if HAVE_SSE4_1
Cheng Chen96786fe2020-02-14 17:28:25 -0800327INSTANTIATE_TEST_SUITE_P(
Steinar Midtskogen59782122017-07-20 08:49:43 +0200328 SSE4_1, CDEFBlockTest,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700329 ::testing::Combine(::testing::Values(&cdef_filter_block_sse4_1),
330 ::testing::Values(&cdef_filter_block_c),
Ravi Chaudharybc2bd032018-04-12 13:48:54 +0530331 ::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
332 BLOCK_8X8),
333 ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
Cheng Chen96786fe2020-02-14 17:28:25 -0800334INSTANTIATE_TEST_SUITE_P(SSE4_1, CDEFFindDirTest,
335 ::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
336 &cdef_find_dir_c)));
Steinar Midtskogen59782122017-07-20 08:49:43 +0200337#endif
338
339#if HAVE_AVX2
Cheng Chen96786fe2020-02-14 17:28:25 -0800340INSTANTIATE_TEST_SUITE_P(
Steinar Midtskogen59782122017-07-20 08:49:43 +0200341 AVX2, CDEFBlockTest,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700342 ::testing::Combine(::testing::Values(&cdef_filter_block_avx2),
343 ::testing::Values(&cdef_filter_block_c),
Ravi Chaudharybc2bd032018-04-12 13:48:54 +0530344 ::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
345 BLOCK_8X8),
346 ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
Cheng Chen96786fe2020-02-14 17:28:25 -0800347INSTANTIATE_TEST_SUITE_P(AVX2, CDEFFindDirTest,
348 ::testing::Values(make_tuple(&cdef_find_dir_avx2,
349 &cdef_find_dir_c)));
Steinar Midtskogen59782122017-07-20 08:49:43 +0200350#endif
351
352#if HAVE_NEON
Cheng Chen96786fe2020-02-14 17:28:25 -0800353INSTANTIATE_TEST_SUITE_P(
Steinar Midtskogen59782122017-07-20 08:49:43 +0200354 NEON, CDEFBlockTest,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700355 ::testing::Combine(::testing::Values(&cdef_filter_block_neon),
356 ::testing::Values(&cdef_filter_block_c),
Ravi Chaudharybc2bd032018-04-12 13:48:54 +0530357 ::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
358 BLOCK_8X8),
359 ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
Cheng Chen96786fe2020-02-14 17:28:25 -0800360INSTANTIATE_TEST_SUITE_P(NEON, CDEFFindDirTest,
361 ::testing::Values(make_tuple(&cdef_find_dir_neon,
362 &cdef_find_dir_c)));
Steinar Midtskogen59782122017-07-20 08:49:43 +0200363#endif
364
365// Test speed for all supported architectures
366#if HAVE_SSE2
Cheng Chen96786fe2020-02-14 17:28:25 -0800367INSTANTIATE_TEST_SUITE_P(
Steinar Midtskogen59782122017-07-20 08:49:43 +0200368 SSE2, CDEFSpeedTest,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700369 ::testing::Combine(::testing::Values(&cdef_filter_block_sse2),
370 ::testing::Values(&cdef_filter_block_c),
Ravi Chaudharybc2bd032018-04-12 13:48:54 +0530371 ::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
372 BLOCK_8X8),
373 ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
Cheng Chen96786fe2020-02-14 17:28:25 -0800374INSTANTIATE_TEST_SUITE_P(SSE2, CDEFFindDirSpeedTest,
375 ::testing::Values(make_tuple(&cdef_find_dir_sse2,
376 &cdef_find_dir_c)));
Steinar Midtskogen59782122017-07-20 08:49:43 +0200377#endif
378
379#if HAVE_SSSE3
Cheng Chen96786fe2020-02-14 17:28:25 -0800380INSTANTIATE_TEST_SUITE_P(
Steinar Midtskogen59782122017-07-20 08:49:43 +0200381 SSSE3, CDEFSpeedTest,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700382 ::testing::Combine(::testing::Values(&cdef_filter_block_ssse3),
383 ::testing::Values(&cdef_filter_block_c),
Ravi Chaudharybc2bd032018-04-12 13:48:54 +0530384 ::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
385 BLOCK_8X8),
386 ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
Cheng Chen96786fe2020-02-14 17:28:25 -0800387INSTANTIATE_TEST_SUITE_P(SSSE3, CDEFFindDirSpeedTest,
388 ::testing::Values(make_tuple(&cdef_find_dir_ssse3,
389 &cdef_find_dir_c)));
Steinar Midtskogen59782122017-07-20 08:49:43 +0200390#endif
391
392#if HAVE_SSE4_1
Cheng Chen96786fe2020-02-14 17:28:25 -0800393INSTANTIATE_TEST_SUITE_P(
Steinar Midtskogen59782122017-07-20 08:49:43 +0200394 SSE4_1, CDEFSpeedTest,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700395 ::testing::Combine(::testing::Values(&cdef_filter_block_sse4_1),
396 ::testing::Values(&cdef_filter_block_c),
Ravi Chaudharybc2bd032018-04-12 13:48:54 +0530397 ::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
398 BLOCK_8X8),
399 ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
Cheng Chen96786fe2020-02-14 17:28:25 -0800400INSTANTIATE_TEST_SUITE_P(SSE4_1, CDEFFindDirSpeedTest,
401 ::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
402 &cdef_find_dir_c)));
Steinar Midtskogen59782122017-07-20 08:49:43 +0200403#endif
404
405#if HAVE_AVX2
Cheng Chen96786fe2020-02-14 17:28:25 -0800406INSTANTIATE_TEST_SUITE_P(
Steinar Midtskogen59782122017-07-20 08:49:43 +0200407 AVX2, CDEFSpeedTest,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700408 ::testing::Combine(::testing::Values(&cdef_filter_block_avx2),
409 ::testing::Values(&cdef_filter_block_c),
Ravi Chaudharybc2bd032018-04-12 13:48:54 +0530410 ::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
411 BLOCK_8X8),
412 ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
Cheng Chen96786fe2020-02-14 17:28:25 -0800413INSTANTIATE_TEST_SUITE_P(AVX2, CDEFFindDirSpeedTest,
414 ::testing::Values(make_tuple(&cdef_find_dir_avx2,
415 &cdef_find_dir_c)));
Steinar Midtskogen59782122017-07-20 08:49:43 +0200416#endif
417
418#if HAVE_NEON
Cheng Chen96786fe2020-02-14 17:28:25 -0800419INSTANTIATE_TEST_SUITE_P(
Steinar Midtskogen59782122017-07-20 08:49:43 +0200420 NEON, CDEFSpeedTest,
Sarah Parkerf65e5ba2018-03-14 18:33:52 -0700421 ::testing::Combine(::testing::Values(&cdef_filter_block_neon),
422 ::testing::Values(&cdef_filter_block_c),
Ravi Chaudharybc2bd032018-04-12 13:48:54 +0530423 ::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
424 BLOCK_8X8),
425 ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
Cheng Chen96786fe2020-02-14 17:28:25 -0800426INSTANTIATE_TEST_SUITE_P(NEON, CDEFFindDirSpeedTest,
427 ::testing::Values(make_tuple(&cdef_find_dir_neon,
428 &cdef_find_dir_c)));
Steinar Midtskogen59782122017-07-20 08:49:43 +0200429#endif
430
431#endif // defined(_WIN64) || !defined(_MSC_VER)
432} // namespace