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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Extract and verify the test results. | 100 // Extract and verify the test results. |
101 std::vector<float> capture_output; | 101 std::vector<float> capture_output; |
102 test::ExtractVectorFromAudioBuffer(capture_config, &capture_buffer, | 102 test::ExtractVectorFromAudioBuffer(capture_config, &capture_buffer, |
103 &capture_output); | 103 &capture_output); |
104 | 104 |
105 // Compare the output with the reference. Only the first values of the output | 105 // Compare the output with the reference. Only the first values of the output |
106 // from last frame processed are compared in order not having to specify all | 106 // from last frame processed are compared in order not having to specify all |
107 // preceeding frames as testvectors. As the algorithm being tested has a | 107 // preceeding frames as testvectors. As the algorithm being tested has a |
108 // memory, testing only the last frame implicitly also tests the preceeding | 108 // memory, testing only the last frame implicitly also tests the preceeding |
109 // frames. | 109 // frames. |
110 const float kTolerance = 1.0f / 32768.0f; | 110 const float kElementErrorBound = 1.0f / 32768.0f; |
111 EXPECT_TRUE(test::BitExactFrame( | 111 EXPECT_TRUE(test::VerifyDeinterleavedArray( |
112 capture_config.num_frames(), capture_config.num_channels(), | 112 capture_config.num_frames(), capture_config.num_channels(), |
113 output_reference, capture_output, kTolerance)); | 113 output_reference, capture_output, kElementErrorBound)); |
114 } | 114 } |
115 | 115 |
116 } // namespace | 116 } // namespace |
117 | 117 |
118 // TODO(peah): Renable once the integer overflow issue in aecm_core.c:932:69 | 118 // TODO(peah): Renable once the integer overflow issue in aecm_core.c:932:69 |
119 // has been solved. | 119 // has been solved. |
120 TEST(EchoControlMobileBitExactnessTest, | 120 TEST(EchoControlMobileBitExactnessTest, |
121 DISABLED_Mono8kHz_LoudSpeakerPhone_CngOn_StreamDelay0) { | 121 DISABLED_Mono8kHz_LoudSpeakerPhone_CngOn_StreamDelay0) { |
122 const float kOutputReference[] = {0.005280f, 0.002380f, -0.000427f}; | 122 const float kOutputReference[] = {0.005280f, 0.002380f, -0.000427f}; |
123 | 123 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 TEST(EchoControlMobileBitExactnessTest, | 210 TEST(EchoControlMobileBitExactnessTest, |
211 DISABLED_Mono16kHz_SpeakerPhone_CngOn_StreamDelay0) { | 211 DISABLED_Mono16kHz_SpeakerPhone_CngOn_StreamDelay0) { |
212 const float kOutputReference[] = {0.003632f, 0.003052f, 0.001984f}; | 212 const float kOutputReference[] = {0.003632f, 0.003052f, 0.001984f}; |
213 | 213 |
214 RunBitexactnessTest(16000, 1, 0, | 214 RunBitexactnessTest(16000, 1, 0, |
215 EchoControlMobile::RoutingMode::kSpeakerphone, true, | 215 EchoControlMobile::RoutingMode::kSpeakerphone, true, |
216 kOutputReference); | 216 kOutputReference); |
217 } | 217 } |
218 | 218 |
219 } // namespace webrtc | 219 } // namespace webrtc |
OLD | NEW |