1 /*
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include <cmath>
12 #include <cstdlib>
13 #include <string>
14
15 #include "third_party/googletest/src/include/gtest/gtest.h"
16
17 #include "./vpx_config.h"
18 #include "./vpx_dsp_rtcd.h"
19 #include "test/acm_random.h"
20 #include "test/clear_system_state.h"
21 #include "test/register_state_check.h"
22 #include "test/util.h"
23 #include "vp9/common/vp9_entropy.h"
24 #include "vp9/common/vp9_loopfilter.h"
25 #include "vpx/vpx_integer.h"
26
27 using libvpx_test::ACMRandom;
28
29 namespace {
30 // Horizontally and Vertically need 32x32: 8 Coeffs preceeding filtered section
31 // 16 Coefs within filtered section
32 // 8 Coeffs following filtered section
33 const int kNumCoeffs = 1024;
34
35 const int number_of_iterations = 10000;
36
37 #if CONFIG_VP9_HIGHBITDEPTH
38 typedef uint16_t Pixel;
39 #define PIXEL_WIDTH 16
40
41 typedef void (*loop_op_t)(Pixel *s, int p, const uint8_t *blimit,
42 const uint8_t *limit, const uint8_t *thresh, int bd);
43 typedef void (*dual_loop_op_t)(Pixel *s, int p, const uint8_t *blimit0,
44 const uint8_t *limit0, const uint8_t *thresh0,
45 const uint8_t *blimit1, const uint8_t *limit1,
46 const uint8_t *thresh1, int bd);
47 #else
48 typedef uint8_t Pixel;
49 #define PIXEL_WIDTH 8
50
51 typedef void (*loop_op_t)(Pixel *s, int p, const uint8_t *blimit,
52 const uint8_t *limit, const uint8_t *thresh);
53 typedef void (*dual_loop_op_t)(Pixel *s, int p, const uint8_t *blimit0,
54 const uint8_t *limit0, const uint8_t *thresh0,
55 const uint8_t *blimit1, const uint8_t *limit1,
56 const uint8_t *thresh1);
57 #endif // CONFIG_VP9_HIGHBITDEPTH
58
59 typedef std::tr1::tuple<loop_op_t, loop_op_t, int> loop8_param_t;
60 typedef std::tr1::tuple<dual_loop_op_t, dual_loop_op_t, int> dualloop8_param_t;
61
InitInput(Pixel * s,Pixel * ref_s,ACMRandom * rnd,const uint8_t limit,const int mask,const int32_t p,const int i)62 void InitInput(Pixel *s, Pixel *ref_s, ACMRandom *rnd, const uint8_t limit,
63 const int mask, const int32_t p, const int i) {
64 uint16_t tmp_s[kNumCoeffs];
65
66 for (int j = 0; j < kNumCoeffs;) {
67 const uint8_t val = rnd->Rand8();
68 if (val & 0x80) { // 50% chance to choose a new value.
69 tmp_s[j] = rnd->Rand16();
70 j++;
71 } else { // 50% chance to repeat previous value in row X times.
72 int k = 0;
73 while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) {
74 if (j < 1) {
75 tmp_s[j] = rnd->Rand16();
76 } else if (val & 0x20) { // Increment by a value within the limit.
77 tmp_s[j] = tmp_s[j - 1] + (limit - 1);
78 } else { // Decrement by a value within the limit.
79 tmp_s[j] = tmp_s[j - 1] - (limit - 1);
80 }
81 j++;
82 }
83 }
84 }
85
86 for (int j = 0; j < kNumCoeffs;) {
87 const uint8_t val = rnd->Rand8();
88 if (val & 0x80) {
89 j++;
90 } else { // 50% chance to repeat previous value in column X times.
91 int k = 0;
92 while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) {
93 if (j < 1) {
94 tmp_s[j] = rnd->Rand16();
95 } else if (val & 0x20) { // Increment by a value within the limit.
96 tmp_s[(j % 32) * 32 + j / 32] =
97 tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] + (limit - 1);
98 } else { // Decrement by a value within the limit.
99 tmp_s[(j % 32) * 32 + j / 32] =
100 tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] - (limit - 1);
101 }
102 j++;
103 }
104 }
105 }
106
107 for (int j = 0; j < kNumCoeffs; j++) {
108 if (i % 2) {
109 s[j] = tmp_s[j] & mask;
110 } else {
111 s[j] = tmp_s[p * (j % p) + j / p] & mask;
112 }
113 ref_s[j] = s[j];
114 }
115 }
116
117 class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> {
118 public:
~Loop8Test6Param()119 virtual ~Loop8Test6Param() {}
SetUp()120 virtual void SetUp() {
121 loopfilter_op_ = GET_PARAM(0);
122 ref_loopfilter_op_ = GET_PARAM(1);
123 bit_depth_ = GET_PARAM(2);
124 mask_ = (1 << bit_depth_) - 1;
125 }
126
TearDown()127 virtual void TearDown() { libvpx_test::ClearSystemState(); }
128
129 protected:
130 int bit_depth_;
131 int mask_;
132 loop_op_t loopfilter_op_;
133 loop_op_t ref_loopfilter_op_;
134 };
135
136 class Loop8Test9Param : public ::testing::TestWithParam<dualloop8_param_t> {
137 public:
~Loop8Test9Param()138 virtual ~Loop8Test9Param() {}
SetUp()139 virtual void SetUp() {
140 loopfilter_op_ = GET_PARAM(0);
141 ref_loopfilter_op_ = GET_PARAM(1);
142 bit_depth_ = GET_PARAM(2);
143 mask_ = (1 << bit_depth_) - 1;
144 }
145
TearDown()146 virtual void TearDown() { libvpx_test::ClearSystemState(); }
147
148 protected:
149 int bit_depth_;
150 int mask_;
151 dual_loop_op_t loopfilter_op_;
152 dual_loop_op_t ref_loopfilter_op_;
153 };
154
TEST_P(Loop8Test6Param,OperationCheck)155 TEST_P(Loop8Test6Param, OperationCheck) {
156 ACMRandom rnd(ACMRandom::DeterministicSeed());
157 const int count_test_block = number_of_iterations;
158 const int32_t p = kNumCoeffs / 32;
159 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]);
160 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]);
161 int err_count_total = 0;
162 int first_failure = -1;
163 for (int i = 0; i < count_test_block; ++i) {
164 int err_count = 0;
165 uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
166 DECLARE_ALIGNED(16, const uint8_t,
167 blimit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
168 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
169 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
170 DECLARE_ALIGNED(16, const uint8_t,
171 limit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
172 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
173 tmp = rnd.Rand8();
174 DECLARE_ALIGNED(16, const uint8_t,
175 thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
176 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
177 InitInput(s, ref_s, &rnd, *limit, mask_, p, i);
178 #if CONFIG_VP9_HIGHBITDEPTH
179 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_);
180 ASM_REGISTER_STATE_CHECK(
181 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_));
182 #else
183 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh);
184 ASM_REGISTER_STATE_CHECK(
185 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
186 #endif // CONFIG_VP9_HIGHBITDEPTH
187
188 for (int j = 0; j < kNumCoeffs; ++j) {
189 err_count += ref_s[j] != s[j];
190 }
191 if (err_count && !err_count_total) {
192 first_failure = i;
193 }
194 err_count_total += err_count;
195 }
196 EXPECT_EQ(0, err_count_total)
197 << "Error: Loop8Test6Param, C output doesn't match SSE2 "
198 "loopfilter output. "
199 << "First failed at test case " << first_failure;
200 }
201
TEST_P(Loop8Test6Param,ValueCheck)202 TEST_P(Loop8Test6Param, ValueCheck) {
203 ACMRandom rnd(ACMRandom::DeterministicSeed());
204 const int count_test_block = number_of_iterations;
205 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]);
206 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]);
207 int err_count_total = 0;
208 int first_failure = -1;
209
210 // NOTE: The code in vp9_loopfilter.c:update_sharpness computes mblim as a
211 // function of sharpness_lvl and the loopfilter lvl as:
212 // block_inside_limit = lvl >> ((sharpness_lvl > 0) + (sharpness_lvl > 4));
213 // ...
214 // memset(lfi->lfthr[lvl].mblim, (2 * (lvl + 2) + block_inside_limit),
215 // SIMD_WIDTH);
216 // This means that the largest value for mblim will occur when sharpness_lvl
217 // is equal to 0, and lvl is equal to its greatest value (MAX_LOOP_FILTER).
218 // In this case block_inside_limit will be equal to MAX_LOOP_FILTER and
219 // therefore mblim will be equal to (2 * (lvl + 2) + block_inside_limit) =
220 // 2 * (MAX_LOOP_FILTER + 2) + MAX_LOOP_FILTER = 3 * MAX_LOOP_FILTER + 4
221
222 for (int i = 0; i < count_test_block; ++i) {
223 int err_count = 0;
224 uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
225 DECLARE_ALIGNED(16, const uint8_t,
226 blimit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
227 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
228 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
229 DECLARE_ALIGNED(16, const uint8_t,
230 limit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
231 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
232 tmp = rnd.Rand8();
233 DECLARE_ALIGNED(16, const uint8_t,
234 thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
235 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
236 int32_t p = kNumCoeffs / 32;
237 for (int j = 0; j < kNumCoeffs; ++j) {
238 s[j] = rnd.Rand16() & mask_;
239 ref_s[j] = s[j];
240 }
241 #if CONFIG_VP9_HIGHBITDEPTH
242 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_);
243 ASM_REGISTER_STATE_CHECK(
244 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_));
245 #else
246 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh);
247 ASM_REGISTER_STATE_CHECK(
248 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
249 #endif // CONFIG_VP9_HIGHBITDEPTH
250
251 for (int j = 0; j < kNumCoeffs; ++j) {
252 err_count += ref_s[j] != s[j];
253 }
254 if (err_count && !err_count_total) {
255 first_failure = i;
256 }
257 err_count_total += err_count;
258 }
259 EXPECT_EQ(0, err_count_total)
260 << "Error: Loop8Test6Param, C output doesn't match SSE2 "
261 "loopfilter output. "
262 << "First failed at test case " << first_failure;
263 }
264
TEST_P(Loop8Test9Param,OperationCheck)265 TEST_P(Loop8Test9Param, OperationCheck) {
266 ACMRandom rnd(ACMRandom::DeterministicSeed());
267 const int count_test_block = number_of_iterations;
268 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]);
269 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]);
270 int err_count_total = 0;
271 int first_failure = -1;
272 for (int i = 0; i < count_test_block; ++i) {
273 int err_count = 0;
274 uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
275 DECLARE_ALIGNED(16, const uint8_t,
276 blimit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
277 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
278 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
279 DECLARE_ALIGNED(16, const uint8_t,
280 limit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
281 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
282 tmp = rnd.Rand8();
283 DECLARE_ALIGNED(16, const uint8_t,
284 thresh0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
285 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
286 tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
287 DECLARE_ALIGNED(16, const uint8_t,
288 blimit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
289 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
290 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
291 DECLARE_ALIGNED(16, const uint8_t,
292 limit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
293 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
294 tmp = rnd.Rand8();
295 DECLARE_ALIGNED(16, const uint8_t,
296 thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
297 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
298 int32_t p = kNumCoeffs / 32;
299 const uint8_t limit = *limit0 < *limit1 ? *limit0 : *limit1;
300 InitInput(s, ref_s, &rnd, limit, mask_, p, i);
301 #if CONFIG_VP9_HIGHBITDEPTH
302 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
303 limit1, thresh1, bit_depth_);
304 ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
305 thresh0, blimit1, limit1, thresh1,
306 bit_depth_));
307 #else
308 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
309 limit1, thresh1);
310 ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
311 thresh0, blimit1, limit1, thresh1));
312 #endif // CONFIG_VP9_HIGHBITDEPTH
313
314 for (int j = 0; j < kNumCoeffs; ++j) {
315 err_count += ref_s[j] != s[j];
316 }
317 if (err_count && !err_count_total) {
318 first_failure = i;
319 }
320 err_count_total += err_count;
321 }
322 EXPECT_EQ(0, err_count_total)
323 << "Error: Loop8Test9Param, C output doesn't match SSE2 "
324 "loopfilter output. "
325 << "First failed at test case " << first_failure;
326 }
327
TEST_P(Loop8Test9Param,ValueCheck)328 TEST_P(Loop8Test9Param, ValueCheck) {
329 ACMRandom rnd(ACMRandom::DeterministicSeed());
330 const int count_test_block = number_of_iterations;
331 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]);
332 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]);
333 int err_count_total = 0;
334 int first_failure = -1;
335 for (int i = 0; i < count_test_block; ++i) {
336 int err_count = 0;
337 uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
338 DECLARE_ALIGNED(16, const uint8_t,
339 blimit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
340 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
341 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
342 DECLARE_ALIGNED(16, const uint8_t,
343 limit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
344 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
345 tmp = rnd.Rand8();
346 DECLARE_ALIGNED(16, const uint8_t,
347 thresh0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
348 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
349 tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
350 DECLARE_ALIGNED(16, const uint8_t,
351 blimit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
352 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
353 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
354 DECLARE_ALIGNED(16, const uint8_t,
355 limit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
356 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
357 tmp = rnd.Rand8();
358 DECLARE_ALIGNED(16, const uint8_t,
359 thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
360 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
361 int32_t p = kNumCoeffs / 32; // TODO(pdlf) can we have non-square here?
362 for (int j = 0; j < kNumCoeffs; ++j) {
363 s[j] = rnd.Rand16() & mask_;
364 ref_s[j] = s[j];
365 }
366 #if CONFIG_VP9_HIGHBITDEPTH
367 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
368 limit1, thresh1, bit_depth_);
369 ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
370 thresh0, blimit1, limit1, thresh1,
371 bit_depth_));
372 #else
373 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
374 limit1, thresh1);
375 ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
376 thresh0, blimit1, limit1, thresh1));
377 #endif // CONFIG_VP9_HIGHBITDEPTH
378
379 for (int j = 0; j < kNumCoeffs; ++j) {
380 err_count += ref_s[j] != s[j];
381 }
382 if (err_count && !err_count_total) {
383 first_failure = i;
384 }
385 err_count_total += err_count;
386 }
387 EXPECT_EQ(0, err_count_total)
388 << "Error: Loop8Test9Param, C output doesn't match SSE2"
389 "loopfilter output. "
390 << "First failed at test case " << first_failure;
391 }
392
393 using std::tr1::make_tuple;
394
395 #if HAVE_SSE2
396 #if CONFIG_VP9_HIGHBITDEPTH
397 INSTANTIATE_TEST_CASE_P(
398 SSE2, Loop8Test6Param,
399 ::testing::Values(make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
400 &vpx_highbd_lpf_horizontal_4_c, 8),
401 make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
402 &vpx_highbd_lpf_vertical_4_c, 8),
403 make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
404 &vpx_highbd_lpf_horizontal_8_c, 8),
405 make_tuple(&vpx_highbd_lpf_horizontal_16_sse2,
406 &vpx_highbd_lpf_horizontal_16_c, 8),
407 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_sse2,
408 &vpx_highbd_lpf_horizontal_16_dual_c, 8),
409 make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
410 &vpx_highbd_lpf_vertical_8_c, 8),
411 make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
412 &vpx_highbd_lpf_vertical_16_c, 8),
413 make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
414 &vpx_highbd_lpf_horizontal_4_c, 10),
415 make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
416 &vpx_highbd_lpf_vertical_4_c, 10),
417 make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
418 &vpx_highbd_lpf_horizontal_8_c, 10),
419 make_tuple(&vpx_highbd_lpf_horizontal_16_sse2,
420 &vpx_highbd_lpf_horizontal_16_c, 10),
421 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_sse2,
422 &vpx_highbd_lpf_horizontal_16_dual_c, 10),
423 make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
424 &vpx_highbd_lpf_vertical_8_c, 10),
425 make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
426 &vpx_highbd_lpf_vertical_16_c, 10),
427 make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
428 &vpx_highbd_lpf_horizontal_4_c, 12),
429 make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
430 &vpx_highbd_lpf_vertical_4_c, 12),
431 make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
432 &vpx_highbd_lpf_horizontal_8_c, 12),
433 make_tuple(&vpx_highbd_lpf_horizontal_16_sse2,
434 &vpx_highbd_lpf_horizontal_16_c, 12),
435 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_sse2,
436 &vpx_highbd_lpf_horizontal_16_dual_c, 12),
437 make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
438 &vpx_highbd_lpf_vertical_8_c, 12),
439 make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
440 &vpx_highbd_lpf_vertical_16_c, 12),
441 make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
442 &vpx_highbd_lpf_vertical_16_dual_c, 8),
443 make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
444 &vpx_highbd_lpf_vertical_16_dual_c, 10),
445 make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
446 &vpx_highbd_lpf_vertical_16_dual_c, 12)));
447 #else
448 INSTANTIATE_TEST_CASE_P(
449 SSE2, Loop8Test6Param,
450 ::testing::Values(
451 make_tuple(&vpx_lpf_horizontal_4_sse2, &vpx_lpf_horizontal_4_c, 8),
452 make_tuple(&vpx_lpf_horizontal_8_sse2, &vpx_lpf_horizontal_8_c, 8),
453 make_tuple(&vpx_lpf_horizontal_16_sse2, &vpx_lpf_horizontal_16_c, 8),
454 make_tuple(&vpx_lpf_horizontal_16_dual_sse2,
455 &vpx_lpf_horizontal_16_dual_c, 8),
456 make_tuple(&vpx_lpf_vertical_4_sse2, &vpx_lpf_vertical_4_c, 8),
457 make_tuple(&vpx_lpf_vertical_8_sse2, &vpx_lpf_vertical_8_c, 8),
458 make_tuple(&vpx_lpf_vertical_16_sse2, &vpx_lpf_vertical_16_c, 8),
459 make_tuple(&vpx_lpf_vertical_16_dual_sse2, &vpx_lpf_vertical_16_dual_c,
460 8)));
461 #endif // CONFIG_VP9_HIGHBITDEPTH
462 #endif
463
464 #if HAVE_AVX2 && (!CONFIG_VP9_HIGHBITDEPTH)
465 INSTANTIATE_TEST_CASE_P(
466 AVX2, Loop8Test6Param,
467 ::testing::Values(make_tuple(&vpx_lpf_horizontal_16_avx2,
468 &vpx_lpf_horizontal_16_c, 8),
469 make_tuple(&vpx_lpf_horizontal_16_dual_avx2,
470 &vpx_lpf_horizontal_16_dual_c, 8)));
471 #endif
472
473 #if HAVE_SSE2
474 #if CONFIG_VP9_HIGHBITDEPTH
475 INSTANTIATE_TEST_CASE_P(
476 SSE2, Loop8Test9Param,
477 ::testing::Values(make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
478 &vpx_highbd_lpf_horizontal_4_dual_c, 8),
479 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
480 &vpx_highbd_lpf_horizontal_8_dual_c, 8),
481 make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
482 &vpx_highbd_lpf_vertical_4_dual_c, 8),
483 make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
484 &vpx_highbd_lpf_vertical_8_dual_c, 8),
485 make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
486 &vpx_highbd_lpf_horizontal_4_dual_c, 10),
487 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
488 &vpx_highbd_lpf_horizontal_8_dual_c, 10),
489 make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
490 &vpx_highbd_lpf_vertical_4_dual_c, 10),
491 make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
492 &vpx_highbd_lpf_vertical_8_dual_c, 10),
493 make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
494 &vpx_highbd_lpf_horizontal_4_dual_c, 12),
495 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
496 &vpx_highbd_lpf_horizontal_8_dual_c, 12),
497 make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
498 &vpx_highbd_lpf_vertical_4_dual_c, 12),
499 make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
500 &vpx_highbd_lpf_vertical_8_dual_c, 12)));
501 #else
502 INSTANTIATE_TEST_CASE_P(
503 SSE2, Loop8Test9Param,
504 ::testing::Values(make_tuple(&vpx_lpf_horizontal_4_dual_sse2,
505 &vpx_lpf_horizontal_4_dual_c, 8),
506 make_tuple(&vpx_lpf_horizontal_8_dual_sse2,
507 &vpx_lpf_horizontal_8_dual_c, 8),
508 make_tuple(&vpx_lpf_vertical_4_dual_sse2,
509 &vpx_lpf_vertical_4_dual_c, 8),
510 make_tuple(&vpx_lpf_vertical_8_dual_sse2,
511 &vpx_lpf_vertical_8_dual_c, 8)));
512 #endif // CONFIG_VP9_HIGHBITDEPTH
513 #endif
514
515 #if HAVE_NEON
516 #if CONFIG_VP9_HIGHBITDEPTH
517 INSTANTIATE_TEST_CASE_P(
518 NEON, Loop8Test6Param,
519 ::testing::Values(make_tuple(&vpx_highbd_lpf_horizontal_4_neon,
520 &vpx_highbd_lpf_horizontal_4_c, 8),
521 make_tuple(&vpx_highbd_lpf_horizontal_4_neon,
522 &vpx_highbd_lpf_horizontal_4_c, 10),
523 make_tuple(&vpx_highbd_lpf_horizontal_4_neon,
524 &vpx_highbd_lpf_horizontal_4_c, 12),
525 make_tuple(&vpx_highbd_lpf_horizontal_8_neon,
526 &vpx_highbd_lpf_horizontal_8_c, 8),
527 make_tuple(&vpx_highbd_lpf_horizontal_8_neon,
528 &vpx_highbd_lpf_horizontal_8_c, 10),
529 make_tuple(&vpx_highbd_lpf_horizontal_8_neon,
530 &vpx_highbd_lpf_horizontal_8_c, 12),
531 make_tuple(&vpx_highbd_lpf_horizontal_16_neon,
532 &vpx_highbd_lpf_horizontal_16_c, 8),
533 make_tuple(&vpx_highbd_lpf_horizontal_16_neon,
534 &vpx_highbd_lpf_horizontal_16_c, 10),
535 make_tuple(&vpx_highbd_lpf_horizontal_16_neon,
536 &vpx_highbd_lpf_horizontal_16_c, 12),
537 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_neon,
538 &vpx_highbd_lpf_horizontal_16_dual_c, 8),
539 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_neon,
540 &vpx_highbd_lpf_horizontal_16_dual_c, 10),
541 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_neon,
542 &vpx_highbd_lpf_horizontal_16_dual_c, 12),
543 make_tuple(&vpx_highbd_lpf_vertical_4_neon,
544 &vpx_highbd_lpf_vertical_4_c, 8),
545 make_tuple(&vpx_highbd_lpf_vertical_4_neon,
546 &vpx_highbd_lpf_vertical_4_c, 10),
547 make_tuple(&vpx_highbd_lpf_vertical_4_neon,
548 &vpx_highbd_lpf_vertical_4_c, 12),
549 make_tuple(&vpx_highbd_lpf_vertical_8_neon,
550 &vpx_highbd_lpf_vertical_8_c, 8),
551 make_tuple(&vpx_highbd_lpf_vertical_8_neon,
552 &vpx_highbd_lpf_vertical_8_c, 10),
553 make_tuple(&vpx_highbd_lpf_vertical_8_neon,
554 &vpx_highbd_lpf_vertical_8_c, 12),
555 make_tuple(&vpx_highbd_lpf_vertical_16_neon,
556 &vpx_highbd_lpf_vertical_16_c, 8),
557 make_tuple(&vpx_highbd_lpf_vertical_16_neon,
558 &vpx_highbd_lpf_vertical_16_c, 10),
559 make_tuple(&vpx_highbd_lpf_vertical_16_neon,
560 &vpx_highbd_lpf_vertical_16_c, 12),
561 make_tuple(&vpx_highbd_lpf_vertical_16_dual_neon,
562 &vpx_highbd_lpf_vertical_16_dual_c, 8),
563 make_tuple(&vpx_highbd_lpf_vertical_16_dual_neon,
564 &vpx_highbd_lpf_vertical_16_dual_c, 10),
565 make_tuple(&vpx_highbd_lpf_vertical_16_dual_neon,
566 &vpx_highbd_lpf_vertical_16_dual_c, 12)));
567 INSTANTIATE_TEST_CASE_P(
568 NEON, Loop8Test9Param,
569 ::testing::Values(make_tuple(&vpx_highbd_lpf_horizontal_4_dual_neon,
570 &vpx_highbd_lpf_horizontal_4_dual_c, 8),
571 make_tuple(&vpx_highbd_lpf_horizontal_4_dual_neon,
572 &vpx_highbd_lpf_horizontal_4_dual_c, 10),
573 make_tuple(&vpx_highbd_lpf_horizontal_4_dual_neon,
574 &vpx_highbd_lpf_horizontal_4_dual_c, 12),
575 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_neon,
576 &vpx_highbd_lpf_horizontal_8_dual_c, 8),
577 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_neon,
578 &vpx_highbd_lpf_horizontal_8_dual_c, 10),
579 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_neon,
580 &vpx_highbd_lpf_horizontal_8_dual_c, 12),
581 make_tuple(&vpx_highbd_lpf_vertical_4_dual_neon,
582 &vpx_highbd_lpf_vertical_4_dual_c, 8),
583 make_tuple(&vpx_highbd_lpf_vertical_4_dual_neon,
584 &vpx_highbd_lpf_vertical_4_dual_c, 10),
585 make_tuple(&vpx_highbd_lpf_vertical_4_dual_neon,
586 &vpx_highbd_lpf_vertical_4_dual_c, 12),
587 make_tuple(&vpx_highbd_lpf_vertical_8_dual_neon,
588 &vpx_highbd_lpf_vertical_8_dual_c, 8),
589 make_tuple(&vpx_highbd_lpf_vertical_8_dual_neon,
590 &vpx_highbd_lpf_vertical_8_dual_c, 10),
591 make_tuple(&vpx_highbd_lpf_vertical_8_dual_neon,
592 &vpx_highbd_lpf_vertical_8_dual_c, 12)));
593 #else
594 INSTANTIATE_TEST_CASE_P(
595 NEON, Loop8Test6Param,
596 ::testing::Values(
597 make_tuple(&vpx_lpf_horizontal_16_neon, &vpx_lpf_horizontal_16_c, 8),
598 make_tuple(&vpx_lpf_horizontal_16_dual_neon,
599 &vpx_lpf_horizontal_16_dual_c, 8),
600 make_tuple(&vpx_lpf_vertical_16_neon, &vpx_lpf_vertical_16_c, 8),
601 make_tuple(&vpx_lpf_vertical_16_dual_neon, &vpx_lpf_vertical_16_dual_c,
602 8),
603 make_tuple(&vpx_lpf_horizontal_8_neon, &vpx_lpf_horizontal_8_c, 8),
604 make_tuple(&vpx_lpf_vertical_8_neon, &vpx_lpf_vertical_8_c, 8),
605 make_tuple(&vpx_lpf_horizontal_4_neon, &vpx_lpf_horizontal_4_c, 8),
606 make_tuple(&vpx_lpf_vertical_4_neon, &vpx_lpf_vertical_4_c, 8)));
607 INSTANTIATE_TEST_CASE_P(
608 NEON, Loop8Test9Param,
609 ::testing::Values(make_tuple(&vpx_lpf_horizontal_8_dual_neon,
610 &vpx_lpf_horizontal_8_dual_c, 8),
611 make_tuple(&vpx_lpf_vertical_8_dual_neon,
612 &vpx_lpf_vertical_8_dual_c, 8),
613 make_tuple(&vpx_lpf_horizontal_4_dual_neon,
614 &vpx_lpf_horizontal_4_dual_c, 8),
615 make_tuple(&vpx_lpf_vertical_4_dual_neon,
616 &vpx_lpf_vertical_4_dual_c, 8)));
617 #endif // CONFIG_VP9_HIGHBITDEPTH
618 #endif // HAVE_NEON
619
620 #if HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH
621 INSTANTIATE_TEST_CASE_P(
622 DSPR2, Loop8Test6Param,
623 ::testing::Values(
624 make_tuple(&vpx_lpf_horizontal_4_dspr2, &vpx_lpf_horizontal_4_c, 8),
625 make_tuple(&vpx_lpf_horizontal_8_dspr2, &vpx_lpf_horizontal_8_c, 8),
626 make_tuple(&vpx_lpf_horizontal_16_dspr2, &vpx_lpf_horizontal_16_c, 8),
627 make_tuple(&vpx_lpf_horizontal_16_dual_dspr2,
628 &vpx_lpf_horizontal_16_dual_c, 8),
629 make_tuple(&vpx_lpf_vertical_4_dspr2, &vpx_lpf_vertical_4_c, 8),
630 make_tuple(&vpx_lpf_vertical_8_dspr2, &vpx_lpf_vertical_8_c, 8),
631 make_tuple(&vpx_lpf_vertical_16_dspr2, &vpx_lpf_vertical_16_c, 8),
632 make_tuple(&vpx_lpf_vertical_16_dual_dspr2, &vpx_lpf_vertical_16_dual_c,
633 8)));
634
635 INSTANTIATE_TEST_CASE_P(
636 DSPR2, Loop8Test9Param,
637 ::testing::Values(make_tuple(&vpx_lpf_horizontal_4_dual_dspr2,
638 &vpx_lpf_horizontal_4_dual_c, 8),
639 make_tuple(&vpx_lpf_horizontal_8_dual_dspr2,
640 &vpx_lpf_horizontal_8_dual_c, 8),
641 make_tuple(&vpx_lpf_vertical_4_dual_dspr2,
642 &vpx_lpf_vertical_4_dual_c, 8),
643 make_tuple(&vpx_lpf_vertical_8_dual_dspr2,
644 &vpx_lpf_vertical_8_dual_c, 8)));
645 #endif // HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH
646
647 #if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
648 INSTANTIATE_TEST_CASE_P(
649 MSA, Loop8Test6Param,
650 ::testing::Values(
651 make_tuple(&vpx_lpf_horizontal_4_msa, &vpx_lpf_horizontal_4_c, 8),
652 make_tuple(&vpx_lpf_horizontal_8_msa, &vpx_lpf_horizontal_8_c, 8),
653 make_tuple(&vpx_lpf_horizontal_16_msa, &vpx_lpf_horizontal_16_c, 8),
654 make_tuple(&vpx_lpf_horizontal_16_dual_msa,
655 &vpx_lpf_horizontal_16_dual_c, 8),
656 make_tuple(&vpx_lpf_vertical_4_msa, &vpx_lpf_vertical_4_c, 8),
657 make_tuple(&vpx_lpf_vertical_8_msa, &vpx_lpf_vertical_8_c, 8),
658 make_tuple(&vpx_lpf_vertical_16_msa, &vpx_lpf_vertical_16_c, 8)));
659
660 INSTANTIATE_TEST_CASE_P(
661 MSA, Loop8Test9Param,
662 ::testing::Values(make_tuple(&vpx_lpf_horizontal_4_dual_msa,
663 &vpx_lpf_horizontal_4_dual_c, 8),
664 make_tuple(&vpx_lpf_horizontal_8_dual_msa,
665 &vpx_lpf_horizontal_8_dual_c, 8),
666 make_tuple(&vpx_lpf_vertical_4_dual_msa,
667 &vpx_lpf_vertical_4_dual_c, 8),
668 make_tuple(&vpx_lpf_vertical_8_dual_msa,
669 &vpx_lpf_vertical_8_dual_c, 8)));
670 #endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
671
672 } // namespace
673