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> |
11 | 11 |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "webrtc/base/array_view.h" | 13 #include "webrtc/base/array_view.h" |
14 #include "webrtc/modules/audio_processing/audio_buffer.h" | 14 #include "webrtc/modules/audio_processing/audio_buffer.h" |
15 #include "webrtc/modules/audio_processing/gain_control_impl.h" | 15 #include "webrtc/modules/audio_processing/gain_control_impl.h" |
16 #include "webrtc/modules/audio_processing/test/audio_buffer_tools.h" | 16 #include "webrtc/modules/audio_processing/test/audio_buffer_tools.h" |
17 #include "webrtc/modules/audio_processing/test/bitexactness_tools.h" | 17 #include "webrtc/modules/audio_processing/test/bitexactness_tools.h" |
18 | 18 |
19 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ | |
20 defined(WEBRTC_ANDROID)) | |
21 | |
22 namespace webrtc { | 19 namespace webrtc { |
23 namespace { | 20 namespace { |
24 | 21 |
25 const int kNumFramesToProcess = 100; | 22 const int kNumFramesToProcess = 100; |
26 | 23 |
27 void ProcessOneFrame(int sample_rate_hz, | 24 void ProcessOneFrame(int sample_rate_hz, |
28 AudioBuffer* render_audio_buffer, | 25 AudioBuffer* render_audio_buffer, |
29 AudioBuffer* capture_audio_buffer, | 26 AudioBuffer* capture_audio_buffer, |
30 GainControlImpl* gain_controller) { | 27 GainControlImpl* gain_controller) { |
31 if (sample_rate_hz > AudioProcessing::kSampleRate16kHz) { | 28 if (sample_rate_hz > AudioProcessing::kSampleRate16kHz) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // memory, testing only the last frame implicitly also tests the preceeding | 122 // memory, testing only the last frame implicitly also tests the preceeding |
126 // frames. | 123 // frames. |
127 const float kTolerance = 1.0f / 32768.0f; | 124 const float kTolerance = 1.0f / 32768.0f; |
128 EXPECT_TRUE(test::BitExactFrame( | 125 EXPECT_TRUE(test::BitExactFrame( |
129 capture_config.num_frames(), capture_config.num_channels(), | 126 capture_config.num_frames(), capture_config.num_channels(), |
130 output_reference, capture_output, kTolerance)); | 127 output_reference, capture_output, kTolerance)); |
131 } | 128 } |
132 | 129 |
133 } // namespace | 130 } // namespace |
134 | 131 |
| 132 // TODO(peah): Activate all these tests for ARM and ARM64 once the issue on the |
| 133 // Chromium ARM and ARM64 boths have been identified. This is tracked in the |
| 134 // issue https://bugs.chromium.org/p/webrtc/issues/detail?id=5711. |
| 135 |
| 136 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 137 defined(WEBRTC_ANDROID)) |
135 TEST(GainControlBitExactnessTest, | 138 TEST(GainControlBitExactnessTest, |
136 Mono8kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { | 139 Mono8kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
| 140 #else |
| 141 TEST(GainControlBitExactnessTest, |
| 142 DISABLED_Mono8kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
| 143 #endif |
137 const int kStreamAnalogLevelReference = 50; | 144 const int kStreamAnalogLevelReference = 50; |
138 const float kOutputReference[] = {-0.006622f, -0.002747f, 0.001587f}; | 145 const float kOutputReference[] = {-0.006622f, -0.002747f, 0.001587f}; |
139 RunBitExactnessTest(8000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, | 146 RunBitExactnessTest(8000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, |
140 true, 0, 100, kStreamAnalogLevelReference, | 147 true, 0, 100, kStreamAnalogLevelReference, |
141 kOutputReference); | 148 kOutputReference); |
142 } | 149 } |
143 | 150 |
| 151 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 152 defined(WEBRTC_ANDROID)) |
144 TEST(GainControlBitExactnessTest, | 153 TEST(GainControlBitExactnessTest, |
145 Mono16kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { | 154 Mono16kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
| 155 #else |
| 156 TEST(GainControlBitExactnessTest, |
| 157 DISABLED_Mono16kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
| 158 #endif |
146 const int kStreamAnalogLevelReference = 50; | 159 const int kStreamAnalogLevelReference = 50; |
147 const float kOutputReference[] = {-0.006561f, -0.004608f, -0.002899f}; | 160 const float kOutputReference[] = {-0.006561f, -0.004608f, -0.002899f}; |
148 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, | 161 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, |
149 true, 0, 100, kStreamAnalogLevelReference, | 162 true, 0, 100, kStreamAnalogLevelReference, |
150 kOutputReference); | 163 kOutputReference); |
151 } | 164 } |
152 | 165 |
| 166 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 167 defined(WEBRTC_ANDROID)) |
153 TEST(GainControlBitExactnessTest, | 168 TEST(GainControlBitExactnessTest, |
154 Stereo16kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { | 169 Stereo16kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
| 170 #else |
| 171 TEST(GainControlBitExactnessTest, |
| 172 DISABLED_Stereo16kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
| 173 #endif |
155 const int kStreamAnalogLevelReference = 50; | 174 const int kStreamAnalogLevelReference = 50; |
156 const float kOutputReference[] = {-0.027313f, -0.015900f, -0.028107f, | 175 const float kOutputReference[] = {-0.027313f, -0.015900f, -0.028107f, |
157 -0.027313f, -0.015900f, -0.028107f}; | 176 -0.027313f, -0.015900f, -0.028107f}; |
158 RunBitExactnessTest(16000, 2, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, | 177 RunBitExactnessTest(16000, 2, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, |
159 true, 0, 100, kStreamAnalogLevelReference, | 178 true, 0, 100, kStreamAnalogLevelReference, |
160 kOutputReference); | 179 kOutputReference); |
161 } | 180 } |
162 | 181 |
| 182 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 183 defined(WEBRTC_ANDROID)) |
163 TEST(GainControlBitExactnessTest, | 184 TEST(GainControlBitExactnessTest, |
164 Mono32kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { | 185 Mono32kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
| 186 #else |
| 187 TEST(GainControlBitExactnessTest, |
| 188 DISABLED_Mono32kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
| 189 #endif |
165 const int kStreamAnalogLevelReference = 50; | 190 const int kStreamAnalogLevelReference = 50; |
166 const float kOutputReference[] = {-0.010162f, -0.009155f, -0.008301f}; | 191 const float kOutputReference[] = {-0.010162f, -0.009155f, -0.008301f}; |
167 RunBitExactnessTest(32000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, | 192 RunBitExactnessTest(32000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, |
168 true, 0, 100, kStreamAnalogLevelReference, | 193 true, 0, 100, kStreamAnalogLevelReference, |
169 kOutputReference); | 194 kOutputReference); |
170 } | 195 } |
171 | 196 |
| 197 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 198 defined(WEBRTC_ANDROID)) |
172 TEST(GainControlBitExactnessTest, | 199 TEST(GainControlBitExactnessTest, |
173 Mono48kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { | 200 Mono48kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
| 201 #else |
| 202 TEST(GainControlBitExactnessTest, |
| 203 DISABLED_Mono48kHz_AdaptiveAnalog_Tl10_SL50_CG5_Lim_AL0_100) { |
| 204 #endif |
174 const int kStreamAnalogLevelReference = 50; | 205 const int kStreamAnalogLevelReference = 50; |
175 const float kOutputReference[] = {-0.010162f, -0.009155f, -0.008301f}; | 206 const float kOutputReference[] = {-0.010162f, -0.009155f, -0.008301f}; |
176 RunBitExactnessTest(32000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, | 207 RunBitExactnessTest(32000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 50, 5, |
177 true, 0, 100, kStreamAnalogLevelReference, | 208 true, 0, 100, kStreamAnalogLevelReference, |
178 kOutputReference); | 209 kOutputReference); |
179 } | 210 } |
180 | 211 |
| 212 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 213 defined(WEBRTC_ANDROID)) |
181 TEST(GainControlBitExactnessTest, | 214 TEST(GainControlBitExactnessTest, |
182 Mono8kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { | 215 Mono8kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 216 #else |
| 217 TEST(GainControlBitExactnessTest, |
| 218 DISABLED_Mono8kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 219 #endif |
183 const int kStreamAnalogLevelReference = 50; | 220 const int kStreamAnalogLevelReference = 50; |
184 const float kOutputReference[] = {-0.006317f, -0.002625f, 0.001495f}; | 221 const float kOutputReference[] = {-0.006317f, -0.002625f, 0.001495f}; |
185 RunBitExactnessTest(8000, 1, GainControl::Mode::kAdaptiveDigital, 10, 50, 5, | 222 RunBitExactnessTest(8000, 1, GainControl::Mode::kAdaptiveDigital, 10, 50, 5, |
186 true, 0, 100, kStreamAnalogLevelReference, | 223 true, 0, 100, kStreamAnalogLevelReference, |
187 kOutputReference); | 224 kOutputReference); |
188 } | 225 } |
189 | 226 |
| 227 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 228 defined(WEBRTC_ANDROID)) |
190 TEST(GainControlBitExactnessTest, | 229 TEST(GainControlBitExactnessTest, |
191 Mono16kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { | 230 Mono16kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 231 #else |
| 232 TEST(GainControlBitExactnessTest, |
| 233 DISABLED_Mono16kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 234 #endif |
192 const int kStreamAnalogLevelReference = 50; | 235 const int kStreamAnalogLevelReference = 50; |
193 const float kOutputReference[] = {-0.006256f, -0.004395f, -0.002777f}; | 236 const float kOutputReference[] = {-0.006256f, -0.004395f, -0.002777f}; |
194 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 10, 50, 5, | 237 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 10, 50, 5, |
195 true, 0, 100, kStreamAnalogLevelReference, | 238 true, 0, 100, kStreamAnalogLevelReference, |
196 kOutputReference); | 239 kOutputReference); |
197 } | 240 } |
198 | 241 |
| 242 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 243 defined(WEBRTC_ANDROID)) |
199 TEST(GainControlBitExactnessTest, | 244 TEST(GainControlBitExactnessTest, |
200 Stereo16kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { | 245 Stereo16kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 246 #else |
| 247 TEST(GainControlBitExactnessTest, |
| 248 DISABLED_Stereo16kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 249 #endif |
201 const int kStreamAnalogLevelReference = 50; | 250 const int kStreamAnalogLevelReference = 50; |
202 const float kOutputReference[] = {-0.023956f, -0.013947f, -0.024597f, | 251 const float kOutputReference[] = {-0.023956f, -0.013947f, -0.024597f, |
203 -0.023956f, -0.013947f, -0.024597f}; | 252 -0.023956f, -0.013947f, -0.024597f}; |
204 RunBitExactnessTest(16000, 2, GainControl::Mode::kAdaptiveDigital, 10, 50, 5, | 253 RunBitExactnessTest(16000, 2, GainControl::Mode::kAdaptiveDigital, 10, 50, 5, |
205 true, 0, 100, kStreamAnalogLevelReference, | 254 true, 0, 100, kStreamAnalogLevelReference, |
206 kOutputReference); | 255 kOutputReference); |
207 } | 256 } |
208 | 257 |
| 258 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 259 defined(WEBRTC_ANDROID)) |
209 TEST(GainControlBitExactnessTest, | 260 TEST(GainControlBitExactnessTest, |
210 Mono32kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { | 261 Mono32kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 262 #else |
| 263 TEST(GainControlBitExactnessTest, |
| 264 DISABLED_Mono32kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 265 #endif |
211 const int kStreamAnalogLevelReference = 50; | 266 const int kStreamAnalogLevelReference = 50; |
212 const float kOutputReference[] = {-0.009644f, -0.008728f, -0.007904f}; | 267 const float kOutputReference[] = {-0.009644f, -0.008728f, -0.007904f}; |
213 RunBitExactnessTest(32000, 1, GainControl::Mode::kAdaptiveDigital, 10, 50, 5, | 268 RunBitExactnessTest(32000, 1, GainControl::Mode::kAdaptiveDigital, 10, 50, 5, |
214 true, 0, 100, kStreamAnalogLevelReference, | 269 true, 0, 100, kStreamAnalogLevelReference, |
215 kOutputReference); | 270 kOutputReference); |
216 } | 271 } |
217 | 272 |
| 273 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 274 defined(WEBRTC_ANDROID)) |
218 TEST(GainControlBitExactnessTest, | 275 TEST(GainControlBitExactnessTest, |
219 Mono48kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { | 276 Mono48kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 277 #else |
| 278 TEST(GainControlBitExactnessTest, |
| 279 DISABLED_Mono48kHz_AdaptiveDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 280 #endif |
220 const int kStreamAnalogLevelReference = 50; | 281 const int kStreamAnalogLevelReference = 50; |
221 const float kOutputReference[] = {-0.009644f, -0.008728f, -0.007904f}; | 282 const float kOutputReference[] = {-0.009644f, -0.008728f, -0.007904f}; |
222 RunBitExactnessTest(32000, 1, GainControl::Mode::kAdaptiveDigital, 10, 50, 5, | 283 RunBitExactnessTest(32000, 1, GainControl::Mode::kAdaptiveDigital, 10, 50, 5, |
223 true, 0, 100, kStreamAnalogLevelReference, | 284 true, 0, 100, kStreamAnalogLevelReference, |
224 kOutputReference); | 285 kOutputReference); |
225 } | 286 } |
226 | 287 |
| 288 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 289 defined(WEBRTC_ANDROID)) |
227 TEST(GainControlBitExactnessTest, | 290 TEST(GainControlBitExactnessTest, |
228 Mono8kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { | 291 Mono8kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 292 #else |
| 293 TEST(GainControlBitExactnessTest, |
| 294 DISABLED_Mono8kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 295 #endif |
229 const int kStreamAnalogLevelReference = 50; | 296 const int kStreamAnalogLevelReference = 50; |
230 const float kOutputReference[] = {-0.011871f, -0.004944f, 0.002838f}; | 297 const float kOutputReference[] = {-0.011871f, -0.004944f, 0.002838f}; |
231 RunBitExactnessTest(8000, 1, GainControl::Mode::kFixedDigital, 10, 50, 5, | 298 RunBitExactnessTest(8000, 1, GainControl::Mode::kFixedDigital, 10, 50, 5, |
232 true, 0, 100, kStreamAnalogLevelReference, | 299 true, 0, 100, kStreamAnalogLevelReference, |
233 kOutputReference); | 300 kOutputReference); |
234 } | 301 } |
235 | 302 |
| 303 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 304 defined(WEBRTC_ANDROID)) |
236 TEST(GainControlBitExactnessTest, | 305 TEST(GainControlBitExactnessTest, |
237 Mono16kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { | 306 Mono16kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 307 #else |
| 308 TEST(GainControlBitExactnessTest, |
| 309 DISABLED_Mono16kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 310 #endif |
238 const int kStreamAnalogLevelReference = 50; | 311 const int kStreamAnalogLevelReference = 50; |
239 const float kOutputReference[] = {-0.011780f, -0.008270f, -0.005219f}; | 312 const float kOutputReference[] = {-0.011780f, -0.008270f, -0.005219f}; |
240 RunBitExactnessTest(16000, 1, GainControl::Mode::kFixedDigital, 10, 50, 5, | 313 RunBitExactnessTest(16000, 1, GainControl::Mode::kFixedDigital, 10, 50, 5, |
241 true, 0, 100, kStreamAnalogLevelReference, | 314 true, 0, 100, kStreamAnalogLevelReference, |
242 kOutputReference); | 315 kOutputReference); |
243 } | 316 } |
244 | 317 |
| 318 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 319 defined(WEBRTC_ANDROID)) |
245 TEST(GainControlBitExactnessTest, | 320 TEST(GainControlBitExactnessTest, |
246 Stereo16kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { | 321 Stereo16kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 322 #else |
| 323 TEST(GainControlBitExactnessTest, |
| 324 DISABLED_Stereo16kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 325 #endif |
247 const int kStreamAnalogLevelReference = 50; | 326 const int kStreamAnalogLevelReference = 50; |
248 const float kOutputReference[] = {-0.048950f, -0.028503f, -0.050354f, | 327 const float kOutputReference[] = {-0.048950f, -0.028503f, -0.050354f, |
249 -0.048950f, -0.028503f, -0.050354f}; | 328 -0.048950f, -0.028503f, -0.050354f}; |
250 RunBitExactnessTest(16000, 2, GainControl::Mode::kFixedDigital, 10, 50, 5, | 329 RunBitExactnessTest(16000, 2, GainControl::Mode::kFixedDigital, 10, 50, 5, |
251 true, 0, 100, kStreamAnalogLevelReference, | 330 true, 0, 100, kStreamAnalogLevelReference, |
252 kOutputReference); | 331 kOutputReference); |
253 } | 332 } |
254 | 333 |
| 334 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 335 defined(WEBRTC_ANDROID)) |
255 TEST(GainControlBitExactnessTest, | 336 TEST(GainControlBitExactnessTest, |
256 Mono32kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { | 337 Mono32kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 338 #else |
| 339 TEST(GainControlBitExactnessTest, |
| 340 DISABLED_Mono32kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 341 #endif |
257 const int kStreamAnalogLevelReference = 50; | 342 const int kStreamAnalogLevelReference = 50; |
258 const float kOutputReference[] = {-0.018188f, -0.016418f, -0.014862f}; | 343 const float kOutputReference[] = {-0.018188f, -0.016418f, -0.014862f}; |
259 RunBitExactnessTest(32000, 1, GainControl::Mode::kFixedDigital, 10, 50, 5, | 344 RunBitExactnessTest(32000, 1, GainControl::Mode::kFixedDigital, 10, 50, 5, |
260 true, 0, 100, kStreamAnalogLevelReference, | 345 true, 0, 100, kStreamAnalogLevelReference, |
261 kOutputReference); | 346 kOutputReference); |
262 } | 347 } |
263 | 348 |
| 349 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 350 defined(WEBRTC_ANDROID)) |
264 TEST(GainControlBitExactnessTest, | 351 TEST(GainControlBitExactnessTest, |
265 Mono48kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { | 352 Mono48kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 353 #else |
| 354 TEST(GainControlBitExactnessTest, |
| 355 DISABLED_Mono48kHz_FixedDigital_Tl10_SL50_CG5_Lim_AL0_100) { |
| 356 #endif |
266 const int kStreamAnalogLevelReference = 50; | 357 const int kStreamAnalogLevelReference = 50; |
267 const float kOutputReference[] = {-0.018188f, -0.016418f, -0.014862f}; | 358 const float kOutputReference[] = {-0.018188f, -0.016418f, -0.014862f}; |
268 RunBitExactnessTest(32000, 1, GainControl::Mode::kFixedDigital, 10, 50, 5, | 359 RunBitExactnessTest(32000, 1, GainControl::Mode::kFixedDigital, 10, 50, 5, |
269 true, 0, 100, kStreamAnalogLevelReference, | 360 true, 0, 100, kStreamAnalogLevelReference, |
270 kOutputReference); | 361 kOutputReference); |
271 } | 362 } |
272 | 363 |
| 364 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 365 defined(WEBRTC_ANDROID)) |
273 TEST(GainControlBitExactnessTest, | 366 TEST(GainControlBitExactnessTest, |
274 Mono16kHz_AdaptiveAnalog_Tl10_SL10_CG5_Lim_AL0_100) { | 367 Mono16kHz_AdaptiveAnalog_Tl10_SL10_CG5_Lim_AL0_100) { |
| 368 #else |
| 369 TEST(GainControlBitExactnessTest, |
| 370 DISABLED_Mono16kHz_AdaptiveAnalog_Tl10_SL10_CG5_Lim_AL0_100) { |
| 371 #endif |
275 const int kStreamAnalogLevelReference = 12; | 372 const int kStreamAnalogLevelReference = 12; |
276 const float kOutputReference[] = {-0.006561f, -0.004608f, -0.002899f}; | 373 const float kOutputReference[] = {-0.006561f, -0.004608f, -0.002899f}; |
277 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 10, 5, | 374 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 10, 5, |
278 true, 0, 100, kStreamAnalogLevelReference, | 375 true, 0, 100, kStreamAnalogLevelReference, |
279 kOutputReference); | 376 kOutputReference); |
280 } | 377 } |
281 | 378 |
| 379 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 380 defined(WEBRTC_ANDROID)) |
282 TEST(GainControlBitExactnessTest, | 381 TEST(GainControlBitExactnessTest, |
283 Mono16kHz_AdaptiveAnalog_Tl10_SL100_CG5_Lim_AL70_80) { | 382 Mono16kHz_AdaptiveAnalog_Tl10_SL100_CG5_Lim_AL70_80) { |
| 383 #else |
| 384 TEST(GainControlBitExactnessTest, |
| 385 DISABLED_Mono16kHz_AdaptiveAnalog_Tl10_SL100_CG5_Lim_AL70_80) { |
| 386 #endif |
284 const int kStreamAnalogLevelReference = 100; | 387 const int kStreamAnalogLevelReference = 100; |
285 const float kOutputReference[] = {-0.006348f, -0.004456f, -0.002808f}; | 388 const float kOutputReference[] = {-0.006348f, -0.004456f, -0.002808f}; |
286 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 100, 5, | 389 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveAnalog, 10, 100, 5, |
287 true, 70, 80, kStreamAnalogLevelReference, | 390 true, 70, 80, kStreamAnalogLevelReference, |
288 kOutputReference); | 391 kOutputReference); |
289 } | 392 } |
290 | 393 |
| 394 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 395 defined(WEBRTC_ANDROID)) |
291 TEST(GainControlBitExactnessTest, | 396 TEST(GainControlBitExactnessTest, |
292 Mono16kHz_AdaptiveDigital_Tl10_SL100_CG5_NoLim_AL0_100) { | 397 Mono16kHz_AdaptiveDigital_Tl10_SL100_CG5_NoLim_AL0_100) { |
| 398 #else |
| 399 TEST(GainControlBitExactnessTest, |
| 400 DISABLED_Mono16kHz_AdaptiveDigital_Tl10_SL100_CG5_NoLim_AL0_100) { |
| 401 #endif |
293 const int kStreamAnalogLevelReference = 100; | 402 const int kStreamAnalogLevelReference = 100; |
294 const float kOutputReference[] = {-0.006592f, -0.004639f, -0.002930f}; | 403 const float kOutputReference[] = {-0.006592f, -0.004639f, -0.002930f}; |
295 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 10, 100, 5, | 404 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 10, 100, 5, |
296 false, 0, 100, kStreamAnalogLevelReference, | 405 false, 0, 100, kStreamAnalogLevelReference, |
297 kOutputReference); | 406 kOutputReference); |
298 } | 407 } |
299 | 408 |
| 409 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 410 defined(WEBRTC_ANDROID)) |
300 TEST(GainControlBitExactnessTest, | 411 TEST(GainControlBitExactnessTest, |
301 Mono16kHz_AdaptiveDigital_Tl40_SL100_CG5_Lim_AL0_100) { | 412 Mono16kHz_AdaptiveDigital_Tl40_SL100_CG5_Lim_AL0_100) { |
| 413 #else |
| 414 TEST(GainControlBitExactnessTest, |
| 415 DISABLED_Mono16kHz_AdaptiveDigital_Tl40_SL100_CG5_Lim_AL0_100) { |
| 416 #endif |
302 const int kStreamAnalogLevelReference = 100; | 417 const int kStreamAnalogLevelReference = 100; |
303 const float kOutputReference[] = {-0.008759f, -0.006134f, -0.003876f}; | 418 const float kOutputReference[] = {-0.008759f, -0.006134f, -0.003876f}; |
304 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 40, 100, 5, | 419 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 40, 100, 5, |
305 true, 0, 100, kStreamAnalogLevelReference, | 420 true, 0, 100, kStreamAnalogLevelReference, |
306 kOutputReference); | 421 kOutputReference); |
307 } | 422 } |
308 | 423 |
| 424 #if !(defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM) || \ |
| 425 defined(WEBRTC_ANDROID)) |
309 TEST(GainControlBitExactnessTest, | 426 TEST(GainControlBitExactnessTest, |
310 Mono16kHz_AdaptiveDigital_Tl10_SL100_CG30_Lim_AL0_100) { | 427 Mono16kHz_AdaptiveDigital_Tl10_SL100_CG30_Lim_AL0_100) { |
| 428 #else |
| 429 TEST(GainControlBitExactnessTest, |
| 430 DISABLED_Mono16kHz_AdaptiveDigital_Tl10_SL100_CG30_Lim_AL0_100) { |
| 431 #endif |
311 const int kStreamAnalogLevelReference = 100; | 432 const int kStreamAnalogLevelReference = 100; |
312 const float kOutputReference[] = {-0.006134f, -0.004303f, -0.002716f}; | 433 const float kOutputReference[] = {-0.006134f, -0.004303f, -0.002716f}; |
313 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 10, 100, | 434 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 10, 100, |
314 30, true, 0, 100, kStreamAnalogLevelReference, | 435 30, true, 0, 100, kStreamAnalogLevelReference, |
315 kOutputReference); | 436 kOutputReference); |
316 } | 437 } |
317 | 438 |
318 } // namespace webrtc | 439 } // namespace webrtc |
319 | |
320 #endif | |
OLD | NEW |