| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
| 11 #include <math.h> | 11 #include <math.h> |
| 12 #include <stdlib.h> | 12 #include <stdlib.h> |
| 13 #include <string.h> | 13 #include <string.h> |
| 14 | 14 |
| 15 #include "third_party/googletest/src/include/gtest/gtest.h" | 15 #include "third_party/googletest/src/include/gtest/gtest.h" |
| 16 #include "test/acm_random.h" | 16 #include "test/acm_random.h" |
| 17 #include "test/clear_system_state.h" | 17 #include "test/clear_system_state.h" |
| 18 #include "test/register_state_check.h" | 18 #include "test/register_state_check.h" |
| 19 #include "test/util.h" | 19 #include "test/util.h" |
| 20 | 20 |
| 21 #include "./vp9_rtcd.h" | 21 #include "./vp9_rtcd.h" |
| 22 #include "vp9/common/vp9_blockd.h" | 22 #include "vp9/common/vp9_blockd.h" |
| 23 #include "vp9/common/vp9_scan.h" | 23 #include "vp9/common/vp9_scan.h" |
| 24 #include "vpx/vpx_integer.h" | 24 #include "vpx/vpx_integer.h" |
| 25 | 25 |
| 26 using libvpx_test::ACMRandom; | 26 using libvpx_test::ACMRandom; |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 typedef void (*fwd_txfm_t)(const int16_t *in, int16_t *out, int stride); | 29 typedef void (*FwdTxfmFunc)(const int16_t *in, int16_t *out, int stride); |
| 30 typedef void (*inv_txfm_t)(const int16_t *in, uint8_t *out, int stride); | 30 typedef void (*InvTxfmFunc)(const int16_t *in, uint8_t *out, int stride); |
| 31 typedef std::tr1::tuple<fwd_txfm_t, | 31 typedef std::tr1::tuple<FwdTxfmFunc, |
| 32 inv_txfm_t, | 32 InvTxfmFunc, |
| 33 inv_txfm_t, | 33 InvTxfmFunc, |
| 34 TX_SIZE, int> partial_itxfm_param_t; | 34 TX_SIZE, int> PartialInvTxfmParam; |
| 35 const int kMaxNumCoeffs = 1024; | 35 const int kMaxNumCoeffs = 1024; |
| 36 class PartialIDctTest : public ::testing::TestWithParam<partial_itxfm_param_t> { | 36 class PartialIDctTest : public ::testing::TestWithParam<PartialInvTxfmParam> { |
| 37 public: | 37 public: |
| 38 virtual ~PartialIDctTest() {} | 38 virtual ~PartialIDctTest() {} |
| 39 virtual void SetUp() { | 39 virtual void SetUp() { |
| 40 ftxfm_ = GET_PARAM(0); | 40 ftxfm_ = GET_PARAM(0); |
| 41 full_itxfm_ = GET_PARAM(1); | 41 full_itxfm_ = GET_PARAM(1); |
| 42 partial_itxfm_ = GET_PARAM(2); | 42 partial_itxfm_ = GET_PARAM(2); |
| 43 tx_size_ = GET_PARAM(3); | 43 tx_size_ = GET_PARAM(3); |
| 44 last_nonzero_ = GET_PARAM(4); | 44 last_nonzero_ = GET_PARAM(4); |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual void TearDown() { libvpx_test::ClearSystemState(); } | 47 virtual void TearDown() { libvpx_test::ClearSystemState(); } |
| 48 | 48 |
| 49 protected: | 49 protected: |
| 50 int last_nonzero_; | 50 int last_nonzero_; |
| 51 TX_SIZE tx_size_; | 51 TX_SIZE tx_size_; |
| 52 fwd_txfm_t ftxfm_; | 52 FwdTxfmFunc ftxfm_; |
| 53 inv_txfm_t full_itxfm_; | 53 InvTxfmFunc full_itxfm_; |
| 54 inv_txfm_t partial_itxfm_; | 54 InvTxfmFunc partial_itxfm_; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 TEST_P(PartialIDctTest, RunQuantCheck) { | 57 TEST_P(PartialIDctTest, RunQuantCheck) { |
| 58 ACMRandom rnd(ACMRandom::DeterministicSeed()); | 58 ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 59 int size; | 59 int size; |
| 60 switch (tx_size_) { | 60 switch (tx_size_) { |
| 61 case TX_4X4: | 61 case TX_4X4: |
| 62 size = 4; | 62 size = 4; |
| 63 break; | 63 break; |
| 64 case TX_8X8: | 64 case TX_8X8: |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 #if HAVE_SSSE3 | 306 #if HAVE_SSSE3 |
| 307 INSTANTIATE_TEST_CASE_P( | 307 INSTANTIATE_TEST_CASE_P( |
| 308 SSSE3, PartialIDctTest, | 308 SSSE3, PartialIDctTest, |
| 309 ::testing::Values( | 309 ::testing::Values( |
| 310 make_tuple(&vp9_fdct16x16_c, | 310 make_tuple(&vp9_fdct16x16_c, |
| 311 &vp9_idct16x16_256_add_c, | 311 &vp9_idct16x16_256_add_c, |
| 312 &vp9_idct16x16_10_add_ssse3, | 312 &vp9_idct16x16_10_add_ssse3, |
| 313 TX_16X16, 10))); | 313 TX_16X16, 10))); |
| 314 #endif | 314 #endif |
| 315 } // namespace | 315 } // namespace |
| OLD | NEW |