OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 ProcessOneFrame(sample_rate_hz, &render_buffer, &capture_buffer, | 293 ProcessOneFrame(sample_rate_hz, &render_buffer, &capture_buffer, |
294 &noise_suppressor, &intelligibility_enhancer); | 294 &noise_suppressor, &intelligibility_enhancer); |
295 } | 295 } |
296 | 296 |
297 // Extract and verify the test results. | 297 // Extract and verify the test results. |
298 std::vector<float> render_output; | 298 std::vector<float> render_output; |
299 test::ExtractVectorFromAudioBuffer(render_config, &render_buffer, | 299 test::ExtractVectorFromAudioBuffer(render_config, &render_buffer, |
300 &render_output); | 300 &render_output); |
301 | 301 |
302 const float kTolerance = 1.f / static_cast<float>(1 << 15); | 302 const float kElementErrorBound = 1.f / static_cast<float>(1 << 15); |
303 | 303 |
304 // Compare the output with the reference. Only the first values of the output | 304 // Compare the output with the reference. Only the first values of the output |
305 // from last frame processed are compared in order not having to specify all | 305 // from last frame processed are compared in order not having to specify all |
306 // preceeding frames as testvectors. As the algorithm being tested has a | 306 // preceeding frames as testvectors. As the algorithm being tested has a |
307 // memory, testing only the last frame implicitly also tests the preceeding | 307 // memory, testing only the last frame implicitly also tests the preceeding |
308 // frames. | 308 // frames. |
309 EXPECT_TRUE(test::BitExactFrame(render_buffer.num_frames(), | 309 EXPECT_TRUE(test::VerifyDeinterleavedArray( |
310 render_config.num_channels(), | 310 render_buffer.num_frames(), render_config.num_channels(), |
311 output_reference, render_output, kTolerance)); | 311 output_reference, render_output, kElementErrorBound)); |
312 } | 312 } |
313 | 313 |
314 } // namespace | 314 } // namespace |
315 | 315 |
316 class IntelligibilityEnhancerTest : public ::testing::Test { | 316 class IntelligibilityEnhancerTest : public ::testing::Test { |
317 protected: | 317 protected: |
318 IntelligibilityEnhancerTest() | 318 IntelligibilityEnhancerTest() |
319 : clear_data_(kSamples), noise_data_(kSamples), orig_data_(kSamples) { | 319 : clear_data_(kSamples), noise_data_(kSamples), orig_data_(kSamples) { |
320 enh_.reset( | 320 enh_.reset( |
321 new IntelligibilityEnhancer(kSampleRate, kNumChannels, kNumNoiseBins)); | 321 new IntelligibilityEnhancer(kSampleRate, kNumChannels, kNumNoiseBins)); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 } | 449 } |
450 | 450 |
451 TEST(IntelligibilityEnhancerBitExactnessTest, DISABLED_Stereo48kHz) { | 451 TEST(IntelligibilityEnhancerBitExactnessTest, DISABLED_Stereo48kHz) { |
452 const float kOutputReference[] = {-0.009276f, -0.001601f, -0.008255f, | 452 const float kOutputReference[] = {-0.009276f, -0.001601f, -0.008255f, |
453 -0.012975f, -0.015940f, -0.017820f}; | 453 -0.012975f, -0.015940f, -0.017820f}; |
454 | 454 |
455 RunBitexactnessTest(AudioProcessing::kSampleRate48kHz, 2, kOutputReference); | 455 RunBitexactnessTest(AudioProcessing::kSampleRate48kHz, 2, kOutputReference); |
456 } | 456 } |
457 | 457 |
458 } // namespace webrtc | 458 } // namespace webrtc |
OLD | NEW |