| 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 |
| 11 #include "third_party/googletest/src/include/gtest/gtest.h" | 11 #include "third_party/googletest/src/include/gtest/gtest.h" |
| 12 #include "test/acm_random.h" | 12 #include "test/acm_random.h" |
| 13 #include "test/clear_system_state.h" |
| 13 #include "test/register_state_check.h" | 14 #include "test/register_state_check.h" |
| 14 extern "C" { | 15 extern "C" { |
| 15 #include "vpx_config.h" | 16 #include "vpx_config.h" |
| 16 #include "vp8_rtcd.h" | 17 #include "vp8_rtcd.h" |
| 17 #include "vp8/common/blockd.h" | 18 #include "vp8/common/blockd.h" |
| 18 #include "vp8/encoder/block.h" | 19 #include "vp8/encoder/block.h" |
| 19 #include "vpx_mem/vpx_mem.h" | 20 #include "vpx_mem/vpx_mem.h" |
| 20 } | 21 } |
| 21 | 22 |
| 22 typedef void (*subtract_b_fn_t)(BLOCK *be, BLOCKD *bd, int pitch); | 23 typedef void (*subtract_b_fn_t)(BLOCK *be, BLOCKD *bd, int pitch); |
| 23 | 24 |
| 24 namespace { | 25 namespace { |
| 25 | 26 |
| 26 class SubtractBlockTest : public ::testing::TestWithParam<subtract_b_fn_t> {}; | 27 class SubtractBlockTest : public ::testing::TestWithParam<subtract_b_fn_t> { |
| 28 public: |
| 29 virtual void TearDown() { |
| 30 libvpx_test::ClearSystemState(); |
| 31 } |
| 32 }; |
| 27 | 33 |
| 28 using libvpx_test::ACMRandom; | 34 using libvpx_test::ACMRandom; |
| 29 | 35 |
| 30 TEST_P(SubtractBlockTest, SimpleSubtract) { | 36 TEST_P(SubtractBlockTest, SimpleSubtract) { |
| 31 ACMRandom rnd(ACMRandom::DeterministicSeed()); | 37 ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 32 BLOCK be; | 38 BLOCK be; |
| 33 BLOCKD bd; | 39 BLOCKD bd; |
| 34 // in libvpx, this stride is always 16 | 40 // in libvpx, this stride is always 16 |
| 35 const int kDiffPredStride = 16; | 41 const int kDiffPredStride = 16; |
| 36 const int kSrcStride[] = {32, 16, 8, 4, 0}; | 42 const int kSrcStride[] = {32, 16, 8, 4, 0}; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 INSTANTIATE_TEST_CASE_P(MMX, SubtractBlockTest, | 111 INSTANTIATE_TEST_CASE_P(MMX, SubtractBlockTest, |
| 106 ::testing::Values(vp8_subtract_b_mmx)); | 112 ::testing::Values(vp8_subtract_b_mmx)); |
| 107 #endif | 113 #endif |
| 108 | 114 |
| 109 #if HAVE_SSE2 | 115 #if HAVE_SSE2 |
| 110 INSTANTIATE_TEST_CASE_P(SSE2, SubtractBlockTest, | 116 INSTANTIATE_TEST_CASE_P(SSE2, SubtractBlockTest, |
| 111 ::testing::Values(vp8_subtract_b_sse2)); | 117 ::testing::Values(vp8_subtract_b_sse2)); |
| 112 #endif | 118 #endif |
| 113 | 119 |
| 114 } // namespace | 120 } // namespace |
| OLD | NEW |