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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 << " for input range [-15, 15] at index " << j | 141 << " for input range [-15, 15] at index " << j |
142 << " count0: " << count_sign_block[j][0] | 142 << " count0: " << count_sign_block[j][0] |
143 << " count1: " << count_sign_block[j][1] | 143 << " count1: " << count_sign_block[j][1] |
144 << " diff: " << diff; | 144 << " diff: " << diff; |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 TEST_P(FwdTrans8x8Test, RoundTripErrorCheck) { | 148 TEST_P(FwdTrans8x8Test, RoundTripErrorCheck) { |
149 ACMRandom rnd(ACMRandom::DeterministicSeed()); | 149 ACMRandom rnd(ACMRandom::DeterministicSeed()); |
150 int max_error = 0; | 150 int max_error = 0; |
151 double total_error = 0; | 151 int total_error = 0; |
152 const int count_test_block = 100000; | 152 const int count_test_block = 100000; |
153 for (int i = 0; i < count_test_block; ++i) { | 153 for (int i = 0; i < count_test_block; ++i) { |
154 DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); | 154 DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); |
155 DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 64); | 155 DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 64); |
156 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64); | 156 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64); |
157 DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64); | 157 DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64); |
158 | 158 |
159 for (int j = 0; j < 64; ++j) { | 159 for (int j = 0; j < 64; ++j) { |
160 src[j] = rnd.Rand8(); | 160 src[j] = rnd.Rand8(); |
161 dst[j] = rnd.Rand8(); | 161 dst[j] = rnd.Rand8(); |
(...skipping 30 matching lines...) Expand all Loading... |
192 << "Error: 8x8 FDCT/IDCT or FHT/IHT has an individual roundtrip error > 1"; | 192 << "Error: 8x8 FDCT/IDCT or FHT/IHT has an individual roundtrip error > 1"; |
193 | 193 |
194 EXPECT_GE(count_test_block/5, total_error) | 194 EXPECT_GE(count_test_block/5, total_error) |
195 << "Error: 8x8 FDCT/IDCT or FHT/IHT has average roundtrip " | 195 << "Error: 8x8 FDCT/IDCT or FHT/IHT has average roundtrip " |
196 "error > 1/5 per block"; | 196 "error > 1/5 per block"; |
197 } | 197 } |
198 | 198 |
199 TEST_P(FwdTrans8x8Test, ExtremalCheck) { | 199 TEST_P(FwdTrans8x8Test, ExtremalCheck) { |
200 ACMRandom rnd(ACMRandom::DeterministicSeed()); | 200 ACMRandom rnd(ACMRandom::DeterministicSeed()); |
201 int max_error = 0; | 201 int max_error = 0; |
202 double total_error = 0; | 202 int total_error = 0; |
203 const int count_test_block = 100000; | 203 const int count_test_block = 100000; |
204 for (int i = 0; i < count_test_block; ++i) { | 204 for (int i = 0; i < count_test_block; ++i) { |
205 DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); | 205 DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); |
206 DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 64); | 206 DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 64); |
207 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64); | 207 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64); |
208 DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64); | 208 DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64); |
209 | 209 |
210 for (int j = 0; j < 64; ++j) { | 210 for (int j = 0; j < 64; ++j) { |
211 src[j] = rnd.Rand8() % 2 ? 255 : 0; | 211 src[j] = rnd.Rand8() % 2 ? 255 : 0; |
212 dst[j] = src[j] > 0 ? 0 : 255; | 212 dst[j] = src[j] > 0 ? 0 : 255; |
(...skipping 19 matching lines...) Expand all Loading... |
232 << " individual roundtrip error > 1"; | 232 << " individual roundtrip error > 1"; |
233 | 233 |
234 EXPECT_GE(count_test_block/5, total_error) | 234 EXPECT_GE(count_test_block/5, total_error) |
235 << "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has average" | 235 << "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has average" |
236 << " roundtrip error > 1/5 per block"; | 236 << " roundtrip error > 1/5 per block"; |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 INSTANTIATE_TEST_CASE_P(VP9, FwdTrans8x8Test, ::testing::Range(0, 4)); | 240 INSTANTIATE_TEST_CASE_P(VP9, FwdTrans8x8Test, ::testing::Range(0, 4)); |
241 } // namespace | 241 } // namespace |
OLD | NEW |