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 12 matching lines...) Expand all Loading... |
23 | 23 |
24 void ProcessOneFrame(int sample_rate_hz, | 24 void ProcessOneFrame(int sample_rate_hz, |
25 AudioBuffer* render_audio_buffer, | 25 AudioBuffer* render_audio_buffer, |
26 AudioBuffer* capture_audio_buffer, | 26 AudioBuffer* capture_audio_buffer, |
27 GainControlImpl* gain_controller) { | 27 GainControlImpl* gain_controller) { |
28 if (sample_rate_hz > AudioProcessing::kSampleRate16kHz) { | 28 if (sample_rate_hz > AudioProcessing::kSampleRate16kHz) { |
29 render_audio_buffer->SplitIntoFrequencyBands(); | 29 render_audio_buffer->SplitIntoFrequencyBands(); |
30 capture_audio_buffer->SplitIntoFrequencyBands(); | 30 capture_audio_buffer->SplitIntoFrequencyBands(); |
31 } | 31 } |
32 | 32 |
33 gain_controller->ProcessRenderAudio(render_audio_buffer); | 33 std::vector<int16_t> render_audio; |
34 gain_controller->ReadQueuedRenderData(); | 34 GainControlImpl::PackRenderAudioBuffer(render_audio_buffer, &render_audio); |
| 35 gain_controller->ProcessRenderAudio(render_audio); |
35 gain_controller->AnalyzeCaptureAudio(capture_audio_buffer); | 36 gain_controller->AnalyzeCaptureAudio(capture_audio_buffer); |
36 gain_controller->ProcessCaptureAudio(capture_audio_buffer, false); | 37 gain_controller->ProcessCaptureAudio(capture_audio_buffer, false); |
37 | 38 |
38 if (sample_rate_hz > AudioProcessing::kSampleRate16kHz) { | 39 if (sample_rate_hz > AudioProcessing::kSampleRate16kHz) { |
39 capture_audio_buffer->MergeFrequencyBands(); | 40 capture_audio_buffer->MergeFrequencyBands(); |
40 } | 41 } |
41 } | 42 } |
42 | 43 |
43 void SetupComponent(int sample_rate_hz, | 44 void SetupComponent(int sample_rate_hz, |
44 GainControl::Mode mode, | 45 GainControl::Mode mode, |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 DISABLED_Mono16kHz_AdaptiveDigital_Tl10_SL100_CG30_Lim_AL0_100) { | 432 DISABLED_Mono16kHz_AdaptiveDigital_Tl10_SL100_CG30_Lim_AL0_100) { |
432 #endif | 433 #endif |
433 const int kStreamAnalogLevelReference = 100; | 434 const int kStreamAnalogLevelReference = 100; |
434 const float kOutputReference[] = {-0.005859f, -0.004120f, -0.002594f}; | 435 const float kOutputReference[] = {-0.005859f, -0.004120f, -0.002594f}; |
435 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 10, 100, | 436 RunBitExactnessTest(16000, 1, GainControl::Mode::kAdaptiveDigital, 10, 100, |
436 30, true, 0, 100, kStreamAnalogLevelReference, | 437 30, true, 0, 100, kStreamAnalogLevelReference, |
437 kOutputReference); | 438 kOutputReference); |
438 } | 439 } |
439 | 440 |
440 } // namespace webrtc | 441 } // namespace webrtc |
OLD | NEW |