OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 for (size_t i = 1; i < length; i++) { | 196 for (size_t i = 1; i < length; i++) { |
197 max_data = std::max(max_data, AbsValue(frame.data_[i])); | 197 max_data = std::max(max_data, AbsValue(frame.data_[i])); |
198 } | 198 } |
199 | 199 |
200 return max_data; | 200 return max_data; |
201 } | 201 } |
202 | 202 |
203 #if defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE) | 203 #if defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE) |
204 void TestStats(const AudioProcessing::Statistic& test, | 204 void TestStats(const AudioProcessing::Statistic& test, |
205 const audioproc::Test::Statistic& reference) { | 205 const audioproc::Test::Statistic& reference) { |
206 EXPECT_EQ(reference.instant(), test.instant); | 206 EXPECT_NEAR(reference.instant(), test.instant, 1); |
207 EXPECT_EQ(reference.average(), test.average); | 207 EXPECT_EQ(reference.average(), test.average); |
208 EXPECT_EQ(reference.maximum(), test.maximum); | 208 EXPECT_EQ(reference.maximum(), test.maximum); |
209 EXPECT_EQ(reference.minimum(), test.minimum); | 209 EXPECT_NEAR(reference.minimum(), test.minimum, 1); |
210 } | 210 } |
211 | 211 |
212 void WriteStatsMessage(const AudioProcessing::Statistic& output, | 212 void WriteStatsMessage(const AudioProcessing::Statistic& output, |
213 audioproc::Test::Statistic* msg) { | 213 audioproc::Test::Statistic* msg) { |
214 msg->set_instant(output.instant); | 214 msg->set_instant(output.instant); |
215 msg->set_average(output.average); | 215 msg->set_average(output.average); |
216 msg->set_maximum(output.maximum); | 216 msg->set_maximum(output.maximum); |
217 msg->set_minimum(output.minimum); | 217 msg->set_minimum(output.minimum); |
218 } | 218 } |
219 #endif | 219 #endif |
(...skipping 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2763 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), | 2763 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), |
2764 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), | 2764 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), |
2765 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), | 2765 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), |
2766 std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20), | 2766 std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20), |
2767 std::tr1::make_tuple(16000, 16000, 32000, 16000, 40, 20), | 2767 std::tr1::make_tuple(16000, 16000, 32000, 16000, 40, 20), |
2768 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); | 2768 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); |
2769 #endif | 2769 #endif |
2770 | 2770 |
2771 } // namespace | 2771 } // namespace |
2772 } // namespace webrtc | 2772 } // namespace webrtc |
OLD | NEW |