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 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 uint8_t GetOuterThresh(ACMRandom *rnd) { 118 return static_cast<uint8_t>(rnd->RandRange(3 * MAX_LOOP_FILTER + 5)); 119 } 120 121 uint8_t GetInnerThresh(ACMRandom *rnd) { 122 return static_cast<uint8_t>(rnd->RandRange(MAX_LOOP_FILTER + 1)); 123 } 124 125 uint8_t GetHevThresh(ACMRandom *rnd) { 126 return static_cast<uint8_t>(rnd->RandRange(MAX_LOOP_FILTER + 1) >> 4); 127 } 128 129 class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> { 130 public: 131 virtual ~Loop8Test6Param() {} 132 virtual void SetUp() { 133 loopfilter_op_ = GET_PARAM(0); 134 ref_loopfilter_op_ = GET_PARAM(1); 135 bit_depth_ = GET_PARAM(2); 136 mask_ = (1 << bit_depth_) - 1; 137 } 138 139 virtual void TearDown() { libvpx_test::ClearSystemState(); } 140 141 protected: 142 int bit_depth_; 143 int mask_; 144 loop_op_t loopfilter_op_; 145 loop_op_t ref_loopfilter_op_; 146 }; 147 148 class Loop8Test9Param : public ::testing::TestWithParam<dualloop8_param_t> { 149 public: 150 virtual ~Loop8Test9Param() {} 151 virtual void SetUp() { 152 loopfilter_op_ = GET_PARAM(0); 153 ref_loopfilter_op_ = GET_PARAM(1); 154 bit_depth_ = GET_PARAM(2); 155 mask_ = (1 << bit_depth_) - 1; 156 } 157 158 virtual void TearDown() { libvpx_test::ClearSystemState(); } 159 160 protected: 161 int bit_depth_; 162 int mask_; 163 dual_loop_op_t loopfilter_op_; 164 dual_loop_op_t ref_loopfilter_op_; 165 }; 166 167 TEST_P(Loop8Test6Param, OperationCheck) { 168 ACMRandom rnd(ACMRandom::DeterministicSeed()); 169 const int count_test_block = number_of_iterations; 170 const int32_t p = kNumCoeffs / 32; 171 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]); 172 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]); 173 int err_count_total = 0; 174 int first_failure = -1; 175 for (int i = 0; i < count_test_block; ++i) { 176 int err_count = 0; 177 uint8_t tmp = GetOuterThresh(&rnd); 178 DECLARE_ALIGNED(16, const uint8_t, 179 blimit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 180 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 181 tmp = GetInnerThresh(&rnd); 182 DECLARE_ALIGNED(16, const uint8_t, 183 limit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 184 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 185 tmp = GetHevThresh(&rnd); 186 DECLARE_ALIGNED(16, const uint8_t, 187 thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 188 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 189 InitInput(s, ref_s, &rnd, *limit, mask_, p, i); 190 #if CONFIG_VP9_HIGHBITDEPTH 191 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_); 192 ASM_REGISTER_STATE_CHECK( 193 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_)); 194 #else 195 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh); 196 ASM_REGISTER_STATE_CHECK( 197 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh)); 198 #endif // CONFIG_VP9_HIGHBITDEPTH 199 200 for (int j = 0; j < kNumCoeffs; ++j) { 201 err_count += ref_s[j] != s[j]; 202 } 203 if (err_count && !err_count_total) { 204 first_failure = i; 205 } 206 err_count_total += err_count; 207 } 208 EXPECT_EQ(0, err_count_total) 209 << "Error: Loop8Test6Param, C output doesn't match SSE2 " 210 "loopfilter output. " 211 << "First failed at test case " << first_failure; 212 } 213 214 TEST_P(Loop8Test6Param, ValueCheck) { 215 ACMRandom rnd(ACMRandom::DeterministicSeed()); 216 const int count_test_block = number_of_iterations; 217 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]); 218 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]); 219 int err_count_total = 0; 220 int first_failure = -1; 221 222 // NOTE: The code in vp9_loopfilter.c:update_sharpness computes mblim as a 223 // function of sharpness_lvl and the loopfilter lvl as: 224 // block_inside_limit = lvl >> ((sharpness_lvl > 0) + (sharpness_lvl > 4)); 225 // ... 226 // memset(lfi->lfthr[lvl].mblim, (2 * (lvl + 2) + block_inside_limit), 227 // SIMD_WIDTH); 228 // This means that the largest value for mblim will occur when sharpness_lvl 229 // is equal to 0, and lvl is equal to its greatest value (MAX_LOOP_FILTER). 230 // In this case block_inside_limit will be equal to MAX_LOOP_FILTER and 231 // therefore mblim will be equal to (2 * (lvl + 2) + block_inside_limit) = 232 // 2 * (MAX_LOOP_FILTER + 2) + MAX_LOOP_FILTER = 3 * MAX_LOOP_FILTER + 4 233 234 for (int i = 0; i < count_test_block; ++i) { 235 int err_count = 0; 236 uint8_t tmp = GetOuterThresh(&rnd); 237 DECLARE_ALIGNED(16, const uint8_t, 238 blimit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 239 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 240 tmp = GetInnerThresh(&rnd); 241 DECLARE_ALIGNED(16, const uint8_t, 242 limit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 243 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 244 tmp = GetHevThresh(&rnd); 245 DECLARE_ALIGNED(16, const uint8_t, 246 thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 247 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 248 int32_t p = kNumCoeffs / 32; 249 for (int j = 0; j < kNumCoeffs; ++j) { 250 s[j] = rnd.Rand16() & mask_; 251 ref_s[j] = s[j]; 252 } 253 #if CONFIG_VP9_HIGHBITDEPTH 254 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_); 255 ASM_REGISTER_STATE_CHECK( 256 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_)); 257 #else 258 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh); 259 ASM_REGISTER_STATE_CHECK( 260 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh)); 261 #endif // CONFIG_VP9_HIGHBITDEPTH 262 263 for (int j = 0; j < kNumCoeffs; ++j) { 264 err_count += ref_s[j] != s[j]; 265 } 266 if (err_count && !err_count_total) { 267 first_failure = i; 268 } 269 err_count_total += err_count; 270 } 271 EXPECT_EQ(0, err_count_total) 272 << "Error: Loop8Test6Param, C output doesn't match SSE2 " 273 "loopfilter output. " 274 << "First failed at test case " << first_failure; 275 } 276 277 TEST_P(Loop8Test9Param, OperationCheck) { 278 ACMRandom rnd(ACMRandom::DeterministicSeed()); 279 const int count_test_block = number_of_iterations; 280 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]); 281 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]); 282 int err_count_total = 0; 283 int first_failure = -1; 284 for (int i = 0; i < count_test_block; ++i) { 285 int err_count = 0; 286 uint8_t tmp = GetOuterThresh(&rnd); 287 DECLARE_ALIGNED(16, const uint8_t, 288 blimit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 289 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 290 tmp = GetInnerThresh(&rnd); 291 DECLARE_ALIGNED(16, const uint8_t, 292 limit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 293 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 294 tmp = GetHevThresh(&rnd); 295 DECLARE_ALIGNED(16, const uint8_t, 296 thresh0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 297 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 298 tmp = GetOuterThresh(&rnd); 299 DECLARE_ALIGNED(16, const uint8_t, 300 blimit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 301 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 302 tmp = GetInnerThresh(&rnd); 303 DECLARE_ALIGNED(16, const uint8_t, 304 limit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 305 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 306 tmp = GetHevThresh(&rnd); 307 DECLARE_ALIGNED(16, const uint8_t, 308 thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 309 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 310 int32_t p = kNumCoeffs / 32; 311 const uint8_t limit = *limit0 < *limit1 ? *limit0 : *limit1; 312 InitInput(s, ref_s, &rnd, limit, mask_, p, i); 313 #if CONFIG_VP9_HIGHBITDEPTH 314 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, 315 limit1, thresh1, bit_depth_); 316 ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, 317 thresh0, blimit1, limit1, thresh1, 318 bit_depth_)); 319 #else 320 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, 321 limit1, thresh1); 322 ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, 323 thresh0, blimit1, limit1, thresh1)); 324 #endif // CONFIG_VP9_HIGHBITDEPTH 325 326 for (int j = 0; j < kNumCoeffs; ++j) { 327 err_count += ref_s[j] != s[j]; 328 } 329 if (err_count && !err_count_total) { 330 first_failure = i; 331 } 332 err_count_total += err_count; 333 } 334 EXPECT_EQ(0, err_count_total) 335 << "Error: Loop8Test9Param, C output doesn't match SSE2 " 336 "loopfilter output. " 337 << "First failed at test case " << first_failure; 338 } 339 340 TEST_P(Loop8Test9Param, ValueCheck) { 341 ACMRandom rnd(ACMRandom::DeterministicSeed()); 342 const int count_test_block = number_of_iterations; 343 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]); 344 DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]); 345 int err_count_total = 0; 346 int first_failure = -1; 347 for (int i = 0; i < count_test_block; ++i) { 348 int err_count = 0; 349 uint8_t tmp = GetOuterThresh(&rnd); 350 DECLARE_ALIGNED(16, const uint8_t, 351 blimit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 352 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 353 tmp = GetInnerThresh(&rnd); 354 DECLARE_ALIGNED(16, const uint8_t, 355 limit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 356 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 357 tmp = GetHevThresh(&rnd); 358 DECLARE_ALIGNED(16, const uint8_t, 359 thresh0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 360 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 361 tmp = GetOuterThresh(&rnd); 362 DECLARE_ALIGNED(16, const uint8_t, 363 blimit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 364 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 365 tmp = GetInnerThresh(&rnd); 366 DECLARE_ALIGNED(16, const uint8_t, 367 limit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 368 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 369 tmp = GetHevThresh(&rnd); 370 DECLARE_ALIGNED(16, const uint8_t, 371 thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, 372 tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; 373 int32_t p = kNumCoeffs / 32; // TODO(pdlf) can we have non-square here? 374 for (int j = 0; j < kNumCoeffs; ++j) { 375 s[j] = rnd.Rand16() & mask_; 376 ref_s[j] = s[j]; 377 } 378 #if CONFIG_VP9_HIGHBITDEPTH 379 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, 380 limit1, thresh1, bit_depth_); 381 ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, 382 thresh0, blimit1, limit1, thresh1, 383 bit_depth_)); 384 #else 385 ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, 386 limit1, thresh1); 387 ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, 388 thresh0, blimit1, limit1, thresh1)); 389 #endif // CONFIG_VP9_HIGHBITDEPTH 390 391 for (int j = 0; j < kNumCoeffs; ++j) { 392 err_count += ref_s[j] != s[j]; 393 } 394 if (err_count && !err_count_total) { 395 first_failure = i; 396 } 397 err_count_total += err_count; 398 } 399 EXPECT_EQ(0, err_count_total) 400 << "Error: Loop8Test9Param, C output doesn't match SSE2" 401 "loopfilter output. " 402 << "First failed at test case " << first_failure; 403 } 404 405 using std::tr1::make_tuple; 406 407 #if HAVE_SSE2 408 #if CONFIG_VP9_HIGHBITDEPTH 409 INSTANTIATE_TEST_CASE_P( 410 SSE2, Loop8Test6Param, 411 ::testing::Values(make_tuple(&vpx_highbd_lpf_horizontal_4_sse2, 412 &vpx_highbd_lpf_horizontal_4_c, 8), 413 make_tuple(&vpx_highbd_lpf_vertical_4_sse2, 414 &vpx_highbd_lpf_vertical_4_c, 8), 415 make_tuple(&vpx_highbd_lpf_horizontal_8_sse2, 416 &vpx_highbd_lpf_horizontal_8_c, 8), 417 make_tuple(&vpx_highbd_lpf_horizontal_16_sse2, 418 &vpx_highbd_lpf_horizontal_16_c, 8), 419 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_sse2, 420 &vpx_highbd_lpf_horizontal_16_dual_c, 8), 421 make_tuple(&vpx_highbd_lpf_vertical_8_sse2, 422 &vpx_highbd_lpf_vertical_8_c, 8), 423 make_tuple(&vpx_highbd_lpf_vertical_16_sse2, 424 &vpx_highbd_lpf_vertical_16_c, 8), 425 make_tuple(&vpx_highbd_lpf_horizontal_4_sse2, 426 &vpx_highbd_lpf_horizontal_4_c, 10), 427 make_tuple(&vpx_highbd_lpf_vertical_4_sse2, 428 &vpx_highbd_lpf_vertical_4_c, 10), 429 make_tuple(&vpx_highbd_lpf_horizontal_8_sse2, 430 &vpx_highbd_lpf_horizontal_8_c, 10), 431 make_tuple(&vpx_highbd_lpf_horizontal_16_sse2, 432 &vpx_highbd_lpf_horizontal_16_c, 10), 433 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_sse2, 434 &vpx_highbd_lpf_horizontal_16_dual_c, 10), 435 make_tuple(&vpx_highbd_lpf_vertical_8_sse2, 436 &vpx_highbd_lpf_vertical_8_c, 10), 437 make_tuple(&vpx_highbd_lpf_vertical_16_sse2, 438 &vpx_highbd_lpf_vertical_16_c, 10), 439 make_tuple(&vpx_highbd_lpf_horizontal_4_sse2, 440 &vpx_highbd_lpf_horizontal_4_c, 12), 441 make_tuple(&vpx_highbd_lpf_vertical_4_sse2, 442 &vpx_highbd_lpf_vertical_4_c, 12), 443 make_tuple(&vpx_highbd_lpf_horizontal_8_sse2, 444 &vpx_highbd_lpf_horizontal_8_c, 12), 445 make_tuple(&vpx_highbd_lpf_horizontal_16_sse2, 446 &vpx_highbd_lpf_horizontal_16_c, 12), 447 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_sse2, 448 &vpx_highbd_lpf_horizontal_16_dual_c, 12), 449 make_tuple(&vpx_highbd_lpf_vertical_8_sse2, 450 &vpx_highbd_lpf_vertical_8_c, 12), 451 make_tuple(&vpx_highbd_lpf_vertical_16_sse2, 452 &vpx_highbd_lpf_vertical_16_c, 12), 453 make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2, 454 &vpx_highbd_lpf_vertical_16_dual_c, 8), 455 make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2, 456 &vpx_highbd_lpf_vertical_16_dual_c, 10), 457 make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2, 458 &vpx_highbd_lpf_vertical_16_dual_c, 12))); 459 #else 460 INSTANTIATE_TEST_CASE_P( 461 SSE2, Loop8Test6Param, 462 ::testing::Values( 463 make_tuple(&vpx_lpf_horizontal_4_sse2, &vpx_lpf_horizontal_4_c, 8), 464 make_tuple(&vpx_lpf_horizontal_8_sse2, &vpx_lpf_horizontal_8_c, 8), 465 make_tuple(&vpx_lpf_horizontal_16_sse2, &vpx_lpf_horizontal_16_c, 8), 466 make_tuple(&vpx_lpf_horizontal_16_dual_sse2, 467 &vpx_lpf_horizontal_16_dual_c, 8), 468 make_tuple(&vpx_lpf_vertical_4_sse2, &vpx_lpf_vertical_4_c, 8), 469 make_tuple(&vpx_lpf_vertical_8_sse2, &vpx_lpf_vertical_8_c, 8), 470 make_tuple(&vpx_lpf_vertical_16_sse2, &vpx_lpf_vertical_16_c, 8), 471 make_tuple(&vpx_lpf_vertical_16_dual_sse2, &vpx_lpf_vertical_16_dual_c, 472 8))); 473 #endif // CONFIG_VP9_HIGHBITDEPTH 474 #endif 475 476 #if HAVE_AVX2 && (!CONFIG_VP9_HIGHBITDEPTH) 477 INSTANTIATE_TEST_CASE_P( 478 AVX2, Loop8Test6Param, 479 ::testing::Values(make_tuple(&vpx_lpf_horizontal_16_avx2, 480 &vpx_lpf_horizontal_16_c, 8), 481 make_tuple(&vpx_lpf_horizontal_16_dual_avx2, 482 &vpx_lpf_horizontal_16_dual_c, 8))); 483 #endif 484 485 #if HAVE_SSE2 486 #if CONFIG_VP9_HIGHBITDEPTH 487 INSTANTIATE_TEST_CASE_P( 488 SSE2, Loop8Test9Param, 489 ::testing::Values(make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2, 490 &vpx_highbd_lpf_horizontal_4_dual_c, 8), 491 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2, 492 &vpx_highbd_lpf_horizontal_8_dual_c, 8), 493 make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2, 494 &vpx_highbd_lpf_vertical_4_dual_c, 8), 495 make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2, 496 &vpx_highbd_lpf_vertical_8_dual_c, 8), 497 make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2, 498 &vpx_highbd_lpf_horizontal_4_dual_c, 10), 499 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2, 500 &vpx_highbd_lpf_horizontal_8_dual_c, 10), 501 make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2, 502 &vpx_highbd_lpf_vertical_4_dual_c, 10), 503 make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2, 504 &vpx_highbd_lpf_vertical_8_dual_c, 10), 505 make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2, 506 &vpx_highbd_lpf_horizontal_4_dual_c, 12), 507 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2, 508 &vpx_highbd_lpf_horizontal_8_dual_c, 12), 509 make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2, 510 &vpx_highbd_lpf_vertical_4_dual_c, 12), 511 make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2, 512 &vpx_highbd_lpf_vertical_8_dual_c, 12))); 513 #else 514 INSTANTIATE_TEST_CASE_P( 515 SSE2, Loop8Test9Param, 516 ::testing::Values(make_tuple(&vpx_lpf_horizontal_4_dual_sse2, 517 &vpx_lpf_horizontal_4_dual_c, 8), 518 make_tuple(&vpx_lpf_horizontal_8_dual_sse2, 519 &vpx_lpf_horizontal_8_dual_c, 8), 520 make_tuple(&vpx_lpf_vertical_4_dual_sse2, 521 &vpx_lpf_vertical_4_dual_c, 8), 522 make_tuple(&vpx_lpf_vertical_8_dual_sse2, 523 &vpx_lpf_vertical_8_dual_c, 8))); 524 #endif // CONFIG_VP9_HIGHBITDEPTH 525 #endif 526 527 #if HAVE_NEON 528 #if CONFIG_VP9_HIGHBITDEPTH 529 INSTANTIATE_TEST_CASE_P( 530 NEON, Loop8Test6Param, 531 ::testing::Values(make_tuple(&vpx_highbd_lpf_horizontal_4_neon, 532 &vpx_highbd_lpf_horizontal_4_c, 8), 533 make_tuple(&vpx_highbd_lpf_horizontal_4_neon, 534 &vpx_highbd_lpf_horizontal_4_c, 10), 535 make_tuple(&vpx_highbd_lpf_horizontal_4_neon, 536 &vpx_highbd_lpf_horizontal_4_c, 12), 537 make_tuple(&vpx_highbd_lpf_horizontal_8_neon, 538 &vpx_highbd_lpf_horizontal_8_c, 8), 539 make_tuple(&vpx_highbd_lpf_horizontal_8_neon, 540 &vpx_highbd_lpf_horizontal_8_c, 10), 541 make_tuple(&vpx_highbd_lpf_horizontal_8_neon, 542 &vpx_highbd_lpf_horizontal_8_c, 12), 543 make_tuple(&vpx_highbd_lpf_horizontal_16_neon, 544 &vpx_highbd_lpf_horizontal_16_c, 8), 545 make_tuple(&vpx_highbd_lpf_horizontal_16_neon, 546 &vpx_highbd_lpf_horizontal_16_c, 10), 547 make_tuple(&vpx_highbd_lpf_horizontal_16_neon, 548 &vpx_highbd_lpf_horizontal_16_c, 12), 549 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_neon, 550 &vpx_highbd_lpf_horizontal_16_dual_c, 8), 551 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_neon, 552 &vpx_highbd_lpf_horizontal_16_dual_c, 10), 553 make_tuple(&vpx_highbd_lpf_horizontal_16_dual_neon, 554 &vpx_highbd_lpf_horizontal_16_dual_c, 12), 555 make_tuple(&vpx_highbd_lpf_vertical_4_neon, 556 &vpx_highbd_lpf_vertical_4_c, 8), 557 make_tuple(&vpx_highbd_lpf_vertical_4_neon, 558 &vpx_highbd_lpf_vertical_4_c, 10), 559 make_tuple(&vpx_highbd_lpf_vertical_4_neon, 560 &vpx_highbd_lpf_vertical_4_c, 12), 561 make_tuple(&vpx_highbd_lpf_vertical_8_neon, 562 &vpx_highbd_lpf_vertical_8_c, 8), 563 make_tuple(&vpx_highbd_lpf_vertical_8_neon, 564 &vpx_highbd_lpf_vertical_8_c, 10), 565 make_tuple(&vpx_highbd_lpf_vertical_8_neon, 566 &vpx_highbd_lpf_vertical_8_c, 12), 567 make_tuple(&vpx_highbd_lpf_vertical_16_neon, 568 &vpx_highbd_lpf_vertical_16_c, 8), 569 make_tuple(&vpx_highbd_lpf_vertical_16_neon, 570 &vpx_highbd_lpf_vertical_16_c, 10), 571 make_tuple(&vpx_highbd_lpf_vertical_16_neon, 572 &vpx_highbd_lpf_vertical_16_c, 12), 573 make_tuple(&vpx_highbd_lpf_vertical_16_dual_neon, 574 &vpx_highbd_lpf_vertical_16_dual_c, 8), 575 make_tuple(&vpx_highbd_lpf_vertical_16_dual_neon, 576 &vpx_highbd_lpf_vertical_16_dual_c, 10), 577 make_tuple(&vpx_highbd_lpf_vertical_16_dual_neon, 578 &vpx_highbd_lpf_vertical_16_dual_c, 12))); 579 INSTANTIATE_TEST_CASE_P( 580 NEON, Loop8Test9Param, 581 ::testing::Values(make_tuple(&vpx_highbd_lpf_horizontal_4_dual_neon, 582 &vpx_highbd_lpf_horizontal_4_dual_c, 8), 583 make_tuple(&vpx_highbd_lpf_horizontal_4_dual_neon, 584 &vpx_highbd_lpf_horizontal_4_dual_c, 10), 585 make_tuple(&vpx_highbd_lpf_horizontal_4_dual_neon, 586 &vpx_highbd_lpf_horizontal_4_dual_c, 12), 587 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_neon, 588 &vpx_highbd_lpf_horizontal_8_dual_c, 8), 589 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_neon, 590 &vpx_highbd_lpf_horizontal_8_dual_c, 10), 591 make_tuple(&vpx_highbd_lpf_horizontal_8_dual_neon, 592 &vpx_highbd_lpf_horizontal_8_dual_c, 12), 593 make_tuple(&vpx_highbd_lpf_vertical_4_dual_neon, 594 &vpx_highbd_lpf_vertical_4_dual_c, 8), 595 make_tuple(&vpx_highbd_lpf_vertical_4_dual_neon, 596 &vpx_highbd_lpf_vertical_4_dual_c, 10), 597 make_tuple(&vpx_highbd_lpf_vertical_4_dual_neon, 598 &vpx_highbd_lpf_vertical_4_dual_c, 12), 599 make_tuple(&vpx_highbd_lpf_vertical_8_dual_neon, 600 &vpx_highbd_lpf_vertical_8_dual_c, 8), 601 make_tuple(&vpx_highbd_lpf_vertical_8_dual_neon, 602 &vpx_highbd_lpf_vertical_8_dual_c, 10), 603 make_tuple(&vpx_highbd_lpf_vertical_8_dual_neon, 604 &vpx_highbd_lpf_vertical_8_dual_c, 12))); 605 #else 606 INSTANTIATE_TEST_CASE_P( 607 NEON, Loop8Test6Param, 608 ::testing::Values( 609 make_tuple(&vpx_lpf_horizontal_16_neon, &vpx_lpf_horizontal_16_c, 8), 610 make_tuple(&vpx_lpf_horizontal_16_dual_neon, 611 &vpx_lpf_horizontal_16_dual_c, 8), 612 make_tuple(&vpx_lpf_vertical_16_neon, &vpx_lpf_vertical_16_c, 8), 613 make_tuple(&vpx_lpf_vertical_16_dual_neon, &vpx_lpf_vertical_16_dual_c, 614 8), 615 make_tuple(&vpx_lpf_horizontal_8_neon, &vpx_lpf_horizontal_8_c, 8), 616 make_tuple(&vpx_lpf_vertical_8_neon, &vpx_lpf_vertical_8_c, 8), 617 make_tuple(&vpx_lpf_horizontal_4_neon, &vpx_lpf_horizontal_4_c, 8), 618 make_tuple(&vpx_lpf_vertical_4_neon, &vpx_lpf_vertical_4_c, 8))); 619 INSTANTIATE_TEST_CASE_P( 620 NEON, Loop8Test9Param, 621 ::testing::Values(make_tuple(&vpx_lpf_horizontal_8_dual_neon, 622 &vpx_lpf_horizontal_8_dual_c, 8), 623 make_tuple(&vpx_lpf_vertical_8_dual_neon, 624 &vpx_lpf_vertical_8_dual_c, 8), 625 make_tuple(&vpx_lpf_horizontal_4_dual_neon, 626 &vpx_lpf_horizontal_4_dual_c, 8), 627 make_tuple(&vpx_lpf_vertical_4_dual_neon, 628 &vpx_lpf_vertical_4_dual_c, 8))); 629 #endif // CONFIG_VP9_HIGHBITDEPTH 630 #endif // HAVE_NEON 631 632 #if HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH 633 INSTANTIATE_TEST_CASE_P( 634 DSPR2, Loop8Test6Param, 635 ::testing::Values( 636 make_tuple(&vpx_lpf_horizontal_4_dspr2, &vpx_lpf_horizontal_4_c, 8), 637 make_tuple(&vpx_lpf_horizontal_8_dspr2, &vpx_lpf_horizontal_8_c, 8), 638 make_tuple(&vpx_lpf_horizontal_16_dspr2, &vpx_lpf_horizontal_16_c, 8), 639 make_tuple(&vpx_lpf_horizontal_16_dual_dspr2, 640 &vpx_lpf_horizontal_16_dual_c, 8), 641 make_tuple(&vpx_lpf_vertical_4_dspr2, &vpx_lpf_vertical_4_c, 8), 642 make_tuple(&vpx_lpf_vertical_8_dspr2, &vpx_lpf_vertical_8_c, 8), 643 make_tuple(&vpx_lpf_vertical_16_dspr2, &vpx_lpf_vertical_16_c, 8), 644 make_tuple(&vpx_lpf_vertical_16_dual_dspr2, &vpx_lpf_vertical_16_dual_c, 645 8))); 646 647 INSTANTIATE_TEST_CASE_P( 648 DSPR2, Loop8Test9Param, 649 ::testing::Values(make_tuple(&vpx_lpf_horizontal_4_dual_dspr2, 650 &vpx_lpf_horizontal_4_dual_c, 8), 651 make_tuple(&vpx_lpf_horizontal_8_dual_dspr2, 652 &vpx_lpf_horizontal_8_dual_c, 8), 653 make_tuple(&vpx_lpf_vertical_4_dual_dspr2, 654 &vpx_lpf_vertical_4_dual_c, 8), 655 make_tuple(&vpx_lpf_vertical_8_dual_dspr2, 656 &vpx_lpf_vertical_8_dual_c, 8))); 657 #endif // HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH 658 659 #if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH) 660 INSTANTIATE_TEST_CASE_P( 661 MSA, Loop8Test6Param, 662 ::testing::Values( 663 make_tuple(&vpx_lpf_horizontal_4_msa, &vpx_lpf_horizontal_4_c, 8), 664 make_tuple(&vpx_lpf_horizontal_8_msa, &vpx_lpf_horizontal_8_c, 8), 665 make_tuple(&vpx_lpf_horizontal_16_msa, &vpx_lpf_horizontal_16_c, 8), 666 make_tuple(&vpx_lpf_horizontal_16_dual_msa, 667 &vpx_lpf_horizontal_16_dual_c, 8), 668 make_tuple(&vpx_lpf_vertical_4_msa, &vpx_lpf_vertical_4_c, 8), 669 make_tuple(&vpx_lpf_vertical_8_msa, &vpx_lpf_vertical_8_c, 8), 670 make_tuple(&vpx_lpf_vertical_16_msa, &vpx_lpf_vertical_16_c, 8))); 671 672 INSTANTIATE_TEST_CASE_P( 673 MSA, Loop8Test9Param, 674 ::testing::Values(make_tuple(&vpx_lpf_horizontal_4_dual_msa, 675 &vpx_lpf_horizontal_4_dual_c, 8), 676 make_tuple(&vpx_lpf_horizontal_8_dual_msa, 677 &vpx_lpf_horizontal_8_dual_c, 8), 678 make_tuple(&vpx_lpf_vertical_4_dual_msa, 679 &vpx_lpf_vertical_4_dual_c, 8), 680 make_tuple(&vpx_lpf_vertical_8_dual_msa, 681 &vpx_lpf_vertical_8_dual_c, 8))); 682 #endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH) 683 684 } // namespace 685