OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 #include <vector> | 10 #include <vector> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 &capture_output); | 117 &capture_output); |
118 | 118 |
119 EXPECT_EQ(achieved_stream_analog_level_reference, | 119 EXPECT_EQ(achieved_stream_analog_level_reference, |
120 gain_controller.stream_analog_level()); | 120 gain_controller.stream_analog_level()); |
121 | 121 |
122 // Compare the output with the reference. Only the first values of the output | 122 // Compare the output with the reference. Only the first values of the output |
123 // from last frame processed are compared in order not having to specify all | 123 // from last frame processed are compared in order not having to specify all |
124 // preceeding frames as testvectors. As the algorithm being tested has a | 124 // preceeding frames as testvectors. As the algorithm being tested has a |
125 // memory, testing only the last frame implicitly also tests the preceeding | 125 // memory, testing only the last frame implicitly also tests the preceeding |
126 // frames. | 126 // frames. |
127 const float kTolerance = 1.0f / 32768.0f; | 127 const float kElementErrorBound = 1.0f / 32768.0f; |
128 EXPECT_TRUE(test::BitExactFrame( | 128 EXPECT_TRUE(test::VerifyDeinterleavedArray( |
129 capture_config.num_frames(), capture_config.num_channels(), | 129 capture_config.num_frames(), capture_config.num_channels(), |
130 output_reference, capture_output, kTolerance)); | 130 output_reference, capture_output, kElementErrorBound)); |
131 } | 131 } |
132 | 132 |
133 } // namespace | 133 } // namespace |
134 | 134 |
135 TEST(GainControlBitExactnessTest, | 135 TEST(GainControlBitExactnessTest, |
136 Mono8kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { | 136 Mono8kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
137 const int kStreamAnalogLevelReference = 50; | 137 const int kStreamAnalogLevelReference = 50; |
138 const float kOutputReference[] = {-0.006622f, -0.002747f, 0.001587f}; | 138 const float kOutputReference[] = {-0.006622f, -0.002747f, 0.001587f}; |
139 RunBitExactnessTest(8000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, | 139 RunBitExactnessTest(8000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, |
140 true, 0, 100, kStreamAnalogLevelReference, | 140 true, 0, 100, kStreamAnalogLevelReference, |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 const int kStreamAnalogLevelReference = 100; | 311 const int kStreamAnalogLevelReference = 100; |
312 const float kOutputReference[] = {-0.006134f, -0.004303f, -0.002716f}; | 312 const float kOutputReference[] = {-0.006134f, -0.004303f, -0.002716f}; |
313 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 10, 100, | 313 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 10, 100, |
314 30, true, 0, 100, kStreamAnalogLevelReference, | 314 30, true, 0, 100, kStreamAnalogLevelReference, |
315 kOutputReference); | 315 kOutputReference); |
316 } | 316 } |
317 | 317 |
318 } // namespace webrtc | 318 } // namespace webrtc |
319 | 319 |
320 #endif | 320 #endif |
OLD | NEW |