OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 macroblockd_dst_ = NULL; | 49 macroblockd_dst_ = NULL; |
50 libvpx_test::ClearSystemState(); | 50 libvpx_test::ClearSystemState(); |
51 } | 51 } |
52 | 52 |
53 protected: | 53 protected: |
54 void SetupCompressor() { | 54 void SetupCompressor() { |
55 rnd_.Reset(ACMRandom::DeterministicSeed()); | 55 rnd_.Reset(ACMRandom::DeterministicSeed()); |
56 | 56 |
57 // The full configuration is necessary to generate the quantization tables. | 57 // The full configuration is necessary to generate the quantization tables. |
58 VP8_CONFIG vp8_config; | 58 VP8_CONFIG vp8_config; |
59 vpx_memset(&vp8_config, 0, sizeof(vp8_config)); | 59 memset(&vp8_config, 0, sizeof(vp8_config)); |
60 | 60 |
61 vp8_comp_ = vp8_create_compressor(&vp8_config); | 61 vp8_comp_ = vp8_create_compressor(&vp8_config); |
62 | 62 |
63 // Set the tables based on a quantizer of 0. | 63 // Set the tables based on a quantizer of 0. |
64 vp8_set_quantizer(vp8_comp_, 0); | 64 vp8_set_quantizer(vp8_comp_, 0); |
65 | 65 |
66 // Set up all the block/blockd pointers for the mb in vp8_comp_. | 66 // Set up all the block/blockd pointers for the mb in vp8_comp_. |
67 vp8cx_frame_init_quantizer(vp8_comp_); | 67 vp8cx_frame_init_quantizer(vp8_comp_); |
68 | 68 |
69 // Copy macroblockd from the reference to get pre-set-up dequant values. | 69 // Copy macroblockd from the reference to get pre-set-up dequant values. |
70 macroblockd_dst_ = reinterpret_cast<MACROBLOCKD *>( | 70 macroblockd_dst_ = reinterpret_cast<MACROBLOCKD *>( |
71 vpx_memalign(32, sizeof(*macroblockd_dst_))); | 71 vpx_memalign(32, sizeof(*macroblockd_dst_))); |
72 vpx_memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd, | 72 memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd, sizeof(*macroblockd_dst_)); |
73 sizeof(*macroblockd_dst_)); | |
74 // Fix block pointers - currently they point to the blocks in the reference | 73 // Fix block pointers - currently they point to the blocks in the reference |
75 // structure. | 74 // structure. |
76 vp8_setup_block_dptrs(macroblockd_dst_); | 75 vp8_setup_block_dptrs(macroblockd_dst_); |
77 } | 76 } |
78 | 77 |
79 void UpdateQuantizer(int q) { | 78 void UpdateQuantizer(int q) { |
80 vp8_set_quantizer(vp8_comp_, q); | 79 vp8_set_quantizer(vp8_comp_, q); |
81 | 80 |
82 vpx_memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd, | 81 memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd, sizeof(*macroblockd_dst_)); |
83 sizeof(*macroblockd_dst_)); | |
84 vp8_setup_block_dptrs(macroblockd_dst_); | 82 vp8_setup_block_dptrs(macroblockd_dst_); |
85 } | 83 } |
86 | 84 |
87 void FillCoeffConstant(int16_t c) { | 85 void FillCoeffConstant(int16_t c) { |
88 for (int i = 0; i < kNumBlocks * kNumBlockEntries; ++i) { | 86 for (int i = 0; i < kNumBlocks * kNumBlockEntries; ++i) { |
89 vp8_comp_->mb.coeff[i] = c; | 87 vp8_comp_->mb.coeff[i] = c; |
90 } | 88 } |
91 } | 89 } |
92 | 90 |
93 void FillCoeffRandom() { | 91 void FillCoeffRandom() { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 ::testing::Values(make_tuple(&vp8_regular_quantize_b_sse4_1, | 186 ::testing::Values(make_tuple(&vp8_regular_quantize_b_sse4_1, |
189 &vp8_regular_quantize_b_c))); | 187 &vp8_regular_quantize_b_c))); |
190 #endif // HAVE_SSE4_1 | 188 #endif // HAVE_SSE4_1 |
191 | 189 |
192 #if HAVE_NEON | 190 #if HAVE_NEON |
193 INSTANTIATE_TEST_CASE_P(NEON, QuantizeTest, | 191 INSTANTIATE_TEST_CASE_P(NEON, QuantizeTest, |
194 ::testing::Values(make_tuple(&vp8_fast_quantize_b_neon, | 192 ::testing::Values(make_tuple(&vp8_fast_quantize_b_neon, |
195 &vp8_fast_quantize_b_c))); | 193 &vp8_fast_quantize_b_c))); |
196 #endif // HAVE_NEON | 194 #endif // HAVE_NEON |
197 } // namespace | 195 } // namespace |
OLD | NEW |