1 /* 2 * Copyright (c) 2013 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 <math.h> 12 #include <stdlib.h> 13 #include <string.h> 14 15 #include <limits> 16 17 #include "third_party/googletest/src/include/gtest/gtest.h" 18 19 #include "./vp9_rtcd.h" 20 #include "./vpx_dsp_rtcd.h" 21 #include "test/acm_random.h" 22 #include "test/clear_system_state.h" 23 #include "test/register_state_check.h" 24 #include "test/util.h" 25 #include "vp9/common/vp9_blockd.h" 26 #include "vp9/common/vp9_scan.h" 27 #include "vpx/vpx_integer.h" 28 #include "vpx_ports/vpx_timer.h" 29 30 using libvpx_test::ACMRandom; 31 32 namespace { 33 34 typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride); 35 typedef void (*InvTxfmFunc)(const tran_low_t *in, uint8_t *out, int stride); 36 typedef void (*InvTxfmWithBdFunc)(const tran_low_t *in, uint8_t *out, 37 int stride, int bd); 38 39 template <InvTxfmFunc fn> 40 void wrapper(const tran_low_t *in, uint8_t *out, int stride, int bd) { 41 (void)bd; 42 fn(in, out, stride); 43 } 44 45 #if CONFIG_VP9_HIGHBITDEPTH 46 typedef void (*InvTxfmHighbdFunc)(const tran_low_t *in, uint16_t *out, 47 int stride, int bd); 48 template <InvTxfmHighbdFunc fn> 49 void highbd_wrapper(const tran_low_t *in, uint8_t *out, int stride, int bd) { 50 fn(in, CAST_TO_SHORTPTR(out), stride, bd); 51 } 52 #endif 53 54 typedef std::tr1::tuple<FwdTxfmFunc, InvTxfmWithBdFunc, InvTxfmWithBdFunc, 55 TX_SIZE, int, int, int> 56 PartialInvTxfmParam; 57 const int kMaxNumCoeffs = 1024; 58 const int kCountTestBlock = 1000; 59 60 class PartialIDctTest : public ::testing::TestWithParam<PartialInvTxfmParam> { 61 public: 62 virtual ~PartialIDctTest() {} 63 virtual void SetUp() { 64 rnd_.Reset(ACMRandom::DeterministicSeed()); 65 fwd_txfm_ = GET_PARAM(0); 66 full_inv_txfm_ = GET_PARAM(1); 67 partial_inv_txfm_ = GET_PARAM(2); 68 tx_size_ = GET_PARAM(3); 69 last_nonzero_ = GET_PARAM(4); 70 bit_depth_ = GET_PARAM(5); 71 pixel_size_ = GET_PARAM(6); 72 mask_ = (1 << bit_depth_) - 1; 73 74 switch (tx_size_) { 75 case TX_4X4: size_ = 4; break; 76 case TX_8X8: size_ = 8; break; 77 case TX_16X16: size_ = 16; break; 78 case TX_32X32: size_ = 32; break; 79 default: FAIL() << "Wrong Size!"; break; 80 } 81 82 // Randomize stride_ to a value less than or equal to 1024 83 stride_ = rnd_(1024) + 1; 84 if (stride_ < size_) { 85 stride_ = size_; 86 } 87 // Align stride_ to 16 if it's bigger than 16. 88 if (stride_ > 16) { 89 stride_ &= ~15; 90 } 91 92 input_block_size_ = size_ * size_; 93 output_block_size_ = size_ * stride_; 94 95 input_block_ = reinterpret_cast<tran_low_t *>( 96 vpx_memalign(16, sizeof(*input_block_) * input_block_size_)); 97 output_block_ = reinterpret_cast<uint8_t *>( 98 vpx_memalign(16, pixel_size_ * output_block_size_)); 99 output_block_ref_ = reinterpret_cast<uint8_t *>( 100 vpx_memalign(16, pixel_size_ * output_block_size_)); 101 } 102 103 virtual void TearDown() { 104 vpx_free(input_block_); 105 input_block_ = NULL; 106 vpx_free(output_block_); 107 output_block_ = NULL; 108 vpx_free(output_block_ref_); 109 output_block_ref_ = NULL; 110 libvpx_test::ClearSystemState(); 111 } 112 113 void InitMem() { 114 memset(input_block_, 0, sizeof(*input_block_) * input_block_size_); 115 if (pixel_size_ == 1) { 116 for (int j = 0; j < output_block_size_; ++j) { 117 output_block_[j] = output_block_ref_[j] = rnd_.Rand16() & mask_; 118 } 119 } else { 120 ASSERT_EQ(2, pixel_size_); 121 uint16_t *const output = reinterpret_cast<uint16_t *>(output_block_); 122 uint16_t *const output_ref = 123 reinterpret_cast<uint16_t *>(output_block_ref_); 124 for (int j = 0; j < output_block_size_; ++j) { 125 output[j] = output_ref[j] = rnd_.Rand16() & mask_; 126 } 127 } 128 } 129 130 void InitInput() { 131 const int64_t max_coeff = (32766 << (bit_depth_ - 8)) / 4; 132 int64_t max_energy_leftover = max_coeff * max_coeff; 133 for (int j = 0; j < last_nonzero_; ++j) { 134 tran_low_t coeff = static_cast<tran_low_t>( 135 sqrt(1.0 * max_energy_leftover) * (rnd_.Rand16() - 32768) / 65536); 136 max_energy_leftover -= static_cast<int64_t>(coeff) * coeff; 137 if (max_energy_leftover < 0) { 138 max_energy_leftover = 0; 139 coeff = 0; 140 } 141 input_block_[vp9_default_scan_orders[tx_size_].scan[j]] = coeff; 142 } 143 } 144 145 void PrintDiff() { 146 if (memcmp(output_block_ref_, output_block_, 147 pixel_size_ * output_block_size_)) { 148 uint16_t ref, opt; 149 for (int y = 0; y < size_; y++) { 150 for (int x = 0; x < size_; x++) { 151 if (pixel_size_ == 1) { 152 ref = output_block_ref_[y * stride_ + x]; 153 opt = output_block_[y * stride_ + x]; 154 } else { 155 ref = reinterpret_cast<uint16_t *>( 156 output_block_ref_)[y * stride_ + x]; 157 opt = reinterpret_cast<uint16_t *>(output_block_)[y * stride_ + x]; 158 } 159 if (ref != opt) { 160 printf("dest[%d][%d] diff:%6d (ref),%6d (opt)\n", y, x, ref, opt); 161 } 162 } 163 } 164 165 printf("\ninput_block_:\n"); 166 for (int y = 0; y < size_; y++) { 167 for (int x = 0; x < size_; x++) { 168 printf("%6d,", input_block_[y * size_ + x]); 169 } 170 printf("\n"); 171 } 172 } 173 } 174 175 protected: 176 int last_nonzero_; 177 TX_SIZE tx_size_; 178 tran_low_t *input_block_; 179 uint8_t *output_block_; 180 uint8_t *output_block_ref_; 181 int size_; 182 int stride_; 183 int pixel_size_; 184 int input_block_size_; 185 int output_block_size_; 186 int bit_depth_; 187 int mask_; 188 FwdTxfmFunc fwd_txfm_; 189 InvTxfmWithBdFunc full_inv_txfm_; 190 InvTxfmWithBdFunc partial_inv_txfm_; 191 ACMRandom rnd_; 192 }; 193 194 TEST_P(PartialIDctTest, RunQuantCheck) { 195 const int count_test_block = (size_ != 4) ? kCountTestBlock : 65536; 196 DECLARE_ALIGNED(16, int16_t, input_extreme_block[kMaxNumCoeffs]); 197 DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kMaxNumCoeffs]); 198 199 InitMem(); 200 201 for (int i = 0; i < count_test_block; ++i) { 202 // Initialize a test block with input range [-mask_, mask_]. 203 if (size_ != 4) { 204 if (i == 0) { 205 for (int k = 0; k < input_block_size_; ++k) { 206 input_extreme_block[k] = mask_; 207 } 208 } else if (i == 1) { 209 for (int k = 0; k < input_block_size_; ++k) { 210 input_extreme_block[k] = -mask_; 211 } 212 } else { 213 for (int k = 0; k < input_block_size_; ++k) { 214 input_extreme_block[k] = rnd_.Rand8() % 2 ? mask_ : -mask_; 215 } 216 } 217 } else { 218 // Try all possible combinations. 219 for (int k = 0; k < input_block_size_; ++k) { 220 input_extreme_block[k] = (i & (1 << k)) ? mask_ : -mask_; 221 } 222 } 223 224 fwd_txfm_(input_extreme_block, output_ref_block, size_); 225 226 // quantization with minimum allowed step sizes 227 input_block_[0] = (output_ref_block[0] / 4) * 4; 228 for (int k = 1; k < last_nonzero_; ++k) { 229 const int pos = vp9_default_scan_orders[tx_size_].scan[k]; 230 input_block_[pos] = (output_ref_block[pos] / 4) * 4; 231 } 232 233 ASM_REGISTER_STATE_CHECK( 234 full_inv_txfm_(input_block_, output_block_ref_, stride_, bit_depth_)); 235 ASM_REGISTER_STATE_CHECK( 236 partial_inv_txfm_(input_block_, output_block_, stride_, bit_depth_)); 237 ASSERT_EQ(0, memcmp(output_block_ref_, output_block_, 238 pixel_size_ * output_block_size_)) 239 << "Error: partial inverse transform produces different results"; 240 } 241 } 242 243 TEST_P(PartialIDctTest, ResultsMatch) { 244 for (int i = 0; i < kCountTestBlock; ++i) { 245 InitMem(); 246 InitInput(); 247 248 ASM_REGISTER_STATE_CHECK( 249 full_inv_txfm_(input_block_, output_block_ref_, stride_, bit_depth_)); 250 ASM_REGISTER_STATE_CHECK( 251 partial_inv_txfm_(input_block_, output_block_, stride_, bit_depth_)); 252 ASSERT_EQ(0, memcmp(output_block_ref_, output_block_, 253 pixel_size_ * output_block_size_)) 254 << "Error: partial inverse transform produces different results"; 255 } 256 } 257 258 TEST_P(PartialIDctTest, AddOutputBlock) { 259 for (int i = 0; i < kCountTestBlock; ++i) { 260 InitMem(); 261 for (int j = 0; j < last_nonzero_; ++j) { 262 input_block_[vp9_default_scan_orders[tx_size_].scan[j]] = 10; 263 } 264 265 ASM_REGISTER_STATE_CHECK( 266 full_inv_txfm_(input_block_, output_block_ref_, stride_, bit_depth_)); 267 ASM_REGISTER_STATE_CHECK( 268 partial_inv_txfm_(input_block_, output_block_, stride_, bit_depth_)); 269 ASSERT_EQ(0, memcmp(output_block_ref_, output_block_, 270 pixel_size_ * output_block_size_)) 271 << "Error: Transform results are not correctly added to output."; 272 } 273 } 274 275 TEST_P(PartialIDctTest, SingleExtremeCoeff) { 276 const int16_t max_coeff = std::numeric_limits<int16_t>::max(); 277 const int16_t min_coeff = std::numeric_limits<int16_t>::min(); 278 for (int i = 0; i < last_nonzero_; ++i) { 279 memset(input_block_, 0, sizeof(*input_block_) * input_block_size_); 280 // Run once for min and once for max. 281 for (int j = 0; j < 2; ++j) { 282 const int coeff = j ? min_coeff : max_coeff; 283 284 memset(output_block_, 0, pixel_size_ * output_block_size_); 285 memset(output_block_ref_, 0, pixel_size_ * output_block_size_); 286 input_block_[vp9_default_scan_orders[tx_size_].scan[i]] = coeff; 287 288 ASM_REGISTER_STATE_CHECK( 289 full_inv_txfm_(input_block_, output_block_ref_, stride_, bit_depth_)); 290 ASM_REGISTER_STATE_CHECK( 291 partial_inv_txfm_(input_block_, output_block_, stride_, bit_depth_)); 292 ASSERT_EQ(0, memcmp(output_block_ref_, output_block_, 293 pixel_size_ * output_block_size_)) 294 << "Error: Fails with single coeff of " << coeff << " at " << i 295 << "."; 296 } 297 } 298 } 299 300 TEST_P(PartialIDctTest, DISABLED_Speed) { 301 // Keep runtime stable with transform size. 302 const int kCountSpeedTestBlock = 500000000 / input_block_size_; 303 InitMem(); 304 InitInput(); 305 306 for (int i = 0; i < kCountSpeedTestBlock; ++i) { 307 ASM_REGISTER_STATE_CHECK( 308 full_inv_txfm_(input_block_, output_block_ref_, stride_, bit_depth_)); 309 } 310 vpx_usec_timer timer; 311 vpx_usec_timer_start(&timer); 312 for (int i = 0; i < kCountSpeedTestBlock; ++i) { 313 partial_inv_txfm_(input_block_, output_block_, stride_, bit_depth_); 314 } 315 libvpx_test::ClearSystemState(); 316 vpx_usec_timer_mark(&timer); 317 const int elapsed_time = 318 static_cast<int>(vpx_usec_timer_elapsed(&timer) / 1000); 319 printf("idct%dx%d_%d (%s %d) time: %5d ms\n", size_, size_, last_nonzero_, 320 (pixel_size_ == 1) ? "bitdepth" : "high bitdepth", bit_depth_, 321 elapsed_time); 322 ASSERT_EQ(0, memcmp(output_block_ref_, output_block_, 323 pixel_size_ * output_block_size_)) 324 << "Error: partial inverse transform produces different results"; 325 } 326 327 using std::tr1::make_tuple; 328 329 const PartialInvTxfmParam c_partial_idct_tests[] = { 330 #if CONFIG_VP9_HIGHBITDEPTH 331 make_tuple( 332 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 333 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, TX_32X32, 1024, 8, 2), 334 make_tuple( 335 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 336 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, TX_32X32, 1024, 10, 2), 337 make_tuple( 338 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 339 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, TX_32X32, 1024, 12, 2), 340 make_tuple( 341 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 342 &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, TX_32X32, 135, 8, 2), 343 make_tuple( 344 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 345 &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, TX_32X32, 135, 10, 2), 346 make_tuple( 347 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 348 &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, TX_32X32, 135, 12, 2), 349 make_tuple( 350 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 351 &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, TX_32X32, 34, 8, 2), 352 make_tuple( 353 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 354 &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, TX_32X32, 34, 10, 2), 355 make_tuple( 356 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 357 &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, TX_32X32, 34, 12, 2), 358 make_tuple(&vpx_highbd_fdct32x32_c, 359 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 360 &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, TX_32X32, 1, 8, 2), 361 make_tuple(&vpx_highbd_fdct32x32_c, 362 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 363 &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, TX_32X32, 1, 10, 2), 364 make_tuple(&vpx_highbd_fdct32x32_c, 365 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 366 &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, TX_32X32, 1, 12, 2), 367 make_tuple( 368 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 369 &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, TX_16X16, 256, 8, 2), 370 make_tuple( 371 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 372 &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, TX_16X16, 256, 10, 2), 373 make_tuple( 374 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 375 &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, TX_16X16, 256, 12, 2), 376 make_tuple( 377 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 378 &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, TX_16X16, 38, 8, 2), 379 make_tuple( 380 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 381 &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, TX_16X16, 38, 10, 2), 382 make_tuple( 383 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 384 &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, TX_16X16, 38, 12, 2), 385 make_tuple( 386 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 387 &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, TX_16X16, 10, 8, 2), 388 make_tuple( 389 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 390 &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, TX_16X16, 10, 10, 2), 391 make_tuple( 392 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 393 &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, TX_16X16, 10, 12, 2), 394 make_tuple(&vpx_highbd_fdct16x16_c, 395 &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 396 &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, TX_16X16, 1, 8, 2), 397 make_tuple(&vpx_highbd_fdct16x16_c, 398 &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 399 &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, TX_16X16, 1, 10, 2), 400 make_tuple(&vpx_highbd_fdct16x16_c, 401 &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 402 &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, TX_16X16, 1, 12, 2), 403 make_tuple(&vpx_highbd_fdct8x8_c, 404 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 405 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, TX_8X8, 64, 8, 2), 406 make_tuple(&vpx_highbd_fdct8x8_c, 407 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 408 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, TX_8X8, 64, 10, 2), 409 make_tuple(&vpx_highbd_fdct8x8_c, 410 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 411 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, TX_8X8, 64, 12, 2), 412 make_tuple(&vpx_highbd_fdct8x8_c, 413 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 414 &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, TX_8X8, 12, 8, 2), 415 make_tuple(&vpx_highbd_fdct8x8_c, 416 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 417 &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, TX_8X8, 12, 10, 2), 418 make_tuple(&vpx_highbd_fdct8x8_c, 419 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 420 &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, TX_8X8, 12, 12, 2), 421 make_tuple(&vpx_highbd_fdct8x8_c, 422 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 423 &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, TX_8X8, 1, 8, 2), 424 make_tuple(&vpx_highbd_fdct8x8_c, 425 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 426 &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, TX_8X8, 1, 10, 2), 427 make_tuple(&vpx_highbd_fdct8x8_c, 428 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 429 &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, TX_8X8, 1, 12, 2), 430 make_tuple(&vpx_highbd_fdct4x4_c, 431 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 432 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, TX_4X4, 16, 8, 2), 433 make_tuple(&vpx_highbd_fdct4x4_c, 434 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 435 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, TX_4X4, 16, 10, 2), 436 make_tuple(&vpx_highbd_fdct4x4_c, 437 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 438 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, TX_4X4, 16, 12, 2), 439 make_tuple(&vpx_highbd_fdct4x4_c, 440 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 441 &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, TX_4X4, 1, 8, 2), 442 make_tuple(&vpx_highbd_fdct4x4_c, 443 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 444 &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, TX_4X4, 1, 10, 2), 445 make_tuple(&vpx_highbd_fdct4x4_c, 446 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 447 &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, TX_4X4, 1, 12, 2), 448 #endif // CONFIG_VP9_HIGHBITDEPTH 449 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>, 450 &wrapper<vpx_idct32x32_1024_add_c>, TX_32X32, 1024, 8, 1), 451 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>, 452 &wrapper<vpx_idct32x32_135_add_c>, TX_32X32, 135, 8, 1), 453 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>, 454 &wrapper<vpx_idct32x32_34_add_c>, TX_32X32, 34, 8, 1), 455 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>, 456 &wrapper<vpx_idct32x32_1_add_c>, TX_32X32, 1, 8, 1), 457 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>, 458 &wrapper<vpx_idct16x16_256_add_c>, TX_16X16, 256, 8, 1), 459 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>, 460 &wrapper<vpx_idct16x16_38_add_c>, TX_16X16, 38, 8, 1), 461 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>, 462 &wrapper<vpx_idct16x16_10_add_c>, TX_16X16, 10, 8, 1), 463 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>, 464 &wrapper<vpx_idct16x16_1_add_c>, TX_16X16, 1, 8, 1), 465 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>, 466 &wrapper<vpx_idct8x8_64_add_c>, TX_8X8, 64, 8, 1), 467 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>, 468 &wrapper<vpx_idct8x8_12_add_c>, TX_8X8, 12, 8, 1), 469 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>, 470 &wrapper<vpx_idct8x8_1_add_c>, TX_8X8, 1, 8, 1), 471 make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>, 472 &wrapper<vpx_idct4x4_16_add_c>, TX_4X4, 16, 8, 1), 473 make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>, 474 &wrapper<vpx_idct4x4_1_add_c>, TX_4X4, 1, 8, 1) 475 }; 476 477 INSTANTIATE_TEST_CASE_P(C, PartialIDctTest, 478 ::testing::ValuesIn(c_partial_idct_tests)); 479 480 #if !CONFIG_EMULATE_HARDWARE 481 482 #if HAVE_NEON 483 const PartialInvTxfmParam neon_partial_idct_tests[] = { 484 #if CONFIG_VP9_HIGHBITDEPTH 485 make_tuple(&vpx_highbd_fdct32x32_c, 486 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 487 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_neon>, TX_32X32, 488 1024, 8, 2), 489 make_tuple(&vpx_highbd_fdct32x32_c, 490 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 491 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_neon>, TX_32X32, 492 1024, 10, 2), 493 make_tuple(&vpx_highbd_fdct32x32_c, 494 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 495 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_neon>, TX_32X32, 496 1024, 12, 2), 497 make_tuple( 498 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, 499 &highbd_wrapper<vpx_highbd_idct32x32_135_add_neon>, TX_32X32, 135, 8, 2), 500 make_tuple( 501 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, 502 &highbd_wrapper<vpx_highbd_idct32x32_135_add_neon>, TX_32X32, 135, 10, 2), 503 make_tuple( 504 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, 505 &highbd_wrapper<vpx_highbd_idct32x32_135_add_neon>, TX_32X32, 135, 12, 2), 506 make_tuple( 507 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, 508 &highbd_wrapper<vpx_highbd_idct32x32_34_add_neon>, TX_32X32, 34, 8, 2), 509 make_tuple( 510 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, 511 &highbd_wrapper<vpx_highbd_idct32x32_34_add_neon>, TX_32X32, 34, 10, 2), 512 make_tuple( 513 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, 514 &highbd_wrapper<vpx_highbd_idct32x32_34_add_neon>, TX_32X32, 34, 12, 2), 515 make_tuple( 516 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, 517 &highbd_wrapper<vpx_highbd_idct32x32_1_add_neon>, TX_32X32, 1, 8, 2), 518 make_tuple( 519 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, 520 &highbd_wrapper<vpx_highbd_idct32x32_1_add_neon>, TX_32X32, 1, 10, 2), 521 make_tuple( 522 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, 523 &highbd_wrapper<vpx_highbd_idct32x32_1_add_neon>, TX_32X32, 1, 12, 2), 524 make_tuple( 525 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 526 &highbd_wrapper<vpx_highbd_idct16x16_256_add_neon>, TX_16X16, 256, 8, 2), 527 make_tuple( 528 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 529 &highbd_wrapper<vpx_highbd_idct16x16_256_add_neon>, TX_16X16, 256, 10, 2), 530 make_tuple( 531 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 532 &highbd_wrapper<vpx_highbd_idct16x16_256_add_neon>, TX_16X16, 256, 12, 2), 533 make_tuple( 534 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, 535 &highbd_wrapper<vpx_highbd_idct16x16_38_add_neon>, TX_16X16, 38, 8, 2), 536 make_tuple( 537 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, 538 &highbd_wrapper<vpx_highbd_idct16x16_38_add_neon>, TX_16X16, 38, 10, 2), 539 make_tuple( 540 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, 541 &highbd_wrapper<vpx_highbd_idct16x16_38_add_neon>, TX_16X16, 38, 12, 2), 542 make_tuple( 543 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, 544 &highbd_wrapper<vpx_highbd_idct16x16_10_add_neon>, TX_16X16, 10, 8, 2), 545 make_tuple( 546 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, 547 &highbd_wrapper<vpx_highbd_idct16x16_10_add_neon>, TX_16X16, 10, 10, 2), 548 make_tuple( 549 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, 550 &highbd_wrapper<vpx_highbd_idct16x16_10_add_neon>, TX_16X16, 10, 12, 2), 551 make_tuple( 552 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, 553 &highbd_wrapper<vpx_highbd_idct16x16_1_add_neon>, TX_16X16, 1, 8, 2), 554 make_tuple( 555 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, 556 &highbd_wrapper<vpx_highbd_idct16x16_1_add_neon>, TX_16X16, 1, 10, 2), 557 make_tuple( 558 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, 559 &highbd_wrapper<vpx_highbd_idct16x16_1_add_neon>, TX_16X16, 1, 12, 2), 560 make_tuple(&vpx_highbd_fdct8x8_c, 561 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 562 &highbd_wrapper<vpx_highbd_idct8x8_64_add_neon>, TX_8X8, 64, 8, 2), 563 make_tuple( 564 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 565 &highbd_wrapper<vpx_highbd_idct8x8_64_add_neon>, TX_8X8, 64, 10, 2), 566 make_tuple( 567 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 568 &highbd_wrapper<vpx_highbd_idct8x8_64_add_neon>, TX_8X8, 64, 12, 2), 569 make_tuple(&vpx_highbd_fdct8x8_c, 570 &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, 571 &highbd_wrapper<vpx_highbd_idct8x8_12_add_neon>, TX_8X8, 12, 8, 2), 572 make_tuple( 573 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, 574 &highbd_wrapper<vpx_highbd_idct8x8_12_add_neon>, TX_8X8, 12, 10, 2), 575 make_tuple( 576 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, 577 &highbd_wrapper<vpx_highbd_idct8x8_12_add_neon>, TX_8X8, 12, 12, 2), 578 make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, 579 &highbd_wrapper<vpx_highbd_idct8x8_1_add_neon>, TX_8X8, 1, 8, 2), 580 make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, 581 &highbd_wrapper<vpx_highbd_idct8x8_1_add_neon>, TX_8X8, 1, 10, 2), 582 make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, 583 &highbd_wrapper<vpx_highbd_idct8x8_1_add_neon>, TX_8X8, 1, 12, 2), 584 make_tuple(&vpx_highbd_fdct4x4_c, 585 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 586 &highbd_wrapper<vpx_highbd_idct4x4_16_add_neon>, TX_4X4, 16, 8, 2), 587 make_tuple( 588 &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 589 &highbd_wrapper<vpx_highbd_idct4x4_16_add_neon>, TX_4X4, 16, 10, 2), 590 make_tuple( 591 &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 592 &highbd_wrapper<vpx_highbd_idct4x4_16_add_neon>, TX_4X4, 16, 12, 2), 593 make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, 594 &highbd_wrapper<vpx_highbd_idct4x4_1_add_neon>, TX_4X4, 1, 8, 2), 595 make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, 596 &highbd_wrapper<vpx_highbd_idct4x4_1_add_neon>, TX_4X4, 1, 10, 2), 597 make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, 598 &highbd_wrapper<vpx_highbd_idct4x4_1_add_neon>, TX_4X4, 1, 12, 2), 599 #endif // CONFIG_VP9_HIGHBITDEPTH 600 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>, 601 &wrapper<vpx_idct32x32_1024_add_neon>, TX_32X32, 1024, 8, 1), 602 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_135_add_c>, 603 &wrapper<vpx_idct32x32_135_add_neon>, TX_32X32, 135, 8, 1), 604 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>, 605 &wrapper<vpx_idct32x32_34_add_neon>, TX_32X32, 34, 8, 1), 606 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>, 607 &wrapper<vpx_idct32x32_1_add_neon>, TX_32X32, 1, 8, 1), 608 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>, 609 &wrapper<vpx_idct16x16_256_add_neon>, TX_16X16, 256, 8, 1), 610 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_38_add_c>, 611 &wrapper<vpx_idct16x16_38_add_neon>, TX_16X16, 38, 8, 1), 612 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>, 613 &wrapper<vpx_idct16x16_10_add_neon>, TX_16X16, 10, 8, 1), 614 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>, 615 &wrapper<vpx_idct16x16_1_add_neon>, TX_16X16, 1, 8, 1), 616 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>, 617 &wrapper<vpx_idct8x8_64_add_neon>, TX_8X8, 64, 8, 1), 618 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>, 619 &wrapper<vpx_idct8x8_12_add_neon>, TX_8X8, 12, 8, 1), 620 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>, 621 &wrapper<vpx_idct8x8_1_add_neon>, TX_8X8, 1, 8, 1), 622 make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>, 623 &wrapper<vpx_idct4x4_16_add_neon>, TX_4X4, 16, 8, 1), 624 make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>, 625 &wrapper<vpx_idct4x4_1_add_neon>, TX_4X4, 1, 8, 1) 626 }; 627 628 INSTANTIATE_TEST_CASE_P(NEON, PartialIDctTest, 629 ::testing::ValuesIn(neon_partial_idct_tests)); 630 #endif // HAVE_NEON 631 632 #if HAVE_SSE2 633 // 32x32_135_ is implemented using the 1024 version. 634 const PartialInvTxfmParam sse2_partial_idct_tests[] = { 635 #if CONFIG_VP9_HIGHBITDEPTH 636 make_tuple(&vpx_highbd_fdct32x32_c, 637 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 638 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse2>, TX_32X32, 639 1024, 8, 2), 640 make_tuple(&vpx_highbd_fdct32x32_c, 641 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 642 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse2>, TX_32X32, 643 1024, 10, 2), 644 make_tuple(&vpx_highbd_fdct32x32_c, 645 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 646 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse2>, TX_32X32, 647 1024, 12, 2), 648 make_tuple( 649 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, 650 &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse2>, TX_32X32, 135, 8, 2), 651 make_tuple( 652 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, 653 &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse2>, TX_32X32, 135, 10, 2), 654 make_tuple( 655 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, 656 &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse2>, TX_32X32, 135, 12, 2), 657 make_tuple( 658 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, 659 &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse2>, TX_32X32, 34, 8, 2), 660 make_tuple( 661 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, 662 &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse2>, TX_32X32, 34, 10, 2), 663 make_tuple( 664 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, 665 &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse2>, TX_32X32, 34, 12, 2), 666 make_tuple( 667 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, 668 &highbd_wrapper<vpx_highbd_idct32x32_1_add_sse2>, TX_32X32, 1, 8, 2), 669 make_tuple( 670 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, 671 &highbd_wrapper<vpx_highbd_idct32x32_1_add_sse2>, TX_32X32, 1, 10, 2), 672 make_tuple( 673 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_1_add_c>, 674 &highbd_wrapper<vpx_highbd_idct32x32_1_add_sse2>, TX_32X32, 1, 12, 2), 675 make_tuple( 676 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 677 &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse2>, TX_16X16, 256, 8, 2), 678 make_tuple( 679 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 680 &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse2>, TX_16X16, 256, 10, 2), 681 make_tuple( 682 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 683 &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse2>, TX_16X16, 256, 12, 2), 684 make_tuple( 685 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, 686 &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse2>, TX_16X16, 38, 8, 2), 687 make_tuple( 688 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, 689 &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse2>, TX_16X16, 38, 10, 2), 690 make_tuple( 691 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, 692 &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse2>, TX_16X16, 38, 12, 2), 693 make_tuple( 694 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, 695 &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse2>, TX_16X16, 10, 8, 2), 696 make_tuple( 697 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, 698 &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse2>, TX_16X16, 10, 10, 2), 699 make_tuple( 700 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, 701 &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse2>, TX_16X16, 10, 12, 2), 702 make_tuple( 703 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, 704 &highbd_wrapper<vpx_highbd_idct16x16_1_add_sse2>, TX_16X16, 1, 8, 2), 705 make_tuple( 706 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, 707 &highbd_wrapper<vpx_highbd_idct16x16_1_add_sse2>, TX_16X16, 1, 10, 2), 708 make_tuple( 709 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_1_add_c>, 710 &highbd_wrapper<vpx_highbd_idct16x16_1_add_sse2>, TX_16X16, 1, 12, 2), 711 make_tuple(&vpx_highbd_fdct8x8_c, 712 &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 713 &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse2>, TX_8X8, 64, 8, 2), 714 make_tuple( 715 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 716 &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse2>, TX_8X8, 64, 10, 2), 717 make_tuple( 718 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 719 &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse2>, TX_8X8, 64, 12, 2), 720 make_tuple(&vpx_highbd_fdct8x8_c, 721 &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, 722 &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse2>, TX_8X8, 12, 8, 2), 723 make_tuple( 724 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, 725 &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse2>, TX_8X8, 12, 10, 2), 726 make_tuple( 727 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, 728 &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse2>, TX_8X8, 12, 12, 2), 729 make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, 730 &highbd_wrapper<vpx_highbd_idct8x8_1_add_sse2>, TX_8X8, 1, 8, 2), 731 make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, 732 &highbd_wrapper<vpx_highbd_idct8x8_1_add_sse2>, TX_8X8, 1, 10, 2), 733 make_tuple(&vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_1_add_c>, 734 &highbd_wrapper<vpx_highbd_idct8x8_1_add_sse2>, TX_8X8, 1, 12, 2), 735 make_tuple(&vpx_highbd_fdct4x4_c, 736 &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 737 &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 8, 2), 738 make_tuple( 739 &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 740 &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 10, 2), 741 make_tuple( 742 &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 743 &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 12, 2), 744 make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, 745 &highbd_wrapper<vpx_highbd_idct4x4_1_add_sse2>, TX_4X4, 1, 8, 2), 746 make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, 747 &highbd_wrapper<vpx_highbd_idct4x4_1_add_sse2>, TX_4X4, 1, 10, 2), 748 make_tuple(&vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_1_add_c>, 749 &highbd_wrapper<vpx_highbd_idct4x4_1_add_sse2>, TX_4X4, 1, 12, 2), 750 #endif // CONFIG_VP9_HIGHBITDEPTH 751 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>, 752 &wrapper<vpx_idct32x32_1024_add_sse2>, TX_32X32, 1024, 8, 1), 753 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_135_add_c>, 754 &wrapper<vpx_idct32x32_135_add_sse2>, TX_32X32, 135, 8, 1), 755 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>, 756 &wrapper<vpx_idct32x32_34_add_sse2>, TX_32X32, 34, 8, 1), 757 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>, 758 &wrapper<vpx_idct32x32_1_add_sse2>, TX_32X32, 1, 8, 1), 759 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>, 760 &wrapper<vpx_idct16x16_256_add_sse2>, TX_16X16, 256, 8, 1), 761 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_38_add_c>, 762 &wrapper<vpx_idct16x16_38_add_sse2>, TX_16X16, 38, 8, 1), 763 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>, 764 &wrapper<vpx_idct16x16_10_add_sse2>, TX_16X16, 10, 8, 1), 765 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>, 766 &wrapper<vpx_idct16x16_1_add_sse2>, TX_16X16, 1, 8, 1), 767 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>, 768 &wrapper<vpx_idct8x8_64_add_sse2>, TX_8X8, 64, 8, 1), 769 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>, 770 &wrapper<vpx_idct8x8_12_add_sse2>, TX_8X8, 12, 8, 1), 771 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>, 772 &wrapper<vpx_idct8x8_1_add_sse2>, TX_8X8, 1, 8, 1), 773 make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>, 774 &wrapper<vpx_idct4x4_16_add_sse2>, TX_4X4, 16, 8, 1), 775 make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>, 776 &wrapper<vpx_idct4x4_1_add_sse2>, TX_4X4, 1, 8, 1) 777 }; 778 779 INSTANTIATE_TEST_CASE_P(SSE2, PartialIDctTest, 780 ::testing::ValuesIn(sse2_partial_idct_tests)); 781 782 #endif // HAVE_SSE2 783 784 #if HAVE_SSSE3 785 const PartialInvTxfmParam ssse3_partial_idct_tests[] = { 786 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_135_add_c>, 787 &wrapper<vpx_idct32x32_135_add_ssse3>, TX_32X32, 135, 8, 1), 788 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>, 789 &wrapper<vpx_idct32x32_34_add_ssse3>, TX_32X32, 34, 8, 1), 790 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>, 791 &wrapper<vpx_idct8x8_12_add_ssse3>, TX_8X8, 12, 8, 1) 792 }; 793 794 INSTANTIATE_TEST_CASE_P(SSSE3, PartialIDctTest, 795 ::testing::ValuesIn(ssse3_partial_idct_tests)); 796 #endif // HAVE_SSSE3 797 798 #if HAVE_SSE4_1 && CONFIG_VP9_HIGHBITDEPTH 799 const PartialInvTxfmParam sse4_1_partial_idct_tests[] = { 800 make_tuple(&vpx_highbd_fdct32x32_c, 801 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 802 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse4_1>, TX_32X32, 803 1024, 8, 2), 804 make_tuple(&vpx_highbd_fdct32x32_c, 805 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 806 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse4_1>, TX_32X32, 807 1024, 10, 2), 808 make_tuple(&vpx_highbd_fdct32x32_c, 809 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_c>, 810 &highbd_wrapper<vpx_highbd_idct32x32_1024_add_sse4_1>, TX_32X32, 811 1024, 12, 2), 812 make_tuple(&vpx_highbd_fdct32x32_c, 813 &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, 814 &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse4_1>, TX_32X32, 815 135, 8, 2), 816 make_tuple(&vpx_highbd_fdct32x32_c, 817 &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, 818 &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse4_1>, TX_32X32, 819 135, 10, 2), 820 make_tuple(&vpx_highbd_fdct32x32_c, 821 &highbd_wrapper<vpx_highbd_idct32x32_135_add_c>, 822 &highbd_wrapper<vpx_highbd_idct32x32_135_add_sse4_1>, TX_32X32, 823 135, 12, 2), 824 make_tuple( 825 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, 826 &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse4_1>, TX_32X32, 34, 8, 2), 827 make_tuple( 828 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, 829 &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse4_1>, TX_32X32, 34, 10, 2), 830 make_tuple( 831 &vpx_highbd_fdct32x32_c, &highbd_wrapper<vpx_highbd_idct32x32_34_add_c>, 832 &highbd_wrapper<vpx_highbd_idct32x32_34_add_sse4_1>, TX_32X32, 34, 12, 2), 833 make_tuple(&vpx_highbd_fdct16x16_c, 834 &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 835 &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse4_1>, TX_16X16, 836 256, 8, 2), 837 make_tuple(&vpx_highbd_fdct16x16_c, 838 &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 839 &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse4_1>, TX_16X16, 840 256, 10, 2), 841 make_tuple(&vpx_highbd_fdct16x16_c, 842 &highbd_wrapper<vpx_highbd_idct16x16_256_add_c>, 843 &highbd_wrapper<vpx_highbd_idct16x16_256_add_sse4_1>, TX_16X16, 844 256, 12, 2), 845 make_tuple( 846 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, 847 &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse4_1>, TX_16X16, 38, 8, 2), 848 make_tuple( 849 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, 850 &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse4_1>, TX_16X16, 38, 10, 2), 851 make_tuple( 852 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_38_add_c>, 853 &highbd_wrapper<vpx_highbd_idct16x16_38_add_sse4_1>, TX_16X16, 38, 12, 2), 854 make_tuple( 855 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, 856 &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse4_1>, TX_16X16, 10, 8, 2), 857 make_tuple( 858 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, 859 &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse4_1>, TX_16X16, 10, 10, 2), 860 make_tuple( 861 &vpx_highbd_fdct16x16_c, &highbd_wrapper<vpx_highbd_idct16x16_10_add_c>, 862 &highbd_wrapper<vpx_highbd_idct16x16_10_add_sse4_1>, TX_16X16, 10, 12, 2), 863 make_tuple( 864 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 865 &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse4_1>, TX_8X8, 64, 8, 2), 866 make_tuple( 867 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 868 &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse4_1>, TX_8X8, 64, 10, 2), 869 make_tuple( 870 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_64_add_c>, 871 &highbd_wrapper<vpx_highbd_idct8x8_64_add_sse4_1>, TX_8X8, 64, 12, 2), 872 make_tuple( 873 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, 874 &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse4_1>, TX_8X8, 12, 8, 2), 875 make_tuple( 876 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, 877 &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse4_1>, TX_8X8, 12, 10, 2), 878 make_tuple( 879 &vpx_highbd_fdct8x8_c, &highbd_wrapper<vpx_highbd_idct8x8_12_add_c>, 880 &highbd_wrapper<vpx_highbd_idct8x8_12_add_sse4_1>, TX_8X8, 12, 12, 2), 881 make_tuple( 882 &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 883 &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse4_1>, TX_4X4, 16, 8, 2), 884 make_tuple( 885 &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 886 &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse4_1>, TX_4X4, 16, 10, 2), 887 make_tuple( 888 &vpx_highbd_fdct4x4_c, &highbd_wrapper<vpx_highbd_idct4x4_16_add_c>, 889 &highbd_wrapper<vpx_highbd_idct4x4_16_add_sse4_1>, TX_4X4, 16, 12, 2) 890 }; 891 892 INSTANTIATE_TEST_CASE_P(SSE4_1, PartialIDctTest, 893 ::testing::ValuesIn(sse4_1_partial_idct_tests)); 894 #endif // HAVE_SSE4_1 && CONFIG_VP9_HIGHBITDEPTH 895 896 #if HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH 897 const PartialInvTxfmParam dspr2_partial_idct_tests[] = { 898 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>, 899 &wrapper<vpx_idct32x32_1024_add_dspr2>, TX_32X32, 1024, 8, 1), 900 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>, 901 &wrapper<vpx_idct32x32_34_add_dspr2>, TX_32X32, 34, 8, 1), 902 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>, 903 &wrapper<vpx_idct32x32_1_add_dspr2>, TX_32X32, 1, 8, 1), 904 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>, 905 &wrapper<vpx_idct16x16_256_add_dspr2>, TX_16X16, 256, 8, 1), 906 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>, 907 &wrapper<vpx_idct16x16_10_add_dspr2>, TX_16X16, 10, 8, 1), 908 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>, 909 &wrapper<vpx_idct16x16_1_add_dspr2>, TX_16X16, 1, 8, 1), 910 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>, 911 &wrapper<vpx_idct8x8_64_add_dspr2>, TX_8X8, 64, 8, 1), 912 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>, 913 &wrapper<vpx_idct8x8_12_add_dspr2>, TX_8X8, 12, 8, 1), 914 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>, 915 &wrapper<vpx_idct8x8_1_add_dspr2>, TX_8X8, 1, 8, 1), 916 make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>, 917 &wrapper<vpx_idct4x4_16_add_dspr2>, TX_4X4, 16, 8, 1), 918 make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>, 919 &wrapper<vpx_idct4x4_1_add_dspr2>, TX_4X4, 1, 8, 1) 920 }; 921 922 INSTANTIATE_TEST_CASE_P(DSPR2, PartialIDctTest, 923 ::testing::ValuesIn(dspr2_partial_idct_tests)); 924 #endif // HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH 925 926 #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH 927 // 32x32_135_ is implemented using the 1024 version. 928 const PartialInvTxfmParam msa_partial_idct_tests[] = { 929 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1024_add_c>, 930 &wrapper<vpx_idct32x32_1024_add_msa>, TX_32X32, 1024, 8, 1), 931 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_34_add_c>, 932 &wrapper<vpx_idct32x32_34_add_msa>, TX_32X32, 34, 8, 1), 933 make_tuple(&vpx_fdct32x32_c, &wrapper<vpx_idct32x32_1_add_c>, 934 &wrapper<vpx_idct32x32_1_add_msa>, TX_32X32, 1, 8, 1), 935 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_256_add_c>, 936 &wrapper<vpx_idct16x16_256_add_msa>, TX_16X16, 256, 8, 1), 937 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_10_add_c>, 938 &wrapper<vpx_idct16x16_10_add_msa>, TX_16X16, 10, 8, 1), 939 make_tuple(&vpx_fdct16x16_c, &wrapper<vpx_idct16x16_1_add_c>, 940 &wrapper<vpx_idct16x16_1_add_msa>, TX_16X16, 1, 8, 1), 941 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_64_add_c>, 942 &wrapper<vpx_idct8x8_64_add_msa>, TX_8X8, 64, 8, 1), 943 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_12_add_c>, 944 &wrapper<vpx_idct8x8_12_add_msa>, TX_8X8, 12, 8, 1), 945 make_tuple(&vpx_fdct8x8_c, &wrapper<vpx_idct8x8_1_add_c>, 946 &wrapper<vpx_idct8x8_1_add_msa>, TX_8X8, 1, 8, 1), 947 make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_16_add_c>, 948 &wrapper<vpx_idct4x4_16_add_msa>, TX_4X4, 16, 8, 1), 949 make_tuple(&vpx_fdct4x4_c, &wrapper<vpx_idct4x4_1_add_c>, 950 &wrapper<vpx_idct4x4_1_add_msa>, TX_4X4, 1, 8, 1) 951 }; 952 953 INSTANTIATE_TEST_CASE_P(MSA, PartialIDctTest, 954 ::testing::ValuesIn(msa_partial_idct_tests)); 955 #endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH 956 957 #endif // !CONFIG_EMULATE_HARDWARE 958 959 } // namespace 960