| 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/register_state_check.h" |
| 13 extern "C" { | 14 extern "C" { |
| 14 #include "vpx_config.h" | 15 #include "vpx_config.h" |
| 15 #include "vp8_rtcd.h" | 16 #include "vp8_rtcd.h" |
| 16 #include "vp8/common/blockd.h" | 17 #include "vp8/common/blockd.h" |
| 17 #include "vp8/encoder/block.h" | 18 #include "vp8/encoder/block.h" |
| 18 #include "vpx_mem/vpx_mem.h" | 19 #include "vpx_mem/vpx_mem.h" |
| 19 } | 20 } |
| 20 | 21 |
| 21 typedef void (*subtract_b_fn_t)(BLOCK *be, BLOCKD *bd, int pitch); | 22 typedef void (*subtract_b_fn_t)(BLOCK *be, BLOCKD *bd, int pitch); |
| 22 | 23 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 71 |
| 71 // set predictor | 72 // set predictor |
| 72 uint8_t *predictor = bd.predictor; | 73 uint8_t *predictor = bd.predictor; |
| 73 for (int r = 0; r < kBlockHeight; ++r) { | 74 for (int r = 0; r < kBlockHeight; ++r) { |
| 74 for (int c = 0; c < kBlockWidth; ++c) { | 75 for (int c = 0; c < kBlockWidth; ++c) { |
| 75 predictor[c] = rnd.Rand8(); | 76 predictor[c] = rnd.Rand8(); |
| 76 } | 77 } |
| 77 predictor += kDiffPredStride; | 78 predictor += kDiffPredStride; |
| 78 } | 79 } |
| 79 | 80 |
| 80 GetParam()(&be, &bd, kDiffPredStride); | 81 REGISTER_STATE_CHECK(GetParam()(&be, &bd, kDiffPredStride)); |
| 81 | 82 |
| 82 base_src = *be.base_src; | 83 base_src = *be.base_src; |
| 83 src_diff = be.src_diff; | 84 src_diff = be.src_diff; |
| 84 predictor = bd.predictor; | 85 predictor = bd.predictor; |
| 85 for (int r = 0; r < kBlockHeight; ++r) { | 86 for (int r = 0; r < kBlockHeight; ++r) { |
| 86 for (int c = 0; c < kBlockWidth; ++c) { | 87 for (int c = 0; c < kBlockWidth; ++c) { |
| 87 EXPECT_EQ(base_src[c], (src_diff[c] + predictor[c])) << "r = " << r | 88 EXPECT_EQ(base_src[c], (src_diff[c] + predictor[c])) << "r = " << r |
| 88 << ", c = " << c; | 89 << ", c = " << c; |
| 89 } | 90 } |
| 90 src_diff += kDiffPredStride; | 91 src_diff += kDiffPredStride; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 104 INSTANTIATE_TEST_CASE_P(MMX, SubtractBlockTest, | 105 INSTANTIATE_TEST_CASE_P(MMX, SubtractBlockTest, |
| 105 ::testing::Values(vp8_subtract_b_mmx)); | 106 ::testing::Values(vp8_subtract_b_mmx)); |
| 106 #endif | 107 #endif |
| 107 | 108 |
| 108 #if HAVE_SSE2 | 109 #if HAVE_SSE2 |
| 109 INSTANTIATE_TEST_CASE_P(SSE2, SubtractBlockTest, | 110 INSTANTIATE_TEST_CASE_P(SSE2, SubtractBlockTest, |
| 110 ::testing::Values(vp8_subtract_b_sse2)); | 111 ::testing::Values(vp8_subtract_b_sse2)); |
| 111 #endif | 112 #endif |
| 112 | 113 |
| 113 } // namespace | 114 } // namespace |
| OLD | NEW |