OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 } | 257 } |
258 } | 258 } |
259 | 259 |
260 typedef void (*fdct_t)(const int16_t *in, int16_t *out, int stride); | 260 typedef void (*fdct_t)(const int16_t *in, int16_t *out, int stride); |
261 typedef void (*idct_t)(const int16_t *in, uint8_t *out, int stride); | 261 typedef void (*idct_t)(const int16_t *in, uint8_t *out, int stride); |
262 typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride, | 262 typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride, |
263 int tx_type); | 263 int tx_type); |
264 typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride, | 264 typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride, |
265 int tx_type); | 265 int tx_type); |
266 | 266 |
| 267 typedef std::tr1::tuple<fdct_t, idct_t, int> dct_16x16_param_t; |
| 268 typedef std::tr1::tuple<fht_t, iht_t, int> ht_16x16_param_t; |
| 269 |
267 void fdct16x16_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { | 270 void fdct16x16_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { |
268 vp9_fdct16x16_c(in, out, stride); | 271 vp9_fdct16x16_c(in, out, stride); |
269 } | 272 } |
270 | 273 |
271 void fht16x16_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { | 274 void fht16x16_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { |
272 vp9_short_fht16x16_c(in, out, stride, tx_type); | 275 vp9_short_fht16x16_c(in, out, stride, tx_type); |
273 } | 276 } |
274 | 277 |
275 class Trans16x16TestBase { | 278 class Trans16x16TestBase { |
276 public: | 279 public: |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 << "Error: 16x16 IDCT has error " << error | 408 << "Error: 16x16 IDCT has error " << error |
406 << " at index " << j; | 409 << " at index " << j; |
407 } | 410 } |
408 } | 411 } |
409 } | 412 } |
410 int pitch_; | 413 int pitch_; |
411 int tx_type_; | 414 int tx_type_; |
412 fht_t fwd_txfm_ref; | 415 fht_t fwd_txfm_ref; |
413 }; | 416 }; |
414 | 417 |
415 class Trans16x16DCT : public Trans16x16TestBase, | 418 class Trans16x16DCT |
416 public PARAMS(fdct_t, idct_t, int) { | 419 : public Trans16x16TestBase, |
| 420 public ::testing::TestWithParam<dct_16x16_param_t> { |
417 public: | 421 public: |
418 virtual ~Trans16x16DCT() {} | 422 virtual ~Trans16x16DCT() {} |
419 | 423 |
420 virtual void SetUp() { | 424 virtual void SetUp() { |
421 fwd_txfm_ = GET_PARAM(0); | 425 fwd_txfm_ = GET_PARAM(0); |
422 inv_txfm_ = GET_PARAM(1); | 426 inv_txfm_ = GET_PARAM(1); |
423 tx_type_ = GET_PARAM(2); | 427 tx_type_ = GET_PARAM(2); |
424 pitch_ = 16; | 428 pitch_ = 16; |
425 fwd_txfm_ref = fdct16x16_ref; | 429 fwd_txfm_ref = fdct16x16_ref; |
426 } | 430 } |
(...skipping 20 matching lines...) Expand all Loading... |
447 } | 451 } |
448 | 452 |
449 TEST_P(Trans16x16DCT, MemCheck) { | 453 TEST_P(Trans16x16DCT, MemCheck) { |
450 RunMemCheck(); | 454 RunMemCheck(); |
451 } | 455 } |
452 | 456 |
453 TEST_P(Trans16x16DCT, InvAccuracyCheck) { | 457 TEST_P(Trans16x16DCT, InvAccuracyCheck) { |
454 RunInvAccuracyCheck(); | 458 RunInvAccuracyCheck(); |
455 } | 459 } |
456 | 460 |
457 class Trans16x16HT : public Trans16x16TestBase, | 461 class Trans16x16HT |
458 public PARAMS(fht_t, iht_t, int) { | 462 : public Trans16x16TestBase, |
| 463 public ::testing::TestWithParam<ht_16x16_param_t> { |
459 public: | 464 public: |
460 virtual ~Trans16x16HT() {} | 465 virtual ~Trans16x16HT() {} |
461 | 466 |
462 virtual void SetUp() { | 467 virtual void SetUp() { |
463 fwd_txfm_ = GET_PARAM(0); | 468 fwd_txfm_ = GET_PARAM(0); |
464 inv_txfm_ = GET_PARAM(1); | 469 inv_txfm_ = GET_PARAM(1); |
465 tx_type_ = GET_PARAM(2); | 470 tx_type_ = GET_PARAM(2); |
466 pitch_ = 16; | 471 pitch_ = 16; |
467 fwd_txfm_ref = fht16x16_ref; | 472 fwd_txfm_ref = fht16x16_ref; |
468 } | 473 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 &vp9_idct16x16_256_add_sse2, 0))); | 519 &vp9_idct16x16_256_add_sse2, 0))); |
515 INSTANTIATE_TEST_CASE_P( | 520 INSTANTIATE_TEST_CASE_P( |
516 SSE2, Trans16x16HT, | 521 SSE2, Trans16x16HT, |
517 ::testing::Values( | 522 ::testing::Values( |
518 make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0), | 523 make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0), |
519 make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1), | 524 make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1), |
520 make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2), | 525 make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2), |
521 make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3))); | 526 make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3))); |
522 #endif | 527 #endif |
523 } // namespace | 528 } // namespace |
OLD | NEW |