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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 EXPECT_TRUE(bias_acceptable) | 129 EXPECT_TRUE(bias_acceptable) |
130 << "Error: 4x4 FDCT/FHT has a sign bias > 10%" | 130 << "Error: 4x4 FDCT/FHT has a sign bias > 10%" |
131 << " for input range [-15, 15] at index " << j; | 131 << " for input range [-15, 15] at index " << j; |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 TEST_P(FwdTrans4x4Test, RoundTripErrorCheck) { | 135 TEST_P(FwdTrans4x4Test, RoundTripErrorCheck) { |
136 ACMRandom rnd(ACMRandom::DeterministicSeed()); | 136 ACMRandom rnd(ACMRandom::DeterministicSeed()); |
137 | 137 |
138 int max_error = 0; | 138 int max_error = 0; |
139 double total_error = 0; | 139 int total_error = 0; |
140 const int count_test_block = 1000000; | 140 const int count_test_block = 1000000; |
141 for (int i = 0; i < count_test_block; ++i) { | 141 for (int i = 0; i < count_test_block; ++i) { |
142 DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 16); | 142 DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 16); |
143 DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 16); | 143 DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 16); |
144 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 16); | 144 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 16); |
145 DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 16); | 145 DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 16); |
146 | 146 |
147 for (int j = 0; j < 16; ++j) { | 147 for (int j = 0; j < 16; ++j) { |
148 src[j] = rnd.Rand8(); | 148 src[j] = rnd.Rand8(); |
149 dst[j] = rnd.Rand8(); | 149 dst[j] = rnd.Rand8(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 EXPECT_GE(1, max_error) | 181 EXPECT_GE(1, max_error) |
182 << "Error: FDCT/IDCT or FHT/IHT has an individual roundtrip error > 1"; | 182 << "Error: FDCT/IDCT or FHT/IHT has an individual roundtrip error > 1"; |
183 | 183 |
184 EXPECT_GE(count_test_block, total_error) | 184 EXPECT_GE(count_test_block, total_error) |
185 << "Error: FDCT/IDCT or FHT/IHT has average " | 185 << "Error: FDCT/IDCT or FHT/IHT has average " |
186 << "roundtrip error > 1 per block"; | 186 << "roundtrip error > 1 per block"; |
187 } | 187 } |
188 | 188 |
189 INSTANTIATE_TEST_CASE_P(VP9, FwdTrans4x4Test, ::testing::Range(0, 4)); | 189 INSTANTIATE_TEST_CASE_P(VP9, FwdTrans4x4Test, ::testing::Range(0, 4)); |
190 } // namespace | 190 } // namespace |
OLD | NEW |