1 /* 2 * Copyright (c) 2012 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 <cstdlib> 12 #include <new> 13 14 #include "third_party/googletest/src/include/gtest/gtest.h" 15 16 #include "./vpx_config.h" 17 #include "./vpx_dsp_rtcd.h" 18 #include "test/acm_random.h" 19 #include "test/clear_system_state.h" 20 #include "test/register_state_check.h" 21 #include "vpx/vpx_codec.h" 22 #include "vpx/vpx_integer.h" 23 #include "vpx_mem/vpx_mem.h" 24 #include "vpx_ports/mem.h" 25 26 namespace { 27 28 typedef unsigned int (*VarianceMxNFunc)(const uint8_t *a, int a_stride, 29 const uint8_t *b, int b_stride, 30 unsigned int *sse); 31 typedef unsigned int (*SubpixVarMxNFunc)(const uint8_t *a, int a_stride, 32 int xoffset, int yoffset, 33 const uint8_t *b, int b_stride, 34 unsigned int *sse); 35 typedef unsigned int (*SubpixAvgVarMxNFunc)(const uint8_t *a, int a_stride, 36 int xoffset, int yoffset, 37 const uint8_t *b, int b_stride, 38 uint32_t *sse, 39 const uint8_t *second_pred); 40 typedef unsigned int (*Get4x4SseFunc)(const uint8_t *a, int a_stride, 41 const uint8_t *b, int b_stride); 42 typedef unsigned int (*SumOfSquaresFunction)(const int16_t *src); 43 44 45 using ::std::tr1::get; 46 using ::std::tr1::make_tuple; 47 using ::std::tr1::tuple; 48 using libvpx_test::ACMRandom; 49 50 // Truncate high bit depth results by downshifting (with rounding) by: 51 // 2 * (bit_depth - 8) for sse 52 // (bit_depth - 8) for se 53 static void RoundHighBitDepth(int bit_depth, int64_t *se, uint64_t *sse) { 54 switch (bit_depth) { 55 case VPX_BITS_12: 56 *sse = (*sse + 128) >> 8; 57 *se = (*se + 8) >> 4; 58 break; 59 case VPX_BITS_10: 60 *sse = (*sse + 8) >> 4; 61 *se = (*se + 2) >> 2; 62 break; 63 case VPX_BITS_8: 64 default: 65 break; 66 } 67 } 68 69 static unsigned int mb_ss_ref(const int16_t *src) { 70 unsigned int res = 0; 71 for (int i = 0; i < 256; ++i) { 72 res += src[i] * src[i]; 73 } 74 return res; 75 } 76 77 static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref, 78 int l2w, int l2h, int src_stride_coeff, 79 int ref_stride_coeff, uint32_t *sse_ptr, 80 bool use_high_bit_depth_, 81 vpx_bit_depth_t bit_depth) { 82 int64_t se = 0; 83 uint64_t sse = 0; 84 const int w = 1 << l2w; 85 const int h = 1 << l2h; 86 for (int y = 0; y < h; y++) { 87 for (int x = 0; x < w; x++) { 88 int diff; 89 if (!use_high_bit_depth_) { 90 diff = ref[w * y * ref_stride_coeff + x] - 91 src[w * y * src_stride_coeff + x]; 92 se += diff; 93 sse += diff * diff; 94 #if CONFIG_VP9_HIGHBITDEPTH 95 } else { 96 diff = CONVERT_TO_SHORTPTR(ref)[w * y * ref_stride_coeff + x] - 97 CONVERT_TO_SHORTPTR(src)[w * y * src_stride_coeff + x]; 98 se += diff; 99 sse += diff * diff; 100 #endif // CONFIG_VP9_HIGHBITDEPTH 101 } 102 } 103 } 104 RoundHighBitDepth(bit_depth, &se, &sse); 105 *sse_ptr = static_cast<uint32_t>(sse); 106 return static_cast<uint32_t>(sse - 107 ((static_cast<int64_t>(se) * se) >> 108 (l2w + l2h))); 109 } 110 111 /* The subpel reference functions differ from the codec version in one aspect: 112 * they calculate the bilinear factors directly instead of using a lookup table 113 * and therefore upshift xoff and yoff by 1. Only every other calculated value 114 * is used so the codec version shrinks the table to save space and maintain 115 * compatibility with vp8. 116 */ 117 static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src, 118 int l2w, int l2h, int xoff, int yoff, 119 uint32_t *sse_ptr, 120 bool use_high_bit_depth_, 121 vpx_bit_depth_t bit_depth) { 122 int64_t se = 0; 123 uint64_t sse = 0; 124 const int w = 1 << l2w; 125 const int h = 1 << l2h; 126 127 xoff <<= 1; 128 yoff <<= 1; 129 130 for (int y = 0; y < h; y++) { 131 for (int x = 0; x < w; x++) { 132 // Bilinear interpolation at a 16th pel step. 133 if (!use_high_bit_depth_) { 134 const int a1 = ref[(w + 1) * (y + 0) + x + 0]; 135 const int a2 = ref[(w + 1) * (y + 0) + x + 1]; 136 const int b1 = ref[(w + 1) * (y + 1) + x + 0]; 137 const int b2 = ref[(w + 1) * (y + 1) + x + 1]; 138 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); 139 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); 140 const int r = a + (((b - a) * yoff + 8) >> 4); 141 const int diff = r - src[w * y + x]; 142 se += diff; 143 sse += diff * diff; 144 #if CONFIG_VP9_HIGHBITDEPTH 145 } else { 146 uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref); 147 uint16_t *src16 = CONVERT_TO_SHORTPTR(src); 148 const int a1 = ref16[(w + 1) * (y + 0) + x + 0]; 149 const int a2 = ref16[(w + 1) * (y + 0) + x + 1]; 150 const int b1 = ref16[(w + 1) * (y + 1) + x + 0]; 151 const int b2 = ref16[(w + 1) * (y + 1) + x + 1]; 152 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); 153 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); 154 const int r = a + (((b - a) * yoff + 8) >> 4); 155 const int diff = r - src16[w * y + x]; 156 se += diff; 157 sse += diff * diff; 158 #endif // CONFIG_VP9_HIGHBITDEPTH 159 } 160 } 161 } 162 RoundHighBitDepth(bit_depth, &se, &sse); 163 *sse_ptr = static_cast<uint32_t>(sse); 164 return static_cast<uint32_t>(sse - 165 ((static_cast<int64_t>(se) * se) >> 166 (l2w + l2h))); 167 } 168 169 class SumOfSquaresTest : public ::testing::TestWithParam<SumOfSquaresFunction> { 170 public: 171 SumOfSquaresTest() : func_(GetParam()) {} 172 173 virtual ~SumOfSquaresTest() { 174 libvpx_test::ClearSystemState(); 175 } 176 177 protected: 178 void ConstTest(); 179 void RefTest(); 180 181 SumOfSquaresFunction func_; 182 ACMRandom rnd_; 183 }; 184 185 void SumOfSquaresTest::ConstTest() { 186 int16_t mem[256]; 187 unsigned int res; 188 for (int v = 0; v < 256; ++v) { 189 for (int i = 0; i < 256; ++i) { 190 mem[i] = v; 191 } 192 ASM_REGISTER_STATE_CHECK(res = func_(mem)); 193 EXPECT_EQ(256u * (v * v), res); 194 } 195 } 196 197 void SumOfSquaresTest::RefTest() { 198 int16_t mem[256]; 199 for (int i = 0; i < 100; ++i) { 200 for (int j = 0; j < 256; ++j) { 201 mem[j] = rnd_.Rand8() - rnd_.Rand8(); 202 } 203 204 const unsigned int expected = mb_ss_ref(mem); 205 unsigned int res; 206 ASM_REGISTER_STATE_CHECK(res = func_(mem)); 207 EXPECT_EQ(expected, res); 208 } 209 } 210 211 template<typename VarianceFunctionType> 212 class VarianceTest 213 : public ::testing::TestWithParam<tuple<int, int, 214 VarianceFunctionType, int> > { 215 public: 216 virtual void SetUp() { 217 const tuple<int, int, VarianceFunctionType, int>& params = this->GetParam(); 218 log2width_ = get<0>(params); 219 width_ = 1 << log2width_; 220 log2height_ = get<1>(params); 221 height_ = 1 << log2height_; 222 variance_ = get<2>(params); 223 if (get<3>(params)) { 224 bit_depth_ = static_cast<vpx_bit_depth_t>(get<3>(params)); 225 use_high_bit_depth_ = true; 226 } else { 227 bit_depth_ = VPX_BITS_8; 228 use_high_bit_depth_ = false; 229 } 230 mask_ = (1 << bit_depth_) - 1; 231 232 rnd_.Reset(ACMRandom::DeterministicSeed()); 233 block_size_ = width_ * height_; 234 if (!use_high_bit_depth_) { 235 src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_ * 2)); 236 ref_ = new uint8_t[block_size_ * 2]; 237 #if CONFIG_VP9_HIGHBITDEPTH 238 } else { 239 src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>( 240 vpx_memalign(16, block_size_ * 2 * sizeof(uint16_t)))); 241 ref_ = CONVERT_TO_BYTEPTR(new uint16_t[block_size_ * 2]); 242 #endif // CONFIG_VP9_HIGHBITDEPTH 243 } 244 ASSERT_TRUE(src_ != NULL); 245 ASSERT_TRUE(ref_ != NULL); 246 } 247 248 virtual void TearDown() { 249 if (!use_high_bit_depth_) { 250 vpx_free(src_); 251 delete[] ref_; 252 #if CONFIG_VP9_HIGHBITDEPTH 253 } else { 254 vpx_free(CONVERT_TO_SHORTPTR(src_)); 255 delete[] CONVERT_TO_SHORTPTR(ref_); 256 #endif // CONFIG_VP9_HIGHBITDEPTH 257 } 258 libvpx_test::ClearSystemState(); 259 } 260 261 protected: 262 void ZeroTest(); 263 void RefTest(); 264 void RefStrideTest(); 265 void OneQuarterTest(); 266 267 ACMRandom rnd_; 268 uint8_t *src_; 269 uint8_t *ref_; 270 int width_, log2width_; 271 int height_, log2height_; 272 vpx_bit_depth_t bit_depth_; 273 int mask_; 274 bool use_high_bit_depth_; 275 int block_size_; 276 VarianceFunctionType variance_; 277 }; 278 279 template<typename VarianceFunctionType> 280 void VarianceTest<VarianceFunctionType>::ZeroTest() { 281 for (int i = 0; i <= 255; ++i) { 282 if (!use_high_bit_depth_) { 283 memset(src_, i, block_size_); 284 #if CONFIG_VP9_HIGHBITDEPTH 285 } else { 286 vpx_memset16(CONVERT_TO_SHORTPTR(src_), i << (bit_depth_ - 8), 287 block_size_); 288 #endif // CONFIG_VP9_HIGHBITDEPTH 289 } 290 for (int j = 0; j <= 255; ++j) { 291 if (!use_high_bit_depth_) { 292 memset(ref_, j, block_size_); 293 #if CONFIG_VP9_HIGHBITDEPTH 294 } else { 295 vpx_memset16(CONVERT_TO_SHORTPTR(ref_), j << (bit_depth_ - 8), 296 block_size_); 297 #endif // CONFIG_VP9_HIGHBITDEPTH 298 } 299 unsigned int sse; 300 unsigned int var; 301 ASM_REGISTER_STATE_CHECK( 302 var = variance_(src_, width_, ref_, width_, &sse)); 303 EXPECT_EQ(0u, var) << "src values: " << i << " ref values: " << j; 304 } 305 } 306 } 307 308 template<typename VarianceFunctionType> 309 void VarianceTest<VarianceFunctionType>::RefTest() { 310 for (int i = 0; i < 10; ++i) { 311 for (int j = 0; j < block_size_; j++) { 312 if (!use_high_bit_depth_) { 313 src_[j] = rnd_.Rand8(); 314 ref_[j] = rnd_.Rand8(); 315 #if CONFIG_VP9_HIGHBITDEPTH 316 } else { 317 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() && mask_; 318 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() && mask_; 319 #endif // CONFIG_VP9_HIGHBITDEPTH 320 } 321 } 322 unsigned int sse1, sse2; 323 unsigned int var1; 324 const int stride_coeff = 1; 325 ASM_REGISTER_STATE_CHECK( 326 var1 = variance_(src_, width_, ref_, width_, &sse1)); 327 const unsigned int var2 = variance_ref(src_, ref_, log2width_, 328 log2height_, stride_coeff, 329 stride_coeff, &sse2, 330 use_high_bit_depth_, bit_depth_); 331 EXPECT_EQ(sse1, sse2); 332 EXPECT_EQ(var1, var2); 333 } 334 } 335 336 template<typename VarianceFunctionType> 337 void VarianceTest<VarianceFunctionType>::RefStrideTest() { 338 for (int i = 0; i < 10; ++i) { 339 int ref_stride_coeff = i % 2; 340 int src_stride_coeff = (i >> 1) % 2; 341 for (int j = 0; j < block_size_; j++) { 342 int ref_ind = (j / width_) * ref_stride_coeff * width_ + j % width_; 343 int src_ind = (j / width_) * src_stride_coeff * width_ + j % width_; 344 if (!use_high_bit_depth_) { 345 src_[src_ind] = rnd_.Rand8(); 346 ref_[ref_ind] = rnd_.Rand8(); 347 #if CONFIG_VP9_HIGHBITDEPTH 348 } else { 349 CONVERT_TO_SHORTPTR(src_)[src_ind] = rnd_.Rand16() && mask_; 350 CONVERT_TO_SHORTPTR(ref_)[ref_ind] = rnd_.Rand16() && mask_; 351 #endif // CONFIG_VP9_HIGHBITDEPTH 352 } 353 } 354 unsigned int sse1, sse2; 355 unsigned int var1; 356 357 ASM_REGISTER_STATE_CHECK( 358 var1 = variance_(src_, width_ * src_stride_coeff, 359 ref_, width_ * ref_stride_coeff, &sse1)); 360 const unsigned int var2 = variance_ref(src_, ref_, log2width_, 361 log2height_, src_stride_coeff, 362 ref_stride_coeff, &sse2, 363 use_high_bit_depth_, bit_depth_); 364 EXPECT_EQ(sse1, sse2); 365 EXPECT_EQ(var1, var2); 366 } 367 } 368 369 template<typename VarianceFunctionType> 370 void VarianceTest<VarianceFunctionType>::OneQuarterTest() { 371 const int half = block_size_ / 2; 372 if (!use_high_bit_depth_) { 373 memset(src_, 255, block_size_); 374 memset(ref_, 255, half); 375 memset(ref_ + half, 0, half); 376 #if CONFIG_VP9_HIGHBITDEPTH 377 } else { 378 vpx_memset16(CONVERT_TO_SHORTPTR(src_), 255 << (bit_depth_ - 8), 379 block_size_); 380 vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << (bit_depth_ - 8), half); 381 vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half); 382 #endif // CONFIG_VP9_HIGHBITDEPTH 383 } 384 unsigned int sse; 385 unsigned int var; 386 ASM_REGISTER_STATE_CHECK(var = variance_(src_, width_, ref_, width_, &sse)); 387 const unsigned int expected = block_size_ * 255 * 255 / 4; 388 EXPECT_EQ(expected, var); 389 } 390 391 template<typename MseFunctionType> 392 class MseTest 393 : public ::testing::TestWithParam<tuple<int, int, MseFunctionType> > { 394 public: 395 virtual void SetUp() { 396 const tuple<int, int, MseFunctionType>& params = this->GetParam(); 397 log2width_ = get<0>(params); 398 width_ = 1 << log2width_; 399 log2height_ = get<1>(params); 400 height_ = 1 << log2height_; 401 mse_ = get<2>(params); 402 403 rnd(ACMRandom::DeterministicSeed()); 404 block_size_ = width_ * height_; 405 src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_)); 406 ref_ = new uint8_t[block_size_]; 407 ASSERT_TRUE(src_ != NULL); 408 ASSERT_TRUE(ref_ != NULL); 409 } 410 411 virtual void TearDown() { 412 vpx_free(src_); 413 delete[] ref_; 414 libvpx_test::ClearSystemState(); 415 } 416 417 protected: 418 void RefTest_mse(); 419 void RefTest_sse(); 420 void MaxTest_mse(); 421 void MaxTest_sse(); 422 423 ACMRandom rnd; 424 uint8_t* src_; 425 uint8_t* ref_; 426 int width_, log2width_; 427 int height_, log2height_; 428 int block_size_; 429 MseFunctionType mse_; 430 }; 431 432 template<typename MseFunctionType> 433 void MseTest<MseFunctionType>::RefTest_mse() { 434 for (int i = 0; i < 10; ++i) { 435 for (int j = 0; j < block_size_; j++) { 436 src_[j] = rnd.Rand8(); 437 ref_[j] = rnd.Rand8(); 438 } 439 unsigned int sse1, sse2; 440 const int stride_coeff = 1; 441 ASM_REGISTER_STATE_CHECK(mse_(src_, width_, ref_, width_, &sse1)); 442 variance_ref(src_, ref_, log2width_, log2height_, stride_coeff, 443 stride_coeff, &sse2, false, VPX_BITS_8); 444 EXPECT_EQ(sse1, sse2); 445 } 446 } 447 448 template<typename MseFunctionType> 449 void MseTest<MseFunctionType>::RefTest_sse() { 450 for (int i = 0; i < 10; ++i) { 451 for (int j = 0; j < block_size_; j++) { 452 src_[j] = rnd.Rand8(); 453 ref_[j] = rnd.Rand8(); 454 } 455 unsigned int sse2; 456 unsigned int var1; 457 const int stride_coeff = 1; 458 ASM_REGISTER_STATE_CHECK(var1 = mse_(src_, width_, ref_, width_)); 459 variance_ref(src_, ref_, log2width_, log2height_, stride_coeff, 460 stride_coeff, &sse2, false, VPX_BITS_8); 461 EXPECT_EQ(var1, sse2); 462 } 463 } 464 465 template<typename MseFunctionType> 466 void MseTest<MseFunctionType>::MaxTest_mse() { 467 memset(src_, 255, block_size_); 468 memset(ref_, 0, block_size_); 469 unsigned int sse; 470 ASM_REGISTER_STATE_CHECK(mse_(src_, width_, ref_, width_, &sse)); 471 const unsigned int expected = block_size_ * 255 * 255; 472 EXPECT_EQ(expected, sse); 473 } 474 475 template<typename MseFunctionType> 476 void MseTest<MseFunctionType>::MaxTest_sse() { 477 memset(src_, 255, block_size_); 478 memset(ref_, 0, block_size_); 479 unsigned int var; 480 ASM_REGISTER_STATE_CHECK(var = mse_(src_, width_, ref_, width_)); 481 const unsigned int expected = block_size_ * 255 * 255; 482 EXPECT_EQ(expected, var); 483 } 484 485 static uint32_t subpel_avg_variance_ref(const uint8_t *ref, 486 const uint8_t *src, 487 const uint8_t *second_pred, 488 int l2w, int l2h, 489 int xoff, int yoff, 490 uint32_t *sse_ptr, 491 bool use_high_bit_depth, 492 vpx_bit_depth_t bit_depth) { 493 int64_t se = 0; 494 uint64_t sse = 0; 495 const int w = 1 << l2w; 496 const int h = 1 << l2h; 497 498 xoff <<= 1; 499 yoff <<= 1; 500 501 for (int y = 0; y < h; y++) { 502 for (int x = 0; x < w; x++) { 503 // bilinear interpolation at a 16th pel step 504 if (!use_high_bit_depth) { 505 const int a1 = ref[(w + 1) * (y + 0) + x + 0]; 506 const int a2 = ref[(w + 1) * (y + 0) + x + 1]; 507 const int b1 = ref[(w + 1) * (y + 1) + x + 0]; 508 const int b2 = ref[(w + 1) * (y + 1) + x + 1]; 509 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); 510 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); 511 const int r = a + (((b - a) * yoff + 8) >> 4); 512 const int diff = ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x]; 513 se += diff; 514 sse += diff * diff; 515 #if CONFIG_VP9_HIGHBITDEPTH 516 } else { 517 uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref); 518 uint16_t *src16 = CONVERT_TO_SHORTPTR(src); 519 uint16_t *sec16 = CONVERT_TO_SHORTPTR(second_pred); 520 const int a1 = ref16[(w + 1) * (y + 0) + x + 0]; 521 const int a2 = ref16[(w + 1) * (y + 0) + x + 1]; 522 const int b1 = ref16[(w + 1) * (y + 1) + x + 0]; 523 const int b2 = ref16[(w + 1) * (y + 1) + x + 1]; 524 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); 525 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); 526 const int r = a + (((b - a) * yoff + 8) >> 4); 527 const int diff = ((r + sec16[w * y + x] + 1) >> 1) - src16[w * y + x]; 528 se += diff; 529 sse += diff * diff; 530 #endif // CONFIG_VP9_HIGHBITDEPTH 531 } 532 } 533 } 534 RoundHighBitDepth(bit_depth, &se, &sse); 535 *sse_ptr = static_cast<uint32_t>(sse); 536 return static_cast<uint32_t>(sse - 537 ((static_cast<int64_t>(se) * se) >> 538 (l2w + l2h))); 539 } 540 541 template<typename SubpelVarianceFunctionType> 542 class SubpelVarianceTest 543 : public ::testing::TestWithParam<tuple<int, int, 544 SubpelVarianceFunctionType, int> > { 545 public: 546 virtual void SetUp() { 547 const tuple<int, int, SubpelVarianceFunctionType, int>& params = 548 this->GetParam(); 549 log2width_ = get<0>(params); 550 width_ = 1 << log2width_; 551 log2height_ = get<1>(params); 552 height_ = 1 << log2height_; 553 subpel_variance_ = get<2>(params); 554 if (get<3>(params)) { 555 bit_depth_ = (vpx_bit_depth_t) get<3>(params); 556 use_high_bit_depth_ = true; 557 } else { 558 bit_depth_ = VPX_BITS_8; 559 use_high_bit_depth_ = false; 560 } 561 mask_ = (1 << bit_depth_)-1; 562 563 rnd_.Reset(ACMRandom::DeterministicSeed()); 564 block_size_ = width_ * height_; 565 if (!use_high_bit_depth_) { 566 src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_)); 567 sec_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_)); 568 ref_ = new uint8_t[block_size_ + width_ + height_ + 1]; 569 #if CONFIG_VP9_HIGHBITDEPTH 570 } else { 571 src_ = CONVERT_TO_BYTEPTR( 572 reinterpret_cast<uint16_t *>( 573 vpx_memalign(16, block_size_*sizeof(uint16_t)))); 574 sec_ = CONVERT_TO_BYTEPTR( 575 reinterpret_cast<uint16_t *>( 576 vpx_memalign(16, block_size_*sizeof(uint16_t)))); 577 ref_ = CONVERT_TO_BYTEPTR( 578 new uint16_t[block_size_ + width_ + height_ + 1]); 579 #endif // CONFIG_VP9_HIGHBITDEPTH 580 } 581 ASSERT_TRUE(src_ != NULL); 582 ASSERT_TRUE(sec_ != NULL); 583 ASSERT_TRUE(ref_ != NULL); 584 } 585 586 virtual void TearDown() { 587 if (!use_high_bit_depth_) { 588 vpx_free(src_); 589 delete[] ref_; 590 vpx_free(sec_); 591 #if CONFIG_VP9_HIGHBITDEPTH 592 } else { 593 vpx_free(CONVERT_TO_SHORTPTR(src_)); 594 delete[] CONVERT_TO_SHORTPTR(ref_); 595 vpx_free(CONVERT_TO_SHORTPTR(sec_)); 596 #endif // CONFIG_VP9_HIGHBITDEPTH 597 } 598 libvpx_test::ClearSystemState(); 599 } 600 601 protected: 602 void RefTest(); 603 void ExtremeRefTest(); 604 605 ACMRandom rnd_; 606 uint8_t *src_; 607 uint8_t *ref_; 608 uint8_t *sec_; 609 bool use_high_bit_depth_; 610 vpx_bit_depth_t bit_depth_; 611 int width_, log2width_; 612 int height_, log2height_; 613 int block_size_, mask_; 614 SubpelVarianceFunctionType subpel_variance_; 615 }; 616 617 template<typename SubpelVarianceFunctionType> 618 void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() { 619 for (int x = 0; x < 8; ++x) { 620 for (int y = 0; y < 8; ++y) { 621 if (!use_high_bit_depth_) { 622 for (int j = 0; j < block_size_; j++) { 623 src_[j] = rnd_.Rand8(); 624 } 625 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { 626 ref_[j] = rnd_.Rand8(); 627 } 628 #if CONFIG_VP9_HIGHBITDEPTH 629 } else { 630 for (int j = 0; j < block_size_; j++) { 631 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_; 632 } 633 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { 634 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_; 635 } 636 #endif // CONFIG_VP9_HIGHBITDEPTH 637 } 638 unsigned int sse1, sse2; 639 unsigned int var1; 640 ASM_REGISTER_STATE_CHECK(var1 = subpel_variance_(ref_, width_ + 1, x, y, 641 src_, width_, &sse1)); 642 const unsigned int var2 = subpel_variance_ref(ref_, src_, 643 log2width_, log2height_, 644 x, y, &sse2, 645 use_high_bit_depth_, 646 bit_depth_); 647 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; 648 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; 649 } 650 } 651 } 652 653 template<typename SubpelVarianceFunctionType> 654 void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() { 655 // Compare against reference. 656 // Src: Set the first half of values to 0, the second half to the maximum. 657 // Ref: Set the first half of values to the maximum, the second half to 0. 658 for (int x = 0; x < 8; ++x) { 659 for (int y = 0; y < 8; ++y) { 660 const int half = block_size_ / 2; 661 if (!use_high_bit_depth_) { 662 memset(src_, 0, half); 663 memset(src_ + half, 255, half); 664 memset(ref_, 255, half); 665 memset(ref_ + half, 0, half + width_ + height_ + 1); 666 #if CONFIG_VP9_HIGHBITDEPTH 667 } else { 668 vpx_memset16(CONVERT_TO_SHORTPTR(src_), mask_, half); 669 vpx_memset16(CONVERT_TO_SHORTPTR(src_) + half, 0, half); 670 vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 0, half); 671 vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask_, 672 half + width_ + height_ + 1); 673 #endif // CONFIG_VP9_HIGHBITDEPTH 674 } 675 unsigned int sse1, sse2; 676 unsigned int var1; 677 ASM_REGISTER_STATE_CHECK( 678 var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1)); 679 const unsigned int var2 = 680 subpel_variance_ref(ref_, src_, log2width_, log2height_, 681 x, y, &sse2, use_high_bit_depth_, bit_depth_); 682 EXPECT_EQ(sse1, sse2) << "for xoffset " << x << " and yoffset " << y; 683 EXPECT_EQ(var1, var2) << "for xoffset " << x << " and yoffset " << y; 684 } 685 } 686 } 687 688 template<> 689 void SubpelVarianceTest<SubpixAvgVarMxNFunc>::RefTest() { 690 for (int x = 0; x < 8; ++x) { 691 for (int y = 0; y < 8; ++y) { 692 if (!use_high_bit_depth_) { 693 for (int j = 0; j < block_size_; j++) { 694 src_[j] = rnd_.Rand8(); 695 sec_[j] = rnd_.Rand8(); 696 } 697 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { 698 ref_[j] = rnd_.Rand8(); 699 } 700 #if CONFIG_VP9_HIGHBITDEPTH 701 } else { 702 for (int j = 0; j < block_size_; j++) { 703 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_; 704 CONVERT_TO_SHORTPTR(sec_)[j] = rnd_.Rand16() & mask_; 705 } 706 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { 707 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_; 708 } 709 #endif // CONFIG_VP9_HIGHBITDEPTH 710 } 711 unsigned int sse1, sse2; 712 unsigned int var1; 713 ASM_REGISTER_STATE_CHECK( 714 var1 = subpel_variance_(ref_, width_ + 1, x, y, 715 src_, width_, &sse1, sec_)); 716 const unsigned int var2 = subpel_avg_variance_ref(ref_, src_, sec_, 717 log2width_, log2height_, 718 x, y, &sse2, 719 use_high_bit_depth_, 720 bit_depth_); 721 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; 722 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; 723 } 724 } 725 } 726 727 typedef MseTest<Get4x4SseFunc> VpxSseTest; 728 typedef MseTest<VarianceMxNFunc> VpxMseTest; 729 typedef VarianceTest<VarianceMxNFunc> VpxVarianceTest; 730 typedef SubpelVarianceTest<SubpixVarMxNFunc> VpxSubpelVarianceTest; 731 typedef SubpelVarianceTest<SubpixAvgVarMxNFunc> VpxSubpelAvgVarianceTest; 732 733 TEST_P(VpxSseTest, Ref_sse) { RefTest_sse(); } 734 TEST_P(VpxSseTest, Max_sse) { MaxTest_sse(); } 735 TEST_P(VpxMseTest, Ref_mse) { RefTest_mse(); } 736 TEST_P(VpxMseTest, Max_mse) { MaxTest_mse(); } 737 TEST_P(VpxVarianceTest, Zero) { ZeroTest(); } 738 TEST_P(VpxVarianceTest, Ref) { RefTest(); } 739 TEST_P(VpxVarianceTest, RefStride) { RefStrideTest(); } 740 TEST_P(VpxVarianceTest, OneQuarter) { OneQuarterTest(); } 741 TEST_P(SumOfSquaresTest, Const) { ConstTest(); } 742 TEST_P(SumOfSquaresTest, Ref) { RefTest(); } 743 TEST_P(VpxSubpelVarianceTest, Ref) { RefTest(); } 744 TEST_P(VpxSubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); } 745 TEST_P(VpxSubpelAvgVarianceTest, Ref) { RefTest(); } 746 747 INSTANTIATE_TEST_CASE_P(C, SumOfSquaresTest, 748 ::testing::Values(vpx_get_mb_ss_c)); 749 750 const Get4x4SseFunc get4x4sse_cs_c = vpx_get4x4sse_cs_c; 751 INSTANTIATE_TEST_CASE_P(C, VpxSseTest, 752 ::testing::Values(make_tuple(2, 2, get4x4sse_cs_c))); 753 754 const VarianceMxNFunc mse16x16_c = vpx_mse16x16_c; 755 const VarianceMxNFunc mse16x8_c = vpx_mse16x8_c; 756 const VarianceMxNFunc mse8x16_c = vpx_mse8x16_c; 757 const VarianceMxNFunc mse8x8_c = vpx_mse8x8_c; 758 INSTANTIATE_TEST_CASE_P(C, VpxMseTest, 759 ::testing::Values(make_tuple(4, 4, mse16x16_c), 760 make_tuple(4, 3, mse16x8_c), 761 make_tuple(3, 4, mse8x16_c), 762 make_tuple(3, 3, mse8x8_c))); 763 764 const VarianceMxNFunc variance64x64_c = vpx_variance64x64_c; 765 const VarianceMxNFunc variance64x32_c = vpx_variance64x32_c; 766 const VarianceMxNFunc variance32x64_c = vpx_variance32x64_c; 767 const VarianceMxNFunc variance32x32_c = vpx_variance32x32_c; 768 const VarianceMxNFunc variance32x16_c = vpx_variance32x16_c; 769 const VarianceMxNFunc variance16x32_c = vpx_variance16x32_c; 770 const VarianceMxNFunc variance16x16_c = vpx_variance16x16_c; 771 const VarianceMxNFunc variance16x8_c = vpx_variance16x8_c; 772 const VarianceMxNFunc variance8x16_c = vpx_variance8x16_c; 773 const VarianceMxNFunc variance8x8_c = vpx_variance8x8_c; 774 const VarianceMxNFunc variance8x4_c = vpx_variance8x4_c; 775 const VarianceMxNFunc variance4x8_c = vpx_variance4x8_c; 776 const VarianceMxNFunc variance4x4_c = vpx_variance4x4_c; 777 INSTANTIATE_TEST_CASE_P( 778 C, VpxVarianceTest, 779 ::testing::Values(make_tuple(6, 6, variance64x64_c, 0), 780 make_tuple(6, 5, variance64x32_c, 0), 781 make_tuple(5, 6, variance32x64_c, 0), 782 make_tuple(5, 5, variance32x32_c, 0), 783 make_tuple(5, 4, variance32x16_c, 0), 784 make_tuple(4, 5, variance16x32_c, 0), 785 make_tuple(4, 4, variance16x16_c, 0), 786 make_tuple(4, 3, variance16x8_c, 0), 787 make_tuple(3, 4, variance8x16_c, 0), 788 make_tuple(3, 3, variance8x8_c, 0), 789 make_tuple(3, 2, variance8x4_c, 0), 790 make_tuple(2, 3, variance4x8_c, 0), 791 make_tuple(2, 2, variance4x4_c, 0))); 792 793 const SubpixVarMxNFunc subpel_var64x64_c = vpx_sub_pixel_variance64x64_c; 794 const SubpixVarMxNFunc subpel_var64x32_c = vpx_sub_pixel_variance64x32_c; 795 const SubpixVarMxNFunc subpel_var32x64_c = vpx_sub_pixel_variance32x64_c; 796 const SubpixVarMxNFunc subpel_var32x32_c = vpx_sub_pixel_variance32x32_c; 797 const SubpixVarMxNFunc subpel_var32x16_c = vpx_sub_pixel_variance32x16_c; 798 const SubpixVarMxNFunc subpel_var16x32_c = vpx_sub_pixel_variance16x32_c; 799 const SubpixVarMxNFunc subpel_var16x16_c = vpx_sub_pixel_variance16x16_c; 800 const SubpixVarMxNFunc subpel_var16x8_c = vpx_sub_pixel_variance16x8_c; 801 const SubpixVarMxNFunc subpel_var8x16_c = vpx_sub_pixel_variance8x16_c; 802 const SubpixVarMxNFunc subpel_var8x8_c = vpx_sub_pixel_variance8x8_c; 803 const SubpixVarMxNFunc subpel_var8x4_c = vpx_sub_pixel_variance8x4_c; 804 const SubpixVarMxNFunc subpel_var4x8_c = vpx_sub_pixel_variance4x8_c; 805 const SubpixVarMxNFunc subpel_var4x4_c = vpx_sub_pixel_variance4x4_c; 806 INSTANTIATE_TEST_CASE_P( 807 C, VpxSubpelVarianceTest, 808 ::testing::Values(make_tuple(6, 6, subpel_var64x64_c, 0), 809 make_tuple(6, 5, subpel_var64x32_c, 0), 810 make_tuple(5, 6, subpel_var32x64_c, 0), 811 make_tuple(5, 5, subpel_var32x32_c, 0), 812 make_tuple(5, 4, subpel_var32x16_c, 0), 813 make_tuple(4, 5, subpel_var16x32_c, 0), 814 make_tuple(4, 4, subpel_var16x16_c, 0), 815 make_tuple(4, 3, subpel_var16x8_c, 0), 816 make_tuple(3, 4, subpel_var8x16_c, 0), 817 make_tuple(3, 3, subpel_var8x8_c, 0), 818 make_tuple(3, 2, subpel_var8x4_c, 0), 819 make_tuple(2, 3, subpel_var4x8_c, 0), 820 make_tuple(2, 2, subpel_var4x4_c, 0))); 821 822 const SubpixAvgVarMxNFunc subpel_avg_var64x64_c = 823 vpx_sub_pixel_avg_variance64x64_c; 824 const SubpixAvgVarMxNFunc subpel_avg_var64x32_c = 825 vpx_sub_pixel_avg_variance64x32_c; 826 const SubpixAvgVarMxNFunc subpel_avg_var32x64_c = 827 vpx_sub_pixel_avg_variance32x64_c; 828 const SubpixAvgVarMxNFunc subpel_avg_var32x32_c = 829 vpx_sub_pixel_avg_variance32x32_c; 830 const SubpixAvgVarMxNFunc subpel_avg_var32x16_c = 831 vpx_sub_pixel_avg_variance32x16_c; 832 const SubpixAvgVarMxNFunc subpel_avg_var16x32_c = 833 vpx_sub_pixel_avg_variance16x32_c; 834 const SubpixAvgVarMxNFunc subpel_avg_var16x16_c = 835 vpx_sub_pixel_avg_variance16x16_c; 836 const SubpixAvgVarMxNFunc subpel_avg_var16x8_c = 837 vpx_sub_pixel_avg_variance16x8_c; 838 const SubpixAvgVarMxNFunc subpel_avg_var8x16_c = 839 vpx_sub_pixel_avg_variance8x16_c; 840 const SubpixAvgVarMxNFunc subpel_avg_var8x8_c = vpx_sub_pixel_avg_variance8x8_c; 841 const SubpixAvgVarMxNFunc subpel_avg_var8x4_c = vpx_sub_pixel_avg_variance8x4_c; 842 const SubpixAvgVarMxNFunc subpel_avg_var4x8_c = vpx_sub_pixel_avg_variance4x8_c; 843 const SubpixAvgVarMxNFunc subpel_avg_var4x4_c = vpx_sub_pixel_avg_variance4x4_c; 844 INSTANTIATE_TEST_CASE_P( 845 C, VpxSubpelAvgVarianceTest, 846 ::testing::Values(make_tuple(6, 6, subpel_avg_var64x64_c, 0), 847 make_tuple(6, 5, subpel_avg_var64x32_c, 0), 848 make_tuple(5, 6, subpel_avg_var32x64_c, 0), 849 make_tuple(5, 5, subpel_avg_var32x32_c, 0), 850 make_tuple(5, 4, subpel_avg_var32x16_c, 0), 851 make_tuple(4, 5, subpel_avg_var16x32_c, 0), 852 make_tuple(4, 4, subpel_avg_var16x16_c, 0), 853 make_tuple(4, 3, subpel_avg_var16x8_c, 0), 854 make_tuple(3, 4, subpel_avg_var8x16_c, 0), 855 make_tuple(3, 3, subpel_avg_var8x8_c, 0), 856 make_tuple(3, 2, subpel_avg_var8x4_c, 0), 857 make_tuple(2, 3, subpel_avg_var4x8_c, 0), 858 make_tuple(2, 2, subpel_avg_var4x4_c, 0))); 859 860 #if CONFIG_VP9_HIGHBITDEPTH 861 typedef MseTest<VarianceMxNFunc> VpxHBDMseTest; 862 typedef VarianceTest<VarianceMxNFunc> VpxHBDVarianceTest; 863 typedef SubpelVarianceTest<SubpixVarMxNFunc> VpxHBDSubpelVarianceTest; 864 typedef SubpelVarianceTest<SubpixAvgVarMxNFunc> 865 VpxHBDSubpelAvgVarianceTest; 866 867 TEST_P(VpxHBDMseTest, Ref_mse) { RefTest_mse(); } 868 TEST_P(VpxHBDMseTest, Max_mse) { MaxTest_mse(); } 869 TEST_P(VpxHBDVarianceTest, Zero) { ZeroTest(); } 870 TEST_P(VpxHBDVarianceTest, Ref) { RefTest(); } 871 TEST_P(VpxHBDVarianceTest, RefStride) { RefStrideTest(); } 872 TEST_P(VpxHBDVarianceTest, OneQuarter) { OneQuarterTest(); } 873 TEST_P(VpxHBDSubpelVarianceTest, Ref) { RefTest(); } 874 TEST_P(VpxHBDSubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); } 875 TEST_P(VpxHBDSubpelAvgVarianceTest, Ref) { RefTest(); } 876 877 /* TODO(debargha): This test does not support the highbd version 878 const VarianceMxNFunc highbd_12_mse16x16_c = vpx_highbd_12_mse16x16_c; 879 const VarianceMxNFunc highbd_12_mse16x8_c = vpx_highbd_12_mse16x8_c; 880 const VarianceMxNFunc highbd_12_mse8x16_c = vpx_highbd_12_mse8x16_c; 881 const VarianceMxNFunc highbd_12_mse8x8_c = vpx_highbd_12_mse8x8_c; 882 883 const VarianceMxNFunc highbd_10_mse16x16_c = vpx_highbd_10_mse16x16_c; 884 const VarianceMxNFunc highbd_10_mse16x8_c = vpx_highbd_10_mse16x8_c; 885 const VarianceMxNFunc highbd_10_mse8x16_c = vpx_highbd_10_mse8x16_c; 886 const VarianceMxNFunc highbd_10_mse8x8_c = vpx_highbd_10_mse8x8_c; 887 888 const VarianceMxNFunc highbd_8_mse16x16_c = vpx_highbd_8_mse16x16_c; 889 const VarianceMxNFunc highbd_8_mse16x8_c = vpx_highbd_8_mse16x8_c; 890 const VarianceMxNFunc highbd_8_mse8x16_c = vpx_highbd_8_mse8x16_c; 891 const VarianceMxNFunc highbd_8_mse8x8_c = vpx_highbd_8_mse8x8_c; 892 INSTANTIATE_TEST_CASE_P( 893 C, VpxHBDMseTest, ::testing::Values(make_tuple(4, 4, highbd_12_mse16x16_c), 894 make_tuple(4, 4, highbd_12_mse16x8_c), 895 make_tuple(4, 4, highbd_12_mse8x16_c), 896 make_tuple(4, 4, highbd_12_mse8x8_c), 897 make_tuple(4, 4, highbd_10_mse16x16_c), 898 make_tuple(4, 4, highbd_10_mse16x8_c), 899 make_tuple(4, 4, highbd_10_mse8x16_c), 900 make_tuple(4, 4, highbd_10_mse8x8_c), 901 make_tuple(4, 4, highbd_8_mse16x16_c), 902 make_tuple(4, 4, highbd_8_mse16x8_c), 903 make_tuple(4, 4, highbd_8_mse8x16_c), 904 make_tuple(4, 4, highbd_8_mse8x8_c))); 905 */ 906 907 const VarianceMxNFunc highbd_12_variance64x64_c = vpx_highbd_12_variance64x64_c; 908 const VarianceMxNFunc highbd_12_variance64x32_c = vpx_highbd_12_variance64x32_c; 909 const VarianceMxNFunc highbd_12_variance32x64_c = vpx_highbd_12_variance32x64_c; 910 const VarianceMxNFunc highbd_12_variance32x32_c = vpx_highbd_12_variance32x32_c; 911 const VarianceMxNFunc highbd_12_variance32x16_c = vpx_highbd_12_variance32x16_c; 912 const VarianceMxNFunc highbd_12_variance16x32_c = vpx_highbd_12_variance16x32_c; 913 const VarianceMxNFunc highbd_12_variance16x16_c = vpx_highbd_12_variance16x16_c; 914 const VarianceMxNFunc highbd_12_variance16x8_c = vpx_highbd_12_variance16x8_c; 915 const VarianceMxNFunc highbd_12_variance8x16_c = vpx_highbd_12_variance8x16_c; 916 const VarianceMxNFunc highbd_12_variance8x8_c = vpx_highbd_12_variance8x8_c; 917 const VarianceMxNFunc highbd_12_variance8x4_c = vpx_highbd_12_variance8x4_c; 918 const VarianceMxNFunc highbd_12_variance4x8_c = vpx_highbd_12_variance4x8_c; 919 const VarianceMxNFunc highbd_12_variance4x4_c = vpx_highbd_12_variance4x4_c; 920 const VarianceMxNFunc highbd_10_variance64x64_c = vpx_highbd_10_variance64x64_c; 921 const VarianceMxNFunc highbd_10_variance64x32_c = vpx_highbd_10_variance64x32_c; 922 const VarianceMxNFunc highbd_10_variance32x64_c = vpx_highbd_10_variance32x64_c; 923 const VarianceMxNFunc highbd_10_variance32x32_c = vpx_highbd_10_variance32x32_c; 924 const VarianceMxNFunc highbd_10_variance32x16_c = vpx_highbd_10_variance32x16_c; 925 const VarianceMxNFunc highbd_10_variance16x32_c = vpx_highbd_10_variance16x32_c; 926 const VarianceMxNFunc highbd_10_variance16x16_c = vpx_highbd_10_variance16x16_c; 927 const VarianceMxNFunc highbd_10_variance16x8_c = vpx_highbd_10_variance16x8_c; 928 const VarianceMxNFunc highbd_10_variance8x16_c = vpx_highbd_10_variance8x16_c; 929 const VarianceMxNFunc highbd_10_variance8x8_c = vpx_highbd_10_variance8x8_c; 930 const VarianceMxNFunc highbd_10_variance8x4_c = vpx_highbd_10_variance8x4_c; 931 const VarianceMxNFunc highbd_10_variance4x8_c = vpx_highbd_10_variance4x8_c; 932 const VarianceMxNFunc highbd_10_variance4x4_c = vpx_highbd_10_variance4x4_c; 933 const VarianceMxNFunc highbd_8_variance64x64_c = vpx_highbd_8_variance64x64_c; 934 const VarianceMxNFunc highbd_8_variance64x32_c = vpx_highbd_8_variance64x32_c; 935 const VarianceMxNFunc highbd_8_variance32x64_c = vpx_highbd_8_variance32x64_c; 936 const VarianceMxNFunc highbd_8_variance32x32_c = vpx_highbd_8_variance32x32_c; 937 const VarianceMxNFunc highbd_8_variance32x16_c = vpx_highbd_8_variance32x16_c; 938 const VarianceMxNFunc highbd_8_variance16x32_c = vpx_highbd_8_variance16x32_c; 939 const VarianceMxNFunc highbd_8_variance16x16_c = vpx_highbd_8_variance16x16_c; 940 const VarianceMxNFunc highbd_8_variance16x8_c = vpx_highbd_8_variance16x8_c; 941 const VarianceMxNFunc highbd_8_variance8x16_c = vpx_highbd_8_variance8x16_c; 942 const VarianceMxNFunc highbd_8_variance8x8_c = vpx_highbd_8_variance8x8_c; 943 const VarianceMxNFunc highbd_8_variance8x4_c = vpx_highbd_8_variance8x4_c; 944 const VarianceMxNFunc highbd_8_variance4x8_c = vpx_highbd_8_variance4x8_c; 945 const VarianceMxNFunc highbd_8_variance4x4_c = vpx_highbd_8_variance4x4_c; 946 INSTANTIATE_TEST_CASE_P( 947 C, VpxHBDVarianceTest, 948 ::testing::Values(make_tuple(6, 6, highbd_12_variance64x64_c, 12), 949 make_tuple(6, 5, highbd_12_variance64x32_c, 12), 950 make_tuple(5, 6, highbd_12_variance32x64_c, 12), 951 make_tuple(5, 5, highbd_12_variance32x32_c, 12), 952 make_tuple(5, 4, highbd_12_variance32x16_c, 12), 953 make_tuple(4, 5, highbd_12_variance16x32_c, 12), 954 make_tuple(4, 4, highbd_12_variance16x16_c, 12), 955 make_tuple(4, 3, highbd_12_variance16x8_c, 12), 956 make_tuple(3, 4, highbd_12_variance8x16_c, 12), 957 make_tuple(3, 3, highbd_12_variance8x8_c, 12), 958 make_tuple(3, 2, highbd_12_variance8x4_c, 12), 959 make_tuple(2, 3, highbd_12_variance4x8_c, 12), 960 make_tuple(2, 2, highbd_12_variance4x4_c, 12), 961 make_tuple(6, 6, highbd_10_variance64x64_c, 10), 962 make_tuple(6, 5, highbd_10_variance64x32_c, 10), 963 make_tuple(5, 6, highbd_10_variance32x64_c, 10), 964 make_tuple(5, 5, highbd_10_variance32x32_c, 10), 965 make_tuple(5, 4, highbd_10_variance32x16_c, 10), 966 make_tuple(4, 5, highbd_10_variance16x32_c, 10), 967 make_tuple(4, 4, highbd_10_variance16x16_c, 10), 968 make_tuple(4, 3, highbd_10_variance16x8_c, 10), 969 make_tuple(3, 4, highbd_10_variance8x16_c, 10), 970 make_tuple(3, 3, highbd_10_variance8x8_c, 10), 971 make_tuple(3, 2, highbd_10_variance8x4_c, 10), 972 make_tuple(2, 3, highbd_10_variance4x8_c, 10), 973 make_tuple(2, 2, highbd_10_variance4x4_c, 10), 974 make_tuple(6, 6, highbd_8_variance64x64_c, 8), 975 make_tuple(6, 5, highbd_8_variance64x32_c, 8), 976 make_tuple(5, 6, highbd_8_variance32x64_c, 8), 977 make_tuple(5, 5, highbd_8_variance32x32_c, 8), 978 make_tuple(5, 4, highbd_8_variance32x16_c, 8), 979 make_tuple(4, 5, highbd_8_variance16x32_c, 8), 980 make_tuple(4, 4, highbd_8_variance16x16_c, 8), 981 make_tuple(4, 3, highbd_8_variance16x8_c, 8), 982 make_tuple(3, 4, highbd_8_variance8x16_c, 8), 983 make_tuple(3, 3, highbd_8_variance8x8_c, 8), 984 make_tuple(3, 2, highbd_8_variance8x4_c, 8), 985 make_tuple(2, 3, highbd_8_variance4x8_c, 8), 986 make_tuple(2, 2, highbd_8_variance4x4_c, 8))); 987 988 const SubpixVarMxNFunc highbd_8_subpel_var64x64_c = 989 vpx_highbd_8_sub_pixel_variance64x64_c; 990 const SubpixVarMxNFunc highbd_8_subpel_var64x32_c = 991 vpx_highbd_8_sub_pixel_variance64x32_c; 992 const SubpixVarMxNFunc highbd_8_subpel_var32x64_c = 993 vpx_highbd_8_sub_pixel_variance32x64_c; 994 const SubpixVarMxNFunc highbd_8_subpel_var32x32_c = 995 vpx_highbd_8_sub_pixel_variance32x32_c; 996 const SubpixVarMxNFunc highbd_8_subpel_var32x16_c = 997 vpx_highbd_8_sub_pixel_variance32x16_c; 998 const SubpixVarMxNFunc highbd_8_subpel_var16x32_c = 999 vpx_highbd_8_sub_pixel_variance16x32_c; 1000 const SubpixVarMxNFunc highbd_8_subpel_var16x16_c = 1001 vpx_highbd_8_sub_pixel_variance16x16_c; 1002 const SubpixVarMxNFunc highbd_8_subpel_var16x8_c = 1003 vpx_highbd_8_sub_pixel_variance16x8_c; 1004 const SubpixVarMxNFunc highbd_8_subpel_var8x16_c = 1005 vpx_highbd_8_sub_pixel_variance8x16_c; 1006 const SubpixVarMxNFunc highbd_8_subpel_var8x8_c = 1007 vpx_highbd_8_sub_pixel_variance8x8_c; 1008 const SubpixVarMxNFunc highbd_8_subpel_var8x4_c = 1009 vpx_highbd_8_sub_pixel_variance8x4_c; 1010 const SubpixVarMxNFunc highbd_8_subpel_var4x8_c = 1011 vpx_highbd_8_sub_pixel_variance4x8_c; 1012 const SubpixVarMxNFunc highbd_8_subpel_var4x4_c = 1013 vpx_highbd_8_sub_pixel_variance4x4_c; 1014 const SubpixVarMxNFunc highbd_10_subpel_var64x64_c = 1015 vpx_highbd_10_sub_pixel_variance64x64_c; 1016 const SubpixVarMxNFunc highbd_10_subpel_var64x32_c = 1017 vpx_highbd_10_sub_pixel_variance64x32_c; 1018 const SubpixVarMxNFunc highbd_10_subpel_var32x64_c = 1019 vpx_highbd_10_sub_pixel_variance32x64_c; 1020 const SubpixVarMxNFunc highbd_10_subpel_var32x32_c = 1021 vpx_highbd_10_sub_pixel_variance32x32_c; 1022 const SubpixVarMxNFunc highbd_10_subpel_var32x16_c = 1023 vpx_highbd_10_sub_pixel_variance32x16_c; 1024 const SubpixVarMxNFunc highbd_10_subpel_var16x32_c = 1025 vpx_highbd_10_sub_pixel_variance16x32_c; 1026 const SubpixVarMxNFunc highbd_10_subpel_var16x16_c = 1027 vpx_highbd_10_sub_pixel_variance16x16_c; 1028 const SubpixVarMxNFunc highbd_10_subpel_var16x8_c = 1029 vpx_highbd_10_sub_pixel_variance16x8_c; 1030 const SubpixVarMxNFunc highbd_10_subpel_var8x16_c = 1031 vpx_highbd_10_sub_pixel_variance8x16_c; 1032 const SubpixVarMxNFunc highbd_10_subpel_var8x8_c = 1033 vpx_highbd_10_sub_pixel_variance8x8_c; 1034 const SubpixVarMxNFunc highbd_10_subpel_var8x4_c = 1035 vpx_highbd_10_sub_pixel_variance8x4_c; 1036 const SubpixVarMxNFunc highbd_10_subpel_var4x8_c = 1037 vpx_highbd_10_sub_pixel_variance4x8_c; 1038 const SubpixVarMxNFunc highbd_10_subpel_var4x4_c = 1039 vpx_highbd_10_sub_pixel_variance4x4_c; 1040 const SubpixVarMxNFunc highbd_12_subpel_var64x64_c = 1041 vpx_highbd_12_sub_pixel_variance64x64_c; 1042 const SubpixVarMxNFunc highbd_12_subpel_var64x32_c = 1043 vpx_highbd_12_sub_pixel_variance64x32_c; 1044 const SubpixVarMxNFunc highbd_12_subpel_var32x64_c = 1045 vpx_highbd_12_sub_pixel_variance32x64_c; 1046 const SubpixVarMxNFunc highbd_12_subpel_var32x32_c = 1047 vpx_highbd_12_sub_pixel_variance32x32_c; 1048 const SubpixVarMxNFunc highbd_12_subpel_var32x16_c = 1049 vpx_highbd_12_sub_pixel_variance32x16_c; 1050 const SubpixVarMxNFunc highbd_12_subpel_var16x32_c = 1051 vpx_highbd_12_sub_pixel_variance16x32_c; 1052 const SubpixVarMxNFunc highbd_12_subpel_var16x16_c = 1053 vpx_highbd_12_sub_pixel_variance16x16_c; 1054 const SubpixVarMxNFunc highbd_12_subpel_var16x8_c = 1055 vpx_highbd_12_sub_pixel_variance16x8_c; 1056 const SubpixVarMxNFunc highbd_12_subpel_var8x16_c = 1057 vpx_highbd_12_sub_pixel_variance8x16_c; 1058 const SubpixVarMxNFunc highbd_12_subpel_var8x8_c = 1059 vpx_highbd_12_sub_pixel_variance8x8_c; 1060 const SubpixVarMxNFunc highbd_12_subpel_var8x4_c = 1061 vpx_highbd_12_sub_pixel_variance8x4_c; 1062 const SubpixVarMxNFunc highbd_12_subpel_var4x8_c = 1063 vpx_highbd_12_sub_pixel_variance4x8_c; 1064 const SubpixVarMxNFunc highbd_12_subpel_var4x4_c = 1065 vpx_highbd_12_sub_pixel_variance4x4_c; 1066 INSTANTIATE_TEST_CASE_P( 1067 C, VpxHBDSubpelVarianceTest, 1068 ::testing::Values(make_tuple(6, 6, highbd_8_subpel_var64x64_c, 8), 1069 make_tuple(6, 5, highbd_8_subpel_var64x32_c, 8), 1070 make_tuple(5, 6, highbd_8_subpel_var32x64_c, 8), 1071 make_tuple(5, 5, highbd_8_subpel_var32x32_c, 8), 1072 make_tuple(5, 4, highbd_8_subpel_var32x16_c, 8), 1073 make_tuple(4, 5, highbd_8_subpel_var16x32_c, 8), 1074 make_tuple(4, 4, highbd_8_subpel_var16x16_c, 8), 1075 make_tuple(4, 3, highbd_8_subpel_var16x8_c, 8), 1076 make_tuple(3, 4, highbd_8_subpel_var8x16_c, 8), 1077 make_tuple(3, 3, highbd_8_subpel_var8x8_c, 8), 1078 make_tuple(3, 2, highbd_8_subpel_var8x4_c, 8), 1079 make_tuple(2, 3, highbd_8_subpel_var4x8_c, 8), 1080 make_tuple(2, 2, highbd_8_subpel_var4x4_c, 8), 1081 make_tuple(6, 6, highbd_10_subpel_var64x64_c, 10), 1082 make_tuple(6, 5, highbd_10_subpel_var64x32_c, 10), 1083 make_tuple(5, 6, highbd_10_subpel_var32x64_c, 10), 1084 make_tuple(5, 5, highbd_10_subpel_var32x32_c, 10), 1085 make_tuple(5, 4, highbd_10_subpel_var32x16_c, 10), 1086 make_tuple(4, 5, highbd_10_subpel_var16x32_c, 10), 1087 make_tuple(4, 4, highbd_10_subpel_var16x16_c, 10), 1088 make_tuple(4, 3, highbd_10_subpel_var16x8_c, 10), 1089 make_tuple(3, 4, highbd_10_subpel_var8x16_c, 10), 1090 make_tuple(3, 3, highbd_10_subpel_var8x8_c, 10), 1091 make_tuple(3, 2, highbd_10_subpel_var8x4_c, 10), 1092 make_tuple(2, 3, highbd_10_subpel_var4x8_c, 10), 1093 make_tuple(2, 2, highbd_10_subpel_var4x4_c, 10), 1094 make_tuple(6, 6, highbd_12_subpel_var64x64_c, 12), 1095 make_tuple(6, 5, highbd_12_subpel_var64x32_c, 12), 1096 make_tuple(5, 6, highbd_12_subpel_var32x64_c, 12), 1097 make_tuple(5, 5, highbd_12_subpel_var32x32_c, 12), 1098 make_tuple(5, 4, highbd_12_subpel_var32x16_c, 12), 1099 make_tuple(4, 5, highbd_12_subpel_var16x32_c, 12), 1100 make_tuple(4, 4, highbd_12_subpel_var16x16_c, 12), 1101 make_tuple(4, 3, highbd_12_subpel_var16x8_c, 12), 1102 make_tuple(3, 4, highbd_12_subpel_var8x16_c, 12), 1103 make_tuple(3, 3, highbd_12_subpel_var8x8_c, 12), 1104 make_tuple(3, 2, highbd_12_subpel_var8x4_c, 12), 1105 make_tuple(2, 3, highbd_12_subpel_var4x8_c, 12), 1106 make_tuple(2, 2, highbd_12_subpel_var4x4_c, 12))); 1107 1108 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var64x64_c = 1109 vpx_highbd_8_sub_pixel_avg_variance64x64_c; 1110 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var64x32_c = 1111 vpx_highbd_8_sub_pixel_avg_variance64x32_c; 1112 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var32x64_c = 1113 vpx_highbd_8_sub_pixel_avg_variance32x64_c; 1114 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var32x32_c = 1115 vpx_highbd_8_sub_pixel_avg_variance32x32_c; 1116 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var32x16_c = 1117 vpx_highbd_8_sub_pixel_avg_variance32x16_c; 1118 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var16x32_c = 1119 vpx_highbd_8_sub_pixel_avg_variance16x32_c; 1120 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var16x16_c = 1121 vpx_highbd_8_sub_pixel_avg_variance16x16_c; 1122 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var16x8_c = 1123 vpx_highbd_8_sub_pixel_avg_variance16x8_c; 1124 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var8x16_c = 1125 vpx_highbd_8_sub_pixel_avg_variance8x16_c; 1126 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var8x8_c = 1127 vpx_highbd_8_sub_pixel_avg_variance8x8_c; 1128 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var8x4_c = 1129 vpx_highbd_8_sub_pixel_avg_variance8x4_c; 1130 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var4x8_c = 1131 vpx_highbd_8_sub_pixel_avg_variance4x8_c; 1132 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_var4x4_c = 1133 vpx_highbd_8_sub_pixel_avg_variance4x4_c; 1134 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var64x64_c = 1135 vpx_highbd_10_sub_pixel_avg_variance64x64_c; 1136 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var64x32_c = 1137 vpx_highbd_10_sub_pixel_avg_variance64x32_c; 1138 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var32x64_c = 1139 vpx_highbd_10_sub_pixel_avg_variance32x64_c; 1140 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var32x32_c = 1141 vpx_highbd_10_sub_pixel_avg_variance32x32_c; 1142 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var32x16_c = 1143 vpx_highbd_10_sub_pixel_avg_variance32x16_c; 1144 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var16x32_c = 1145 vpx_highbd_10_sub_pixel_avg_variance16x32_c; 1146 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var16x16_c = 1147 vpx_highbd_10_sub_pixel_avg_variance16x16_c; 1148 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var16x8_c = 1149 vpx_highbd_10_sub_pixel_avg_variance16x8_c; 1150 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var8x16_c = 1151 vpx_highbd_10_sub_pixel_avg_variance8x16_c; 1152 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var8x8_c = 1153 vpx_highbd_10_sub_pixel_avg_variance8x8_c; 1154 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var8x4_c = 1155 vpx_highbd_10_sub_pixel_avg_variance8x4_c; 1156 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var4x8_c = 1157 vpx_highbd_10_sub_pixel_avg_variance4x8_c; 1158 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_var4x4_c = 1159 vpx_highbd_10_sub_pixel_avg_variance4x4_c; 1160 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var64x64_c = 1161 vpx_highbd_12_sub_pixel_avg_variance64x64_c; 1162 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var64x32_c = 1163 vpx_highbd_12_sub_pixel_avg_variance64x32_c; 1164 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var32x64_c = 1165 vpx_highbd_12_sub_pixel_avg_variance32x64_c; 1166 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var32x32_c = 1167 vpx_highbd_12_sub_pixel_avg_variance32x32_c; 1168 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var32x16_c = 1169 vpx_highbd_12_sub_pixel_avg_variance32x16_c; 1170 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var16x32_c = 1171 vpx_highbd_12_sub_pixel_avg_variance16x32_c; 1172 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var16x16_c = 1173 vpx_highbd_12_sub_pixel_avg_variance16x16_c; 1174 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var16x8_c = 1175 vpx_highbd_12_sub_pixel_avg_variance16x8_c; 1176 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var8x16_c = 1177 vpx_highbd_12_sub_pixel_avg_variance8x16_c; 1178 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var8x8_c = 1179 vpx_highbd_12_sub_pixel_avg_variance8x8_c; 1180 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var8x4_c = 1181 vpx_highbd_12_sub_pixel_avg_variance8x4_c; 1182 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var4x8_c = 1183 vpx_highbd_12_sub_pixel_avg_variance4x8_c; 1184 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_var4x4_c = 1185 vpx_highbd_12_sub_pixel_avg_variance4x4_c; 1186 INSTANTIATE_TEST_CASE_P( 1187 C, VpxHBDSubpelAvgVarianceTest, 1188 ::testing::Values( 1189 make_tuple(6, 6, highbd_8_subpel_avg_var64x64_c, 8), 1190 make_tuple(6, 5, highbd_8_subpel_avg_var64x32_c, 8), 1191 make_tuple(5, 6, highbd_8_subpel_avg_var32x64_c, 8), 1192 make_tuple(5, 5, highbd_8_subpel_avg_var32x32_c, 8), 1193 make_tuple(5, 4, highbd_8_subpel_avg_var32x16_c, 8), 1194 make_tuple(4, 5, highbd_8_subpel_avg_var16x32_c, 8), 1195 make_tuple(4, 4, highbd_8_subpel_avg_var16x16_c, 8), 1196 make_tuple(4, 3, highbd_8_subpel_avg_var16x8_c, 8), 1197 make_tuple(3, 4, highbd_8_subpel_avg_var8x16_c, 8), 1198 make_tuple(3, 3, highbd_8_subpel_avg_var8x8_c, 8), 1199 make_tuple(3, 2, highbd_8_subpel_avg_var8x4_c, 8), 1200 make_tuple(2, 3, highbd_8_subpel_avg_var4x8_c, 8), 1201 make_tuple(2, 2, highbd_8_subpel_avg_var4x4_c, 8), 1202 make_tuple(6, 6, highbd_10_subpel_avg_var64x64_c, 10), 1203 make_tuple(6, 5, highbd_10_subpel_avg_var64x32_c, 10), 1204 make_tuple(5, 6, highbd_10_subpel_avg_var32x64_c, 10), 1205 make_tuple(5, 5, highbd_10_subpel_avg_var32x32_c, 10), 1206 make_tuple(5, 4, highbd_10_subpel_avg_var32x16_c, 10), 1207 make_tuple(4, 5, highbd_10_subpel_avg_var16x32_c, 10), 1208 make_tuple(4, 4, highbd_10_subpel_avg_var16x16_c, 10), 1209 make_tuple(4, 3, highbd_10_subpel_avg_var16x8_c, 10), 1210 make_tuple(3, 4, highbd_10_subpel_avg_var8x16_c, 10), 1211 make_tuple(3, 3, highbd_10_subpel_avg_var8x8_c, 10), 1212 make_tuple(3, 2, highbd_10_subpel_avg_var8x4_c, 10), 1213 make_tuple(2, 3, highbd_10_subpel_avg_var4x8_c, 10), 1214 make_tuple(2, 2, highbd_10_subpel_avg_var4x4_c, 10), 1215 make_tuple(6, 6, highbd_12_subpel_avg_var64x64_c, 12), 1216 make_tuple(6, 5, highbd_12_subpel_avg_var64x32_c, 12), 1217 make_tuple(5, 6, highbd_12_subpel_avg_var32x64_c, 12), 1218 make_tuple(5, 5, highbd_12_subpel_avg_var32x32_c, 12), 1219 make_tuple(5, 4, highbd_12_subpel_avg_var32x16_c, 12), 1220 make_tuple(4, 5, highbd_12_subpel_avg_var16x32_c, 12), 1221 make_tuple(4, 4, highbd_12_subpel_avg_var16x16_c, 12), 1222 make_tuple(4, 3, highbd_12_subpel_avg_var16x8_c, 12), 1223 make_tuple(3, 4, highbd_12_subpel_avg_var8x16_c, 12), 1224 make_tuple(3, 3, highbd_12_subpel_avg_var8x8_c, 12), 1225 make_tuple(3, 2, highbd_12_subpel_avg_var8x4_c, 12), 1226 make_tuple(2, 3, highbd_12_subpel_avg_var4x8_c, 12), 1227 make_tuple(2, 2, highbd_12_subpel_avg_var4x4_c, 12))); 1228 #endif // CONFIG_VP9_HIGHBITDEPTH 1229 1230 #if HAVE_MMX 1231 const VarianceMxNFunc mse16x16_mmx = vpx_mse16x16_mmx; 1232 INSTANTIATE_TEST_CASE_P(MMX, VpxMseTest, 1233 ::testing::Values(make_tuple(4, 4, mse16x16_mmx))); 1234 1235 INSTANTIATE_TEST_CASE_P(MMX, SumOfSquaresTest, 1236 ::testing::Values(vpx_get_mb_ss_mmx)); 1237 1238 const VarianceMxNFunc variance16x16_mmx = vpx_variance16x16_mmx; 1239 const VarianceMxNFunc variance16x8_mmx = vpx_variance16x8_mmx; 1240 const VarianceMxNFunc variance8x16_mmx = vpx_variance8x16_mmx; 1241 const VarianceMxNFunc variance8x8_mmx = vpx_variance8x8_mmx; 1242 const VarianceMxNFunc variance4x4_mmx = vpx_variance4x4_mmx; 1243 INSTANTIATE_TEST_CASE_P( 1244 MMX, VpxVarianceTest, 1245 ::testing::Values(make_tuple(4, 4, variance16x16_mmx, 0), 1246 make_tuple(4, 3, variance16x8_mmx, 0), 1247 make_tuple(3, 4, variance8x16_mmx, 0), 1248 make_tuple(3, 3, variance8x8_mmx, 0), 1249 make_tuple(2, 2, variance4x4_mmx, 0))); 1250 1251 const SubpixVarMxNFunc subpel_var16x16_mmx = vpx_sub_pixel_variance16x16_mmx; 1252 const SubpixVarMxNFunc subpel_var16x8_mmx = vpx_sub_pixel_variance16x8_mmx; 1253 const SubpixVarMxNFunc subpel_var8x16_mmx = vpx_sub_pixel_variance8x16_mmx; 1254 const SubpixVarMxNFunc subpel_var8x8_mmx = vpx_sub_pixel_variance8x8_mmx; 1255 const SubpixVarMxNFunc subpel_var4x4_mmx = vpx_sub_pixel_variance4x4_mmx; 1256 INSTANTIATE_TEST_CASE_P( 1257 MMX, VpxSubpelVarianceTest, 1258 ::testing::Values(make_tuple(4, 4, subpel_var16x16_mmx, 0), 1259 make_tuple(4, 3, subpel_var16x8_mmx, 0), 1260 make_tuple(3, 4, subpel_var8x16_mmx, 0), 1261 make_tuple(3, 3, subpel_var8x8_mmx, 0), 1262 make_tuple(2, 2, subpel_var4x4_mmx, 0))); 1263 #endif // HAVE_MMX 1264 1265 #if HAVE_SSE2 1266 INSTANTIATE_TEST_CASE_P(SSE2, SumOfSquaresTest, 1267 ::testing::Values(vpx_get_mb_ss_sse2)); 1268 1269 const VarianceMxNFunc mse16x16_sse2 = vpx_mse16x16_sse2; 1270 const VarianceMxNFunc mse16x8_sse2 = vpx_mse16x8_sse2; 1271 const VarianceMxNFunc mse8x16_sse2 = vpx_mse8x16_sse2; 1272 const VarianceMxNFunc mse8x8_sse2 = vpx_mse8x8_sse2; 1273 INSTANTIATE_TEST_CASE_P(SSE2, VpxMseTest, 1274 ::testing::Values(make_tuple(4, 4, mse16x16_sse2), 1275 make_tuple(4, 3, mse16x8_sse2), 1276 make_tuple(3, 4, mse8x16_sse2), 1277 make_tuple(3, 3, mse8x8_sse2))); 1278 1279 const VarianceMxNFunc variance64x64_sse2 = vpx_variance64x64_sse2; 1280 const VarianceMxNFunc variance64x32_sse2 = vpx_variance64x32_sse2; 1281 const VarianceMxNFunc variance32x64_sse2 = vpx_variance32x64_sse2; 1282 const VarianceMxNFunc variance32x32_sse2 = vpx_variance32x32_sse2; 1283 const VarianceMxNFunc variance32x16_sse2 = vpx_variance32x16_sse2; 1284 const VarianceMxNFunc variance16x32_sse2 = vpx_variance16x32_sse2; 1285 const VarianceMxNFunc variance16x16_sse2 = vpx_variance16x16_sse2; 1286 const VarianceMxNFunc variance16x8_sse2 = vpx_variance16x8_sse2; 1287 const VarianceMxNFunc variance8x16_sse2 = vpx_variance8x16_sse2; 1288 const VarianceMxNFunc variance8x8_sse2 = vpx_variance8x8_sse2; 1289 const VarianceMxNFunc variance8x4_sse2 = vpx_variance8x4_sse2; 1290 const VarianceMxNFunc variance4x8_sse2 = vpx_variance4x8_sse2; 1291 const VarianceMxNFunc variance4x4_sse2 = vpx_variance4x4_sse2; 1292 INSTANTIATE_TEST_CASE_P( 1293 SSE2, VpxVarianceTest, 1294 ::testing::Values(make_tuple(6, 6, variance64x64_sse2, 0), 1295 make_tuple(6, 5, variance64x32_sse2, 0), 1296 make_tuple(5, 6, variance32x64_sse2, 0), 1297 make_tuple(5, 5, variance32x32_sse2, 0), 1298 make_tuple(5, 4, variance32x16_sse2, 0), 1299 make_tuple(4, 5, variance16x32_sse2, 0), 1300 make_tuple(4, 4, variance16x16_sse2, 0), 1301 make_tuple(4, 3, variance16x8_sse2, 0), 1302 make_tuple(3, 4, variance8x16_sse2, 0), 1303 make_tuple(3, 3, variance8x8_sse2, 0), 1304 make_tuple(3, 2, variance8x4_sse2, 0), 1305 make_tuple(2, 3, variance4x8_sse2, 0), 1306 make_tuple(2, 2, variance4x4_sse2, 0))); 1307 1308 #if CONFIG_USE_X86INC 1309 const SubpixVarMxNFunc subpel_variance64x64_sse2 = 1310 vpx_sub_pixel_variance64x64_sse2; 1311 const SubpixVarMxNFunc subpel_variance64x32_sse2 = 1312 vpx_sub_pixel_variance64x32_sse2; 1313 const SubpixVarMxNFunc subpel_variance32x64_sse2 = 1314 vpx_sub_pixel_variance32x64_sse2; 1315 const SubpixVarMxNFunc subpel_variance32x32_sse2 = 1316 vpx_sub_pixel_variance32x32_sse2; 1317 const SubpixVarMxNFunc subpel_variance32x16_sse2 = 1318 vpx_sub_pixel_variance32x16_sse2; 1319 const SubpixVarMxNFunc subpel_variance16x32_sse2 = 1320 vpx_sub_pixel_variance16x32_sse2; 1321 const SubpixVarMxNFunc subpel_variance16x16_sse2 = 1322 vpx_sub_pixel_variance16x16_sse2; 1323 const SubpixVarMxNFunc subpel_variance16x8_sse2 = 1324 vpx_sub_pixel_variance16x8_sse2; 1325 const SubpixVarMxNFunc subpel_variance8x16_sse2 = 1326 vpx_sub_pixel_variance8x16_sse2; 1327 const SubpixVarMxNFunc subpel_variance8x8_sse2 = vpx_sub_pixel_variance8x8_sse2; 1328 const SubpixVarMxNFunc subpel_variance8x4_sse2 = vpx_sub_pixel_variance8x4_sse2; 1329 const SubpixVarMxNFunc subpel_variance4x8_sse = vpx_sub_pixel_variance4x8_sse; 1330 const SubpixVarMxNFunc subpel_variance4x4_sse = vpx_sub_pixel_variance4x4_sse; 1331 INSTANTIATE_TEST_CASE_P( 1332 SSE2, VpxSubpelVarianceTest, 1333 ::testing::Values(make_tuple(6, 6, subpel_variance64x64_sse2, 0), 1334 make_tuple(6, 5, subpel_variance64x32_sse2, 0), 1335 make_tuple(5, 6, subpel_variance32x64_sse2, 0), 1336 make_tuple(5, 5, subpel_variance32x32_sse2, 0), 1337 make_tuple(5, 4, subpel_variance32x16_sse2, 0), 1338 make_tuple(4, 5, subpel_variance16x32_sse2, 0), 1339 make_tuple(4, 4, subpel_variance16x16_sse2, 0), 1340 make_tuple(4, 3, subpel_variance16x8_sse2, 0), 1341 make_tuple(3, 4, subpel_variance8x16_sse2, 0), 1342 make_tuple(3, 3, subpel_variance8x8_sse2, 0), 1343 make_tuple(3, 2, subpel_variance8x4_sse2, 0), 1344 make_tuple(2, 3, subpel_variance4x8_sse, 0), 1345 make_tuple(2, 2, subpel_variance4x4_sse, 0))); 1346 1347 const SubpixAvgVarMxNFunc subpel_avg_variance64x64_sse2 = 1348 vpx_sub_pixel_avg_variance64x64_sse2; 1349 const SubpixAvgVarMxNFunc subpel_avg_variance64x32_sse2 = 1350 vpx_sub_pixel_avg_variance64x32_sse2; 1351 const SubpixAvgVarMxNFunc subpel_avg_variance32x64_sse2 = 1352 vpx_sub_pixel_avg_variance32x64_sse2; 1353 const SubpixAvgVarMxNFunc subpel_avg_variance32x32_sse2 = 1354 vpx_sub_pixel_avg_variance32x32_sse2; 1355 const SubpixAvgVarMxNFunc subpel_avg_variance32x16_sse2 = 1356 vpx_sub_pixel_avg_variance32x16_sse2; 1357 const SubpixAvgVarMxNFunc subpel_avg_variance16x32_sse2 = 1358 vpx_sub_pixel_avg_variance16x32_sse2; 1359 const SubpixAvgVarMxNFunc subpel_avg_variance16x16_sse2 = 1360 vpx_sub_pixel_avg_variance16x16_sse2; 1361 const SubpixAvgVarMxNFunc subpel_avg_variance16x8_sse2 = 1362 vpx_sub_pixel_avg_variance16x8_sse2; 1363 const SubpixAvgVarMxNFunc subpel_avg_variance8x16_sse2 = 1364 vpx_sub_pixel_avg_variance8x16_sse2; 1365 const SubpixAvgVarMxNFunc subpel_avg_variance8x8_sse2 = 1366 vpx_sub_pixel_avg_variance8x8_sse2; 1367 const SubpixAvgVarMxNFunc subpel_avg_variance8x4_sse2 = 1368 vpx_sub_pixel_avg_variance8x4_sse2; 1369 const SubpixAvgVarMxNFunc subpel_avg_variance4x8_sse = 1370 vpx_sub_pixel_avg_variance4x8_sse; 1371 const SubpixAvgVarMxNFunc subpel_avg_variance4x4_sse = 1372 vpx_sub_pixel_avg_variance4x4_sse; 1373 INSTANTIATE_TEST_CASE_P( 1374 SSE2, VpxSubpelAvgVarianceTest, 1375 ::testing::Values( 1376 make_tuple(6, 6, subpel_avg_variance64x64_sse2, 0), 1377 make_tuple(6, 5, subpel_avg_variance64x32_sse2, 0), 1378 make_tuple(5, 6, subpel_avg_variance32x64_sse2, 0), 1379 make_tuple(5, 5, subpel_avg_variance32x32_sse2, 0), 1380 make_tuple(5, 4, subpel_avg_variance32x16_sse2, 0), 1381 make_tuple(4, 5, subpel_avg_variance16x32_sse2, 0), 1382 make_tuple(4, 4, subpel_avg_variance16x16_sse2, 0), 1383 make_tuple(4, 3, subpel_avg_variance16x8_sse2, 0), 1384 make_tuple(3, 4, subpel_avg_variance8x16_sse2, 0), 1385 make_tuple(3, 3, subpel_avg_variance8x8_sse2, 0), 1386 make_tuple(3, 2, subpel_avg_variance8x4_sse2, 0), 1387 make_tuple(2, 3, subpel_avg_variance4x8_sse, 0), 1388 make_tuple(2, 2, subpel_avg_variance4x4_sse, 0))); 1389 #endif // CONFIG_USE_X86INC 1390 1391 #if CONFIG_VP9_HIGHBITDEPTH 1392 /* TODO(debargha): This test does not support the highbd version 1393 const VarianceMxNFunc highbd_12_mse16x16_sse2 = vpx_highbd_12_mse16x16_sse2; 1394 const VarianceMxNFunc highbd_12_mse16x8_sse2 = vpx_highbd_12_mse16x8_sse2; 1395 const VarianceMxNFunc highbd_12_mse8x16_sse2 = vpx_highbd_12_mse8x16_sse2; 1396 const VarianceMxNFunc highbd_12_mse8x8_sse2 = vpx_highbd_12_mse8x8_sse2; 1397 1398 const VarianceMxNFunc highbd_10_mse16x16_sse2 = vpx_highbd_10_mse16x16_sse2; 1399 const VarianceMxNFunc highbd_10_mse16x8_sse2 = vpx_highbd_10_mse16x8_sse2; 1400 const VarianceMxNFunc highbd_10_mse8x16_sse2 = vpx_highbd_10_mse8x16_sse2; 1401 const VarianceMxNFunc highbd_10_mse8x8_sse2 = vpx_highbd_10_mse8x8_sse2; 1402 1403 const VarianceMxNFunc highbd_8_mse16x16_sse2 = vpx_highbd_8_mse16x16_sse2; 1404 const VarianceMxNFunc highbd_8_mse16x8_sse2 = vpx_highbd_8_mse16x8_sse2; 1405 const VarianceMxNFunc highbd_8_mse8x16_sse2 = vpx_highbd_8_mse8x16_sse2; 1406 const VarianceMxNFunc highbd_8_mse8x8_sse2 = vpx_highbd_8_mse8x8_sse2; 1407 INSTANTIATE_TEST_CASE_P( 1408 SSE2, VpxHBDMseTest, ::testing::Values(make_tuple(4, 4, highbd_12_mse16x16_sse2), 1409 make_tuple(4, 3, highbd_12_mse16x8_sse2), 1410 make_tuple(3, 4, highbd_12_mse8x16_sse2), 1411 make_tuple(3, 3, highbd_12_mse8x8_sse2), 1412 make_tuple(4, 4, highbd_10_mse16x16_sse2), 1413 make_tuple(4, 3, highbd_10_mse16x8_sse2), 1414 make_tuple(3, 4, highbd_10_mse8x16_sse2), 1415 make_tuple(3, 3, highbd_10_mse8x8_sse2), 1416 make_tuple(4, 4, highbd_8_mse16x16_sse2), 1417 make_tuple(4, 3, highbd_8_mse16x8_sse2), 1418 make_tuple(3, 4, highbd_8_mse8x16_sse2), 1419 make_tuple(3, 3, highbd_8_mse8x8_sse2))); 1420 */ 1421 1422 const VarianceMxNFunc highbd_12_variance64x64_sse2 = 1423 vpx_highbd_12_variance64x64_sse2; 1424 const VarianceMxNFunc highbd_12_variance64x32_sse2 = 1425 vpx_highbd_12_variance64x32_sse2; 1426 const VarianceMxNFunc highbd_12_variance32x64_sse2 = 1427 vpx_highbd_12_variance32x64_sse2; 1428 const VarianceMxNFunc highbd_12_variance32x32_sse2 = 1429 vpx_highbd_12_variance32x32_sse2; 1430 const VarianceMxNFunc highbd_12_variance32x16_sse2 = 1431 vpx_highbd_12_variance32x16_sse2; 1432 const VarianceMxNFunc highbd_12_variance16x32_sse2 = 1433 vpx_highbd_12_variance16x32_sse2; 1434 const VarianceMxNFunc highbd_12_variance16x16_sse2 = 1435 vpx_highbd_12_variance16x16_sse2; 1436 const VarianceMxNFunc highbd_12_variance16x8_sse2 = 1437 vpx_highbd_12_variance16x8_sse2; 1438 const VarianceMxNFunc highbd_12_variance8x16_sse2 = 1439 vpx_highbd_12_variance8x16_sse2; 1440 const VarianceMxNFunc highbd_12_variance8x8_sse2 = 1441 vpx_highbd_12_variance8x8_sse2; 1442 const VarianceMxNFunc highbd_10_variance64x64_sse2 = 1443 vpx_highbd_10_variance64x64_sse2; 1444 const VarianceMxNFunc highbd_10_variance64x32_sse2 = 1445 vpx_highbd_10_variance64x32_sse2; 1446 const VarianceMxNFunc highbd_10_variance32x64_sse2 = 1447 vpx_highbd_10_variance32x64_sse2; 1448 const VarianceMxNFunc highbd_10_variance32x32_sse2 = 1449 vpx_highbd_10_variance32x32_sse2; 1450 const VarianceMxNFunc highbd_10_variance32x16_sse2 = 1451 vpx_highbd_10_variance32x16_sse2; 1452 const VarianceMxNFunc highbd_10_variance16x32_sse2 = 1453 vpx_highbd_10_variance16x32_sse2; 1454 const VarianceMxNFunc highbd_10_variance16x16_sse2 = 1455 vpx_highbd_10_variance16x16_sse2; 1456 const VarianceMxNFunc highbd_10_variance16x8_sse2 = 1457 vpx_highbd_10_variance16x8_sse2; 1458 const VarianceMxNFunc highbd_10_variance8x16_sse2 = 1459 vpx_highbd_10_variance8x16_sse2; 1460 const VarianceMxNFunc highbd_10_variance8x8_sse2 = 1461 vpx_highbd_10_variance8x8_sse2; 1462 const VarianceMxNFunc highbd_8_variance64x64_sse2 = 1463 vpx_highbd_8_variance64x64_sse2; 1464 const VarianceMxNFunc highbd_8_variance64x32_sse2 = 1465 vpx_highbd_8_variance64x32_sse2; 1466 const VarianceMxNFunc highbd_8_variance32x64_sse2 = 1467 vpx_highbd_8_variance32x64_sse2; 1468 const VarianceMxNFunc highbd_8_variance32x32_sse2 = 1469 vpx_highbd_8_variance32x32_sse2; 1470 const VarianceMxNFunc highbd_8_variance32x16_sse2 = 1471 vpx_highbd_8_variance32x16_sse2; 1472 const VarianceMxNFunc highbd_8_variance16x32_sse2 = 1473 vpx_highbd_8_variance16x32_sse2; 1474 const VarianceMxNFunc highbd_8_variance16x16_sse2 = 1475 vpx_highbd_8_variance16x16_sse2; 1476 const VarianceMxNFunc highbd_8_variance16x8_sse2 = 1477 vpx_highbd_8_variance16x8_sse2; 1478 const VarianceMxNFunc highbd_8_variance8x16_sse2 = 1479 vpx_highbd_8_variance8x16_sse2; 1480 const VarianceMxNFunc highbd_8_variance8x8_sse2 = 1481 vpx_highbd_8_variance8x8_sse2; 1482 1483 INSTANTIATE_TEST_CASE_P( 1484 SSE2, VpxHBDVarianceTest, 1485 ::testing::Values(make_tuple(6, 6, highbd_12_variance64x64_sse2, 12), 1486 make_tuple(6, 5, highbd_12_variance64x32_sse2, 12), 1487 make_tuple(5, 6, highbd_12_variance32x64_sse2, 12), 1488 make_tuple(5, 5, highbd_12_variance32x32_sse2, 12), 1489 make_tuple(5, 4, highbd_12_variance32x16_sse2, 12), 1490 make_tuple(4, 5, highbd_12_variance16x32_sse2, 12), 1491 make_tuple(4, 4, highbd_12_variance16x16_sse2, 12), 1492 make_tuple(4, 3, highbd_12_variance16x8_sse2, 12), 1493 make_tuple(3, 4, highbd_12_variance8x16_sse2, 12), 1494 make_tuple(3, 3, highbd_12_variance8x8_sse2, 12), 1495 make_tuple(6, 6, highbd_10_variance64x64_sse2, 10), 1496 make_tuple(6, 5, highbd_10_variance64x32_sse2, 10), 1497 make_tuple(5, 6, highbd_10_variance32x64_sse2, 10), 1498 make_tuple(5, 5, highbd_10_variance32x32_sse2, 10), 1499 make_tuple(5, 4, highbd_10_variance32x16_sse2, 10), 1500 make_tuple(4, 5, highbd_10_variance16x32_sse2, 10), 1501 make_tuple(4, 4, highbd_10_variance16x16_sse2, 10), 1502 make_tuple(4, 3, highbd_10_variance16x8_sse2, 10), 1503 make_tuple(3, 4, highbd_10_variance8x16_sse2, 10), 1504 make_tuple(3, 3, highbd_10_variance8x8_sse2, 10), 1505 make_tuple(6, 6, highbd_8_variance64x64_sse2, 8), 1506 make_tuple(6, 5, highbd_8_variance64x32_sse2, 8), 1507 make_tuple(5, 6, highbd_8_variance32x64_sse2, 8), 1508 make_tuple(5, 5, highbd_8_variance32x32_sse2, 8), 1509 make_tuple(5, 4, highbd_8_variance32x16_sse2, 8), 1510 make_tuple(4, 5, highbd_8_variance16x32_sse2, 8), 1511 make_tuple(4, 4, highbd_8_variance16x16_sse2, 8), 1512 make_tuple(4, 3, highbd_8_variance16x8_sse2, 8), 1513 make_tuple(3, 4, highbd_8_variance8x16_sse2, 8), 1514 make_tuple(3, 3, highbd_8_variance8x8_sse2, 8))); 1515 1516 #if CONFIG_USE_X86INC 1517 const SubpixVarMxNFunc highbd_12_subpel_variance64x64_sse2 = 1518 vpx_highbd_12_sub_pixel_variance64x64_sse2; 1519 const SubpixVarMxNFunc highbd_12_subpel_variance64x32_sse2 = 1520 vpx_highbd_12_sub_pixel_variance64x32_sse2; 1521 const SubpixVarMxNFunc highbd_12_subpel_variance32x64_sse2 = 1522 vpx_highbd_12_sub_pixel_variance32x64_sse2; 1523 const SubpixVarMxNFunc highbd_12_subpel_variance32x32_sse2 = 1524 vpx_highbd_12_sub_pixel_variance32x32_sse2; 1525 const SubpixVarMxNFunc highbd_12_subpel_variance32x16_sse2 = 1526 vpx_highbd_12_sub_pixel_variance32x16_sse2; 1527 const SubpixVarMxNFunc highbd_12_subpel_variance16x32_sse2 = 1528 vpx_highbd_12_sub_pixel_variance16x32_sse2; 1529 const SubpixVarMxNFunc highbd_12_subpel_variance16x16_sse2 = 1530 vpx_highbd_12_sub_pixel_variance16x16_sse2; 1531 const SubpixVarMxNFunc highbd_12_subpel_variance16x8_sse2 = 1532 vpx_highbd_12_sub_pixel_variance16x8_sse2; 1533 const SubpixVarMxNFunc highbd_12_subpel_variance8x16_sse2 = 1534 vpx_highbd_12_sub_pixel_variance8x16_sse2; 1535 const SubpixVarMxNFunc highbd_12_subpel_variance8x8_sse2 = 1536 vpx_highbd_12_sub_pixel_variance8x8_sse2; 1537 const SubpixVarMxNFunc highbd_12_subpel_variance8x4_sse2 = 1538 vpx_highbd_12_sub_pixel_variance8x4_sse2; 1539 const SubpixVarMxNFunc highbd_10_subpel_variance64x64_sse2 = 1540 vpx_highbd_10_sub_pixel_variance64x64_sse2; 1541 const SubpixVarMxNFunc highbd_10_subpel_variance64x32_sse2 = 1542 vpx_highbd_10_sub_pixel_variance64x32_sse2; 1543 const SubpixVarMxNFunc highbd_10_subpel_variance32x64_sse2 = 1544 vpx_highbd_10_sub_pixel_variance32x64_sse2; 1545 const SubpixVarMxNFunc highbd_10_subpel_variance32x32_sse2 = 1546 vpx_highbd_10_sub_pixel_variance32x32_sse2; 1547 const SubpixVarMxNFunc highbd_10_subpel_variance32x16_sse2 = 1548 vpx_highbd_10_sub_pixel_variance32x16_sse2; 1549 const SubpixVarMxNFunc highbd_10_subpel_variance16x32_sse2 = 1550 vpx_highbd_10_sub_pixel_variance16x32_sse2; 1551 const SubpixVarMxNFunc highbd_10_subpel_variance16x16_sse2 = 1552 vpx_highbd_10_sub_pixel_variance16x16_sse2; 1553 const SubpixVarMxNFunc highbd_10_subpel_variance16x8_sse2 = 1554 vpx_highbd_10_sub_pixel_variance16x8_sse2; 1555 const SubpixVarMxNFunc highbd_10_subpel_variance8x16_sse2 = 1556 vpx_highbd_10_sub_pixel_variance8x16_sse2; 1557 const SubpixVarMxNFunc highbd_10_subpel_variance8x8_sse2 = 1558 vpx_highbd_10_sub_pixel_variance8x8_sse2; 1559 const SubpixVarMxNFunc highbd_10_subpel_variance8x4_sse2 = 1560 vpx_highbd_10_sub_pixel_variance8x4_sse2; 1561 const SubpixVarMxNFunc highbd_8_subpel_variance64x64_sse2 = 1562 vpx_highbd_8_sub_pixel_variance64x64_sse2; 1563 const SubpixVarMxNFunc highbd_8_subpel_variance64x32_sse2 = 1564 vpx_highbd_8_sub_pixel_variance64x32_sse2; 1565 const SubpixVarMxNFunc highbd_8_subpel_variance32x64_sse2 = 1566 vpx_highbd_8_sub_pixel_variance32x64_sse2; 1567 const SubpixVarMxNFunc highbd_8_subpel_variance32x32_sse2 = 1568 vpx_highbd_8_sub_pixel_variance32x32_sse2; 1569 const SubpixVarMxNFunc highbd_8_subpel_variance32x16_sse2 = 1570 vpx_highbd_8_sub_pixel_variance32x16_sse2; 1571 const SubpixVarMxNFunc highbd_8_subpel_variance16x32_sse2 = 1572 vpx_highbd_8_sub_pixel_variance16x32_sse2; 1573 const SubpixVarMxNFunc highbd_8_subpel_variance16x16_sse2 = 1574 vpx_highbd_8_sub_pixel_variance16x16_sse2; 1575 const SubpixVarMxNFunc highbd_8_subpel_variance16x8_sse2 = 1576 vpx_highbd_8_sub_pixel_variance16x8_sse2; 1577 const SubpixVarMxNFunc highbd_8_subpel_variance8x16_sse2 = 1578 vpx_highbd_8_sub_pixel_variance8x16_sse2; 1579 const SubpixVarMxNFunc highbd_8_subpel_variance8x8_sse2 = 1580 vpx_highbd_8_sub_pixel_variance8x8_sse2; 1581 const SubpixVarMxNFunc highbd_8_subpel_variance8x4_sse2 = 1582 vpx_highbd_8_sub_pixel_variance8x4_sse2; 1583 INSTANTIATE_TEST_CASE_P( 1584 SSE2, VpxHBDSubpelVarianceTest, 1585 ::testing::Values(make_tuple(6, 6, highbd_12_subpel_variance64x64_sse2, 12), 1586 make_tuple(6, 5, highbd_12_subpel_variance64x32_sse2, 12), 1587 make_tuple(5, 6, highbd_12_subpel_variance32x64_sse2, 12), 1588 make_tuple(5, 5, highbd_12_subpel_variance32x32_sse2, 12), 1589 make_tuple(5, 4, highbd_12_subpel_variance32x16_sse2, 12), 1590 make_tuple(4, 5, highbd_12_subpel_variance16x32_sse2, 12), 1591 make_tuple(4, 4, highbd_12_subpel_variance16x16_sse2, 12), 1592 make_tuple(4, 3, highbd_12_subpel_variance16x8_sse2, 12), 1593 make_tuple(3, 4, highbd_12_subpel_variance8x16_sse2, 12), 1594 make_tuple(3, 3, highbd_12_subpel_variance8x8_sse2, 12), 1595 make_tuple(3, 2, highbd_12_subpel_variance8x4_sse2, 12), 1596 make_tuple(6, 6, highbd_10_subpel_variance64x64_sse2, 10), 1597 make_tuple(6, 5, highbd_10_subpel_variance64x32_sse2, 10), 1598 make_tuple(5, 6, highbd_10_subpel_variance32x64_sse2, 10), 1599 make_tuple(5, 5, highbd_10_subpel_variance32x32_sse2, 10), 1600 make_tuple(5, 4, highbd_10_subpel_variance32x16_sse2, 10), 1601 make_tuple(4, 5, highbd_10_subpel_variance16x32_sse2, 10), 1602 make_tuple(4, 4, highbd_10_subpel_variance16x16_sse2, 10), 1603 make_tuple(4, 3, highbd_10_subpel_variance16x8_sse2, 10), 1604 make_tuple(3, 4, highbd_10_subpel_variance8x16_sse2, 10), 1605 make_tuple(3, 3, highbd_10_subpel_variance8x8_sse2, 10), 1606 make_tuple(3, 2, highbd_10_subpel_variance8x4_sse2, 10), 1607 make_tuple(6, 6, highbd_8_subpel_variance64x64_sse2, 8), 1608 make_tuple(6, 5, highbd_8_subpel_variance64x32_sse2, 8), 1609 make_tuple(5, 6, highbd_8_subpel_variance32x64_sse2, 8), 1610 make_tuple(5, 5, highbd_8_subpel_variance32x32_sse2, 8), 1611 make_tuple(5, 4, highbd_8_subpel_variance32x16_sse2, 8), 1612 make_tuple(4, 5, highbd_8_subpel_variance16x32_sse2, 8), 1613 make_tuple(4, 4, highbd_8_subpel_variance16x16_sse2, 8), 1614 make_tuple(4, 3, highbd_8_subpel_variance16x8_sse2, 8), 1615 make_tuple(3, 4, highbd_8_subpel_variance8x16_sse2, 8), 1616 make_tuple(3, 3, highbd_8_subpel_variance8x8_sse2, 8), 1617 make_tuple(3, 2, highbd_8_subpel_variance8x4_sse2, 8))); 1618 1619 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance64x64_sse2 = 1620 vpx_highbd_12_sub_pixel_avg_variance64x64_sse2; 1621 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance64x32_sse2 = 1622 vpx_highbd_12_sub_pixel_avg_variance64x32_sse2; 1623 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance32x64_sse2 = 1624 vpx_highbd_12_sub_pixel_avg_variance32x64_sse2; 1625 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance32x32_sse2 = 1626 vpx_highbd_12_sub_pixel_avg_variance32x32_sse2; 1627 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance32x16_sse2 = 1628 vpx_highbd_12_sub_pixel_avg_variance32x16_sse2; 1629 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance16x32_sse2 = 1630 vpx_highbd_12_sub_pixel_avg_variance16x32_sse2; 1631 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance16x16_sse2 = 1632 vpx_highbd_12_sub_pixel_avg_variance16x16_sse2; 1633 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance16x8_sse2 = 1634 vpx_highbd_12_sub_pixel_avg_variance16x8_sse2; 1635 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance8x16_sse2 = 1636 vpx_highbd_12_sub_pixel_avg_variance8x16_sse2; 1637 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance8x8_sse2 = 1638 vpx_highbd_12_sub_pixel_avg_variance8x8_sse2; 1639 const SubpixAvgVarMxNFunc highbd_12_subpel_avg_variance8x4_sse2 = 1640 vpx_highbd_12_sub_pixel_avg_variance8x4_sse2; 1641 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance64x64_sse2 = 1642 vpx_highbd_10_sub_pixel_avg_variance64x64_sse2; 1643 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance64x32_sse2 = 1644 vpx_highbd_10_sub_pixel_avg_variance64x32_sse2; 1645 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance32x64_sse2 = 1646 vpx_highbd_10_sub_pixel_avg_variance32x64_sse2; 1647 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance32x32_sse2 = 1648 vpx_highbd_10_sub_pixel_avg_variance32x32_sse2; 1649 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance32x16_sse2 = 1650 vpx_highbd_10_sub_pixel_avg_variance32x16_sse2; 1651 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance16x32_sse2 = 1652 vpx_highbd_10_sub_pixel_avg_variance16x32_sse2; 1653 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance16x16_sse2 = 1654 vpx_highbd_10_sub_pixel_avg_variance16x16_sse2; 1655 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance16x8_sse2 = 1656 vpx_highbd_10_sub_pixel_avg_variance16x8_sse2; 1657 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance8x16_sse2 = 1658 vpx_highbd_10_sub_pixel_avg_variance8x16_sse2; 1659 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance8x8_sse2 = 1660 vpx_highbd_10_sub_pixel_avg_variance8x8_sse2; 1661 const SubpixAvgVarMxNFunc highbd_10_subpel_avg_variance8x4_sse2 = 1662 vpx_highbd_10_sub_pixel_avg_variance8x4_sse2; 1663 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance64x64_sse2 = 1664 vpx_highbd_8_sub_pixel_avg_variance64x64_sse2; 1665 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance64x32_sse2 = 1666 vpx_highbd_8_sub_pixel_avg_variance64x32_sse2; 1667 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance32x64_sse2 = 1668 vpx_highbd_8_sub_pixel_avg_variance32x64_sse2; 1669 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance32x32_sse2 = 1670 vpx_highbd_8_sub_pixel_avg_variance32x32_sse2; 1671 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance32x16_sse2 = 1672 vpx_highbd_8_sub_pixel_avg_variance32x16_sse2; 1673 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance16x32_sse2 = 1674 vpx_highbd_8_sub_pixel_avg_variance16x32_sse2; 1675 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance16x16_sse2 = 1676 vpx_highbd_8_sub_pixel_avg_variance16x16_sse2; 1677 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance16x8_sse2 = 1678 vpx_highbd_8_sub_pixel_avg_variance16x8_sse2; 1679 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance8x16_sse2 = 1680 vpx_highbd_8_sub_pixel_avg_variance8x16_sse2; 1681 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance8x8_sse2 = 1682 vpx_highbd_8_sub_pixel_avg_variance8x8_sse2; 1683 const SubpixAvgVarMxNFunc highbd_8_subpel_avg_variance8x4_sse2 = 1684 vpx_highbd_8_sub_pixel_avg_variance8x4_sse2; 1685 INSTANTIATE_TEST_CASE_P( 1686 SSE2, VpxHBDSubpelAvgVarianceTest, 1687 ::testing::Values( 1688 make_tuple(6, 6, highbd_12_subpel_avg_variance64x64_sse2, 12), 1689 make_tuple(6, 5, highbd_12_subpel_avg_variance64x32_sse2, 12), 1690 make_tuple(5, 6, highbd_12_subpel_avg_variance32x64_sse2, 12), 1691 make_tuple(5, 5, highbd_12_subpel_avg_variance32x32_sse2, 12), 1692 make_tuple(5, 4, highbd_12_subpel_avg_variance32x16_sse2, 12), 1693 make_tuple(4, 5, highbd_12_subpel_avg_variance16x32_sse2, 12), 1694 make_tuple(4, 4, highbd_12_subpel_avg_variance16x16_sse2, 12), 1695 make_tuple(4, 3, highbd_12_subpel_avg_variance16x8_sse2, 12), 1696 make_tuple(3, 4, highbd_12_subpel_avg_variance8x16_sse2, 12), 1697 make_tuple(3, 3, highbd_12_subpel_avg_variance8x8_sse2, 12), 1698 make_tuple(3, 2, highbd_12_subpel_avg_variance8x4_sse2, 12), 1699 make_tuple(6, 6, highbd_10_subpel_avg_variance64x64_sse2, 10), 1700 make_tuple(6, 5, highbd_10_subpel_avg_variance64x32_sse2, 10), 1701 make_tuple(5, 6, highbd_10_subpel_avg_variance32x64_sse2, 10), 1702 make_tuple(5, 5, highbd_10_subpel_avg_variance32x32_sse2, 10), 1703 make_tuple(5, 4, highbd_10_subpel_avg_variance32x16_sse2, 10), 1704 make_tuple(4, 5, highbd_10_subpel_avg_variance16x32_sse2, 10), 1705 make_tuple(4, 4, highbd_10_subpel_avg_variance16x16_sse2, 10), 1706 make_tuple(4, 3, highbd_10_subpel_avg_variance16x8_sse2, 10), 1707 make_tuple(3, 4, highbd_10_subpel_avg_variance8x16_sse2, 10), 1708 make_tuple(3, 3, highbd_10_subpel_avg_variance8x8_sse2, 10), 1709 make_tuple(3, 2, highbd_10_subpel_avg_variance8x4_sse2, 10), 1710 make_tuple(6, 6, highbd_8_subpel_avg_variance64x64_sse2, 8), 1711 make_tuple(6, 5, highbd_8_subpel_avg_variance64x32_sse2, 8), 1712 make_tuple(5, 6, highbd_8_subpel_avg_variance32x64_sse2, 8), 1713 make_tuple(5, 5, highbd_8_subpel_avg_variance32x32_sse2, 8), 1714 make_tuple(5, 4, highbd_8_subpel_avg_variance32x16_sse2, 8), 1715 make_tuple(4, 5, highbd_8_subpel_avg_variance16x32_sse2, 8), 1716 make_tuple(4, 4, highbd_8_subpel_avg_variance16x16_sse2, 8), 1717 make_tuple(4, 3, highbd_8_subpel_avg_variance16x8_sse2, 8), 1718 make_tuple(3, 4, highbd_8_subpel_avg_variance8x16_sse2, 8), 1719 make_tuple(3, 3, highbd_8_subpel_avg_variance8x8_sse2, 8), 1720 make_tuple(3, 2, highbd_8_subpel_avg_variance8x4_sse2, 8))); 1721 #endif // CONFIG_USE_X86INC 1722 #endif // CONFIG_VP9_HIGHBITDEPTH 1723 #endif // HAVE_SSE2 1724 1725 #if HAVE_SSSE3 1726 #if CONFIG_USE_X86INC 1727 const SubpixVarMxNFunc subpel_variance64x64_ssse3 = 1728 vpx_sub_pixel_variance64x64_ssse3; 1729 const SubpixVarMxNFunc subpel_variance64x32_ssse3 = 1730 vpx_sub_pixel_variance64x32_ssse3; 1731 const SubpixVarMxNFunc subpel_variance32x64_ssse3 = 1732 vpx_sub_pixel_variance32x64_ssse3; 1733 const SubpixVarMxNFunc subpel_variance32x32_ssse3 = 1734 vpx_sub_pixel_variance32x32_ssse3; 1735 const SubpixVarMxNFunc subpel_variance32x16_ssse3 = 1736 vpx_sub_pixel_variance32x16_ssse3; 1737 const SubpixVarMxNFunc subpel_variance16x32_ssse3 = 1738 vpx_sub_pixel_variance16x32_ssse3; 1739 const SubpixVarMxNFunc subpel_variance16x16_ssse3 = 1740 vpx_sub_pixel_variance16x16_ssse3; 1741 const SubpixVarMxNFunc subpel_variance16x8_ssse3 = 1742 vpx_sub_pixel_variance16x8_ssse3; 1743 const SubpixVarMxNFunc subpel_variance8x16_ssse3 = 1744 vpx_sub_pixel_variance8x16_ssse3; 1745 const SubpixVarMxNFunc subpel_variance8x8_ssse3 = 1746 vpx_sub_pixel_variance8x8_ssse3; 1747 const SubpixVarMxNFunc subpel_variance8x4_ssse3 = 1748 vpx_sub_pixel_variance8x4_ssse3; 1749 const SubpixVarMxNFunc subpel_variance4x8_ssse3 = 1750 vpx_sub_pixel_variance4x8_ssse3; 1751 const SubpixVarMxNFunc subpel_variance4x4_ssse3 = 1752 vpx_sub_pixel_variance4x4_ssse3; 1753 INSTANTIATE_TEST_CASE_P( 1754 SSSE3, VpxSubpelVarianceTest, 1755 ::testing::Values(make_tuple(6, 6, subpel_variance64x64_ssse3, 0), 1756 make_tuple(6, 5, subpel_variance64x32_ssse3, 0), 1757 make_tuple(5, 6, subpel_variance32x64_ssse3, 0), 1758 make_tuple(5, 5, subpel_variance32x32_ssse3, 0), 1759 make_tuple(5, 4, subpel_variance32x16_ssse3, 0), 1760 make_tuple(4, 5, subpel_variance16x32_ssse3, 0), 1761 make_tuple(4, 4, subpel_variance16x16_ssse3, 0), 1762 make_tuple(4, 3, subpel_variance16x8_ssse3, 0), 1763 make_tuple(3, 4, subpel_variance8x16_ssse3, 0), 1764 make_tuple(3, 3, subpel_variance8x8_ssse3, 0), 1765 make_tuple(3, 2, subpel_variance8x4_ssse3, 0), 1766 make_tuple(2, 3, subpel_variance4x8_ssse3, 0), 1767 make_tuple(2, 2, subpel_variance4x4_ssse3, 0))); 1768 1769 const SubpixAvgVarMxNFunc subpel_avg_variance64x64_ssse3 = 1770 vpx_sub_pixel_avg_variance64x64_ssse3; 1771 const SubpixAvgVarMxNFunc subpel_avg_variance64x32_ssse3 = 1772 vpx_sub_pixel_avg_variance64x32_ssse3; 1773 const SubpixAvgVarMxNFunc subpel_avg_variance32x64_ssse3 = 1774 vpx_sub_pixel_avg_variance32x64_ssse3; 1775 const SubpixAvgVarMxNFunc subpel_avg_variance32x32_ssse3 = 1776 vpx_sub_pixel_avg_variance32x32_ssse3; 1777 const SubpixAvgVarMxNFunc subpel_avg_variance32x16_ssse3 = 1778 vpx_sub_pixel_avg_variance32x16_ssse3; 1779 const SubpixAvgVarMxNFunc subpel_avg_variance16x32_ssse3 = 1780 vpx_sub_pixel_avg_variance16x32_ssse3; 1781 const SubpixAvgVarMxNFunc subpel_avg_variance16x16_ssse3 = 1782 vpx_sub_pixel_avg_variance16x16_ssse3; 1783 const SubpixAvgVarMxNFunc subpel_avg_variance16x8_ssse3 = 1784 vpx_sub_pixel_avg_variance16x8_ssse3; 1785 const SubpixAvgVarMxNFunc subpel_avg_variance8x16_ssse3 = 1786 vpx_sub_pixel_avg_variance8x16_ssse3; 1787 const SubpixAvgVarMxNFunc subpel_avg_variance8x8_ssse3 = 1788 vpx_sub_pixel_avg_variance8x8_ssse3; 1789 const SubpixAvgVarMxNFunc subpel_avg_variance8x4_ssse3 = 1790 vpx_sub_pixel_avg_variance8x4_ssse3; 1791 const SubpixAvgVarMxNFunc subpel_avg_variance4x8_ssse3 = 1792 vpx_sub_pixel_avg_variance4x8_ssse3; 1793 const SubpixAvgVarMxNFunc subpel_avg_variance4x4_ssse3 = 1794 vpx_sub_pixel_avg_variance4x4_ssse3; 1795 INSTANTIATE_TEST_CASE_P( 1796 SSSE3, VpxSubpelAvgVarianceTest, 1797 ::testing::Values(make_tuple(6, 6, subpel_avg_variance64x64_ssse3, 0), 1798 make_tuple(6, 5, subpel_avg_variance64x32_ssse3, 0), 1799 make_tuple(5, 6, subpel_avg_variance32x64_ssse3, 0), 1800 make_tuple(5, 5, subpel_avg_variance32x32_ssse3, 0), 1801 make_tuple(5, 4, subpel_avg_variance32x16_ssse3, 0), 1802 make_tuple(4, 5, subpel_avg_variance16x32_ssse3, 0), 1803 make_tuple(4, 4, subpel_avg_variance16x16_ssse3, 0), 1804 make_tuple(4, 3, subpel_avg_variance16x8_ssse3, 0), 1805 make_tuple(3, 4, subpel_avg_variance8x16_ssse3, 0), 1806 make_tuple(3, 3, subpel_avg_variance8x8_ssse3, 0), 1807 make_tuple(3, 2, subpel_avg_variance8x4_ssse3, 0), 1808 make_tuple(2, 3, subpel_avg_variance4x8_ssse3, 0), 1809 make_tuple(2, 2, subpel_avg_variance4x4_ssse3, 0))); 1810 #endif // CONFIG_USE_X86INC 1811 #endif // HAVE_SSSE3 1812 1813 #if HAVE_AVX2 1814 const VarianceMxNFunc mse16x16_avx2 = vpx_mse16x16_avx2; 1815 INSTANTIATE_TEST_CASE_P(AVX2, VpxMseTest, 1816 ::testing::Values(make_tuple(4, 4, mse16x16_avx2))); 1817 1818 const VarianceMxNFunc variance64x64_avx2 = vpx_variance64x64_avx2; 1819 const VarianceMxNFunc variance64x32_avx2 = vpx_variance64x32_avx2; 1820 const VarianceMxNFunc variance32x32_avx2 = vpx_variance32x32_avx2; 1821 const VarianceMxNFunc variance32x16_avx2 = vpx_variance32x16_avx2; 1822 const VarianceMxNFunc variance16x16_avx2 = vpx_variance16x16_avx2; 1823 INSTANTIATE_TEST_CASE_P( 1824 AVX2, VpxVarianceTest, 1825 ::testing::Values(make_tuple(6, 6, variance64x64_avx2, 0), 1826 make_tuple(6, 5, variance64x32_avx2, 0), 1827 make_tuple(5, 5, variance32x32_avx2, 0), 1828 make_tuple(5, 4, variance32x16_avx2, 0), 1829 make_tuple(4, 4, variance16x16_avx2, 0))); 1830 1831 const SubpixVarMxNFunc subpel_variance64x64_avx2 = 1832 vpx_sub_pixel_variance64x64_avx2; 1833 const SubpixVarMxNFunc subpel_variance32x32_avx2 = 1834 vpx_sub_pixel_variance32x32_avx2; 1835 INSTANTIATE_TEST_CASE_P( 1836 AVX2, VpxSubpelVarianceTest, 1837 ::testing::Values(make_tuple(6, 6, subpel_variance64x64_avx2, 0), 1838 make_tuple(5, 5, subpel_variance32x32_avx2, 0))); 1839 1840 const SubpixAvgVarMxNFunc subpel_avg_variance64x64_avx2 = 1841 vpx_sub_pixel_avg_variance64x64_avx2; 1842 const SubpixAvgVarMxNFunc subpel_avg_variance32x32_avx2 = 1843 vpx_sub_pixel_avg_variance32x32_avx2; 1844 INSTANTIATE_TEST_CASE_P( 1845 AVX2, VpxSubpelAvgVarianceTest, 1846 ::testing::Values(make_tuple(6, 6, subpel_avg_variance64x64_avx2, 0), 1847 make_tuple(5, 5, subpel_avg_variance32x32_avx2, 0))); 1848 #endif // HAVE_AVX2 1849 1850 #if HAVE_MEDIA 1851 const VarianceMxNFunc mse16x16_media = vpx_mse16x16_media; 1852 INSTANTIATE_TEST_CASE_P(MEDIA, VpxMseTest, 1853 ::testing::Values(make_tuple(4, 4, mse16x16_media))); 1854 1855 const VarianceMxNFunc variance16x16_media = vpx_variance16x16_media; 1856 const VarianceMxNFunc variance8x8_media = vpx_variance8x8_media; 1857 INSTANTIATE_TEST_CASE_P( 1858 MEDIA, VpxVarianceTest, 1859 ::testing::Values(make_tuple(4, 4, variance16x16_media, 0), 1860 make_tuple(3, 3, variance8x8_media, 0))); 1861 1862 const SubpixVarMxNFunc subpel_variance16x16_media = 1863 vpx_sub_pixel_variance16x16_media; 1864 const SubpixVarMxNFunc subpel_variance8x8_media = 1865 vpx_sub_pixel_variance8x8_media; 1866 INSTANTIATE_TEST_CASE_P( 1867 MEDIA, VpxSubpelVarianceTest, 1868 ::testing::Values(make_tuple(4, 4, subpel_variance16x16_media, 0), 1869 make_tuple(3, 3, subpel_variance8x8_media, 0))); 1870 #endif // HAVE_MEDIA 1871 1872 #if HAVE_NEON 1873 const Get4x4SseFunc get4x4sse_cs_neon = vpx_get4x4sse_cs_neon; 1874 INSTANTIATE_TEST_CASE_P(NEON, VpxSseTest, 1875 ::testing::Values(make_tuple(2, 2, get4x4sse_cs_neon))); 1876 1877 const VarianceMxNFunc mse16x16_neon = vpx_mse16x16_neon; 1878 INSTANTIATE_TEST_CASE_P(NEON, VpxMseTest, 1879 ::testing::Values(make_tuple(4, 4, mse16x16_neon))); 1880 1881 const VarianceMxNFunc variance64x64_neon = vpx_variance64x64_neon; 1882 const VarianceMxNFunc variance64x32_neon = vpx_variance64x32_neon; 1883 const VarianceMxNFunc variance32x64_neon = vpx_variance32x64_neon; 1884 const VarianceMxNFunc variance32x32_neon = vpx_variance32x32_neon; 1885 const VarianceMxNFunc variance16x16_neon = vpx_variance16x16_neon; 1886 const VarianceMxNFunc variance16x8_neon = vpx_variance16x8_neon; 1887 const VarianceMxNFunc variance8x16_neon = vpx_variance8x16_neon; 1888 const VarianceMxNFunc variance8x8_neon = vpx_variance8x8_neon; 1889 INSTANTIATE_TEST_CASE_P( 1890 NEON, VpxVarianceTest, 1891 ::testing::Values(make_tuple(6, 6, variance64x64_neon, 0), 1892 make_tuple(6, 5, variance64x32_neon, 0), 1893 make_tuple(5, 6, variance32x64_neon, 0), 1894 make_tuple(5, 5, variance32x32_neon, 0), 1895 make_tuple(4, 4, variance16x16_neon, 0), 1896 make_tuple(4, 3, variance16x8_neon, 0), 1897 make_tuple(3, 4, variance8x16_neon, 0), 1898 make_tuple(3, 3, variance8x8_neon, 0))); 1899 1900 const SubpixVarMxNFunc subpel_variance64x64_neon = 1901 vpx_sub_pixel_variance64x64_neon; 1902 const SubpixVarMxNFunc subpel_variance32x32_neon = 1903 vpx_sub_pixel_variance32x32_neon; 1904 const SubpixVarMxNFunc subpel_variance16x16_neon = 1905 vpx_sub_pixel_variance16x16_neon; 1906 const SubpixVarMxNFunc subpel_variance8x8_neon = vpx_sub_pixel_variance8x8_neon; 1907 INSTANTIATE_TEST_CASE_P( 1908 NEON, VpxSubpelVarianceTest, 1909 ::testing::Values(make_tuple(6, 6, subpel_variance64x64_neon, 0), 1910 make_tuple(5, 5, subpel_variance32x32_neon, 0), 1911 make_tuple(4, 4, subpel_variance16x16_neon, 0), 1912 make_tuple(3, 3, subpel_variance8x8_neon, 0))); 1913 #endif // HAVE_NEON 1914 1915 #if HAVE_MSA 1916 INSTANTIATE_TEST_CASE_P(MSA, SumOfSquaresTest, 1917 ::testing::Values(vpx_get_mb_ss_msa)); 1918 1919 const Get4x4SseFunc get4x4sse_cs_msa = vpx_get4x4sse_cs_msa; 1920 INSTANTIATE_TEST_CASE_P(MSA, VpxSseTest, 1921 ::testing::Values(make_tuple(2, 2, get4x4sse_cs_msa))); 1922 1923 const VarianceMxNFunc mse16x16_msa = vpx_mse16x16_msa; 1924 const VarianceMxNFunc mse16x8_msa = vpx_mse16x8_msa; 1925 const VarianceMxNFunc mse8x16_msa = vpx_mse8x16_msa; 1926 const VarianceMxNFunc mse8x8_msa = vpx_mse8x8_msa; 1927 INSTANTIATE_TEST_CASE_P(MSA, VpxMseTest, 1928 ::testing::Values(make_tuple(4, 4, mse16x16_msa), 1929 make_tuple(4, 3, mse16x8_msa), 1930 make_tuple(3, 4, mse8x16_msa), 1931 make_tuple(3, 3, mse8x8_msa))); 1932 1933 const VarianceMxNFunc variance64x64_msa = vpx_variance64x64_msa; 1934 const VarianceMxNFunc variance64x32_msa = vpx_variance64x32_msa; 1935 const VarianceMxNFunc variance32x64_msa = vpx_variance32x64_msa; 1936 const VarianceMxNFunc variance32x32_msa = vpx_variance32x32_msa; 1937 const VarianceMxNFunc variance32x16_msa = vpx_variance32x16_msa; 1938 const VarianceMxNFunc variance16x32_msa = vpx_variance16x32_msa; 1939 const VarianceMxNFunc variance16x16_msa = vpx_variance16x16_msa; 1940 const VarianceMxNFunc variance16x8_msa = vpx_variance16x8_msa; 1941 const VarianceMxNFunc variance8x16_msa = vpx_variance8x16_msa; 1942 const VarianceMxNFunc variance8x8_msa = vpx_variance8x8_msa; 1943 const VarianceMxNFunc variance8x4_msa = vpx_variance8x4_msa; 1944 const VarianceMxNFunc variance4x8_msa = vpx_variance4x8_msa; 1945 const VarianceMxNFunc variance4x4_msa = vpx_variance4x4_msa; 1946 INSTANTIATE_TEST_CASE_P( 1947 MSA, VpxVarianceTest, 1948 ::testing::Values(make_tuple(6, 6, variance64x64_msa, 0), 1949 make_tuple(6, 5, variance64x32_msa, 0), 1950 make_tuple(5, 6, variance32x64_msa, 0), 1951 make_tuple(5, 5, variance32x32_msa, 0), 1952 make_tuple(5, 4, variance32x16_msa, 0), 1953 make_tuple(4, 5, variance16x32_msa, 0), 1954 make_tuple(4, 4, variance16x16_msa, 0), 1955 make_tuple(4, 3, variance16x8_msa, 0), 1956 make_tuple(3, 4, variance8x16_msa, 0), 1957 make_tuple(3, 3, variance8x8_msa, 0), 1958 make_tuple(3, 2, variance8x4_msa, 0), 1959 make_tuple(2, 3, variance4x8_msa, 0), 1960 make_tuple(2, 2, variance4x4_msa, 0))); 1961 1962 const SubpixVarMxNFunc subpel_variance4x4_msa = vpx_sub_pixel_variance4x4_msa; 1963 const SubpixVarMxNFunc subpel_variance4x8_msa = vpx_sub_pixel_variance4x8_msa; 1964 const SubpixVarMxNFunc subpel_variance8x4_msa = vpx_sub_pixel_variance8x4_msa; 1965 const SubpixVarMxNFunc subpel_variance8x8_msa = vpx_sub_pixel_variance8x8_msa; 1966 const SubpixVarMxNFunc subpel_variance8x16_msa = vpx_sub_pixel_variance8x16_msa; 1967 const SubpixVarMxNFunc subpel_variance16x8_msa = vpx_sub_pixel_variance16x8_msa; 1968 const SubpixVarMxNFunc subpel_variance16x16_msa = 1969 vpx_sub_pixel_variance16x16_msa; 1970 const SubpixVarMxNFunc subpel_variance16x32_msa = 1971 vpx_sub_pixel_variance16x32_msa; 1972 const SubpixVarMxNFunc subpel_variance32x16_msa = 1973 vpx_sub_pixel_variance32x16_msa; 1974 const SubpixVarMxNFunc subpel_variance32x32_msa = 1975 vpx_sub_pixel_variance32x32_msa; 1976 const SubpixVarMxNFunc subpel_variance32x64_msa = 1977 vpx_sub_pixel_variance32x64_msa; 1978 const SubpixVarMxNFunc subpel_variance64x32_msa = 1979 vpx_sub_pixel_variance64x32_msa; 1980 const SubpixVarMxNFunc subpel_variance64x64_msa = 1981 vpx_sub_pixel_variance64x64_msa; 1982 INSTANTIATE_TEST_CASE_P( 1983 MSA, VpxSubpelVarianceTest, 1984 ::testing::Values(make_tuple(2, 2, subpel_variance4x4_msa, 0), 1985 make_tuple(2, 3, subpel_variance4x8_msa, 0), 1986 make_tuple(3, 2, subpel_variance8x4_msa, 0), 1987 make_tuple(3, 3, subpel_variance8x8_msa, 0), 1988 make_tuple(3, 4, subpel_variance8x16_msa, 0), 1989 make_tuple(4, 3, subpel_variance16x8_msa, 0), 1990 make_tuple(4, 4, subpel_variance16x16_msa, 0), 1991 make_tuple(4, 5, subpel_variance16x32_msa, 0), 1992 make_tuple(5, 4, subpel_variance32x16_msa, 0), 1993 make_tuple(5, 5, subpel_variance32x32_msa, 0), 1994 make_tuple(5, 6, subpel_variance32x64_msa, 0), 1995 make_tuple(6, 5, subpel_variance64x32_msa, 0), 1996 make_tuple(6, 6, subpel_variance64x64_msa, 0))); 1997 1998 const SubpixAvgVarMxNFunc subpel_avg_variance64x64_msa = 1999 vpx_sub_pixel_avg_variance64x64_msa; 2000 const SubpixAvgVarMxNFunc subpel_avg_variance64x32_msa = 2001 vpx_sub_pixel_avg_variance64x32_msa; 2002 const SubpixAvgVarMxNFunc subpel_avg_variance32x64_msa = 2003 vpx_sub_pixel_avg_variance32x64_msa; 2004 const SubpixAvgVarMxNFunc subpel_avg_variance32x32_msa = 2005 vpx_sub_pixel_avg_variance32x32_msa; 2006 const SubpixAvgVarMxNFunc subpel_avg_variance32x16_msa = 2007 vpx_sub_pixel_avg_variance32x16_msa; 2008 const SubpixAvgVarMxNFunc subpel_avg_variance16x32_msa = 2009 vpx_sub_pixel_avg_variance16x32_msa; 2010 const SubpixAvgVarMxNFunc subpel_avg_variance16x16_msa = 2011 vpx_sub_pixel_avg_variance16x16_msa; 2012 const SubpixAvgVarMxNFunc subpel_avg_variance16x8_msa = 2013 vpx_sub_pixel_avg_variance16x8_msa; 2014 const SubpixAvgVarMxNFunc subpel_avg_variance8x16_msa = 2015 vpx_sub_pixel_avg_variance8x16_msa; 2016 const SubpixAvgVarMxNFunc subpel_avg_variance8x8_msa = 2017 vpx_sub_pixel_avg_variance8x8_msa; 2018 const SubpixAvgVarMxNFunc subpel_avg_variance8x4_msa = 2019 vpx_sub_pixel_avg_variance8x4_msa; 2020 const SubpixAvgVarMxNFunc subpel_avg_variance4x8_msa = 2021 vpx_sub_pixel_avg_variance4x8_msa; 2022 const SubpixAvgVarMxNFunc subpel_avg_variance4x4_msa = 2023 vpx_sub_pixel_avg_variance4x4_msa; 2024 INSTANTIATE_TEST_CASE_P( 2025 MSA, VpxSubpelAvgVarianceTest, 2026 ::testing::Values(make_tuple(6, 6, subpel_avg_variance64x64_msa, 0), 2027 make_tuple(6, 5, subpel_avg_variance64x32_msa, 0), 2028 make_tuple(5, 6, subpel_avg_variance32x64_msa, 0), 2029 make_tuple(5, 5, subpel_avg_variance32x32_msa, 0), 2030 make_tuple(5, 4, subpel_avg_variance32x16_msa, 0), 2031 make_tuple(4, 5, subpel_avg_variance16x32_msa, 0), 2032 make_tuple(4, 4, subpel_avg_variance16x16_msa, 0), 2033 make_tuple(4, 3, subpel_avg_variance16x8_msa, 0), 2034 make_tuple(3, 4, subpel_avg_variance8x16_msa, 0), 2035 make_tuple(3, 3, subpel_avg_variance8x8_msa, 0), 2036 make_tuple(3, 2, subpel_avg_variance8x4_msa, 0), 2037 make_tuple(2, 3, subpel_avg_variance4x8_msa, 0), 2038 make_tuple(2, 2, subpel_avg_variance4x4_msa, 0))); 2039 #endif // HAVE_MSA 2040 } // namespace 2041