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 23 matching lines...) Expand all Loading... |
34 }; | 34 }; |
35 | 35 |
36 using libvpx_test::ACMRandom; | 36 using libvpx_test::ACMRandom; |
37 | 37 |
38 TEST_P(VP9SubtractBlockTest, SimpleSubtract) { | 38 TEST_P(VP9SubtractBlockTest, SimpleSubtract) { |
39 ACMRandom rnd(ACMRandom::DeterministicSeed()); | 39 ACMRandom rnd(ACMRandom::DeterministicSeed()); |
40 | 40 |
41 // FIXME(rbultje) split in its own file | 41 // FIXME(rbultje) split in its own file |
42 for (BLOCK_SIZE bsize = BLOCK_4X4; bsize < BLOCK_SIZES; | 42 for (BLOCK_SIZE bsize = BLOCK_4X4; bsize < BLOCK_SIZES; |
43 bsize = static_cast<BLOCK_SIZE>(static_cast<int>(bsize) + 1)) { | 43 bsize = static_cast<BLOCK_SIZE>(static_cast<int>(bsize) + 1)) { |
44 const int block_width = 4 << b_width_log2(bsize); | 44 const int block_width = 4 * num_4x4_blocks_wide_lookup[bsize]; |
45 const int block_height = 4 << b_height_log2(bsize); | 45 const int block_height = 4 * num_4x4_blocks_high_lookup[bsize]; |
46 int16_t *diff = reinterpret_cast<int16_t *>( | 46 int16_t *diff = reinterpret_cast<int16_t *>( |
47 vpx_memalign(16, sizeof(*diff) * block_width * block_height * 2)); | 47 vpx_memalign(16, sizeof(*diff) * block_width * block_height * 2)); |
48 uint8_t *pred = reinterpret_cast<uint8_t *>( | 48 uint8_t *pred = reinterpret_cast<uint8_t *>( |
49 vpx_memalign(16, block_width * block_height * 2)); | 49 vpx_memalign(16, block_width * block_height * 2)); |
50 uint8_t *src = reinterpret_cast<uint8_t *>( | 50 uint8_t *src = reinterpret_cast<uint8_t *>( |
51 vpx_memalign(16, block_width * block_height * 2)); | 51 vpx_memalign(16, block_width * block_height * 2)); |
52 | 52 |
53 for (int n = 0; n < 100; n++) { | 53 for (int n = 0; n < 100; n++) { |
54 for (int r = 0; r < block_height; ++r) { | 54 for (int r = 0; r < block_height; ++r) { |
55 for (int c = 0; c < block_width * 2; ++c) { | 55 for (int c = 0; c < block_width * 2; ++c) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 INSTANTIATE_TEST_CASE_P(C, VP9SubtractBlockTest, | 93 INSTANTIATE_TEST_CASE_P(C, VP9SubtractBlockTest, |
94 ::testing::Values(vp9_subtract_block_c)); | 94 ::testing::Values(vp9_subtract_block_c)); |
95 | 95 |
96 #if HAVE_SSE2 && CONFIG_USE_X86INC | 96 #if HAVE_SSE2 && CONFIG_USE_X86INC |
97 INSTANTIATE_TEST_CASE_P(SSE2, VP9SubtractBlockTest, | 97 INSTANTIATE_TEST_CASE_P(SSE2, VP9SubtractBlockTest, |
98 ::testing::Values(vp9_subtract_block_sse2)); | 98 ::testing::Values(vp9_subtract_block_sse2)); |
99 #endif | 99 #endif |
100 } // namespace vp9 | 100 } // namespace vp9 |
OLD | NEW |