| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 capture_nonlocked_.fwd_proc_format.num_frames()); | 675 capture_nonlocked_.fwd_proc_format.num_frames()); |
| 676 } | 676 } |
| 677 | 677 |
| 678 if (fwd_analysis_needed()) { | 678 if (fwd_analysis_needed()) { |
| 679 ca->SplitIntoFrequencyBands(); | 679 ca->SplitIntoFrequencyBands(); |
| 680 } | 680 } |
| 681 | 681 |
| 682 if (capture_nonlocked_.beamformer_enabled) { | 682 if (capture_nonlocked_.beamformer_enabled) { |
| 683 private_submodules_->beamformer->ProcessChunk(*ca->split_data_f(), | 683 private_submodules_->beamformer->ProcessChunk(*ca->split_data_f(), |
| 684 ca->split_data_f()); | 684 ca->split_data_f()); |
| 685 // Discards all channels by the leftmost one. |
| 685 ca->set_num_channels(1); | 686 ca->set_num_channels(1); |
| 686 } | 687 } |
| 687 | 688 |
| 688 public_submodules_->high_pass_filter->ProcessCaptureAudio(ca); | 689 public_submodules_->high_pass_filter->ProcessCaptureAudio(ca); |
| 689 RETURN_ON_ERR(public_submodules_->gain_control->AnalyzeCaptureAudio(ca)); | 690 RETURN_ON_ERR(public_submodules_->gain_control->AnalyzeCaptureAudio(ca)); |
| 690 public_submodules_->noise_suppression->AnalyzeCaptureAudio(ca); | 691 public_submodules_->noise_suppression->AnalyzeCaptureAudio(ca); |
| 691 | 692 |
| 692 // Ensure that the stream delay was set before the call to the | 693 // Ensure that the stream delay was set before the call to the |
| 693 // AEC ProcessCaptureAudio function. | 694 // AEC ProcessCaptureAudio function. |
| 694 if (public_submodules_->echo_cancellation->is_enabled() && | 695 if (public_submodules_->echo_cancellation->is_enabled() && |
| (...skipping 20 matching lines...) Expand all Loading... |
| 715 // Ensure that the stream delay was set before the call to the | 716 // Ensure that the stream delay was set before the call to the |
| 716 // AECM ProcessCaptureAudio function. | 717 // AECM ProcessCaptureAudio function. |
| 717 if (public_submodules_->echo_control_mobile->is_enabled() && | 718 if (public_submodules_->echo_control_mobile->is_enabled() && |
| 718 !was_stream_delay_set()) { | 719 !was_stream_delay_set()) { |
| 719 return AudioProcessing::kStreamParameterNotSetError; | 720 return AudioProcessing::kStreamParameterNotSetError; |
| 720 } | 721 } |
| 721 | 722 |
| 722 RETURN_ON_ERR(public_submodules_->echo_control_mobile->ProcessCaptureAudio( | 723 RETURN_ON_ERR(public_submodules_->echo_control_mobile->ProcessCaptureAudio( |
| 723 ca, stream_delay_ms())); | 724 ca, stream_delay_ms())); |
| 724 | 725 |
| 726 if (capture_nonlocked_.beamformer_enabled) { |
| 727 private_submodules_->beamformer->PostFilter(ca->split_data_f()); |
| 728 } |
| 729 |
| 725 public_submodules_->voice_detection->ProcessCaptureAudio(ca); | 730 public_submodules_->voice_detection->ProcessCaptureAudio(ca); |
| 726 | 731 |
| 727 if (constants_.use_experimental_agc && | 732 if (constants_.use_experimental_agc && |
| 728 public_submodules_->gain_control->is_enabled() && | 733 public_submodules_->gain_control->is_enabled() && |
| 729 (!capture_nonlocked_.beamformer_enabled || | 734 (!capture_nonlocked_.beamformer_enabled || |
| 730 private_submodules_->beamformer->is_target_present())) { | 735 private_submodules_->beamformer->is_target_present())) { |
| 731 private_submodules_->agc_manager->Process( | 736 private_submodules_->agc_manager->Process( |
| 732 ca->split_bands_const(0)[kBand0To8kHz], ca->num_frames_per_band(), | 737 ca->split_bands_const(0)[kBand0To8kHz], ca->num_frames_per_band(), |
| 733 capture_nonlocked_.split_rate); | 738 capture_nonlocked_.split_rate); |
| 734 } | 739 } |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); | 1466 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); |
| 1462 | 1467 |
| 1463 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), | 1468 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), |
| 1464 &debug_dump_.num_bytes_left_for_log_, | 1469 &debug_dump_.num_bytes_left_for_log_, |
| 1465 &crit_debug_, &debug_dump_.capture)); | 1470 &crit_debug_, &debug_dump_.capture)); |
| 1466 return kNoError; | 1471 return kNoError; |
| 1467 } | 1472 } |
| 1468 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1473 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
| 1469 | 1474 |
| 1470 } // namespace webrtc | 1475 } // namespace webrtc |
| OLD | NEW |