Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 1982183002: Pull out the PostFilter to its own NonlinearBeamformer API (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Drop Beamformer Interface Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/audio_processing_impl.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index d89cc339315c5bf6b76cda4334eff5dbe8137121..f417a856da5d70db046404e9c841a3968d81593f 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -127,10 +127,10 @@ struct AudioProcessingImpl::ApmPublicSubmodules {
};
struct AudioProcessingImpl::ApmPrivateSubmodules {
- explicit ApmPrivateSubmodules(Beamformer<float>* beamformer)
+ explicit ApmPrivateSubmodules(NonlinearBeamformer* beamformer)
: beamformer(beamformer) {}
// Accessed internally from capture or during initialization
- std::unique_ptr<Beamformer<float>> beamformer;
+ std::unique_ptr<NonlinearBeamformer> beamformer;
std::unique_ptr<AgcManagerDirect> agc_manager;
};
@@ -144,7 +144,7 @@ AudioProcessing* AudioProcessing::Create(const Config& config) {
}
AudioProcessing* AudioProcessing::Create(const Config& config,
- Beamformer<float>* beamformer) {
+ NonlinearBeamformer* beamformer) {
AudioProcessingImpl* apm = new AudioProcessingImpl(config, beamformer);
if (apm->Initialize() != kNoError) {
delete apm;
@@ -158,7 +158,7 @@ AudioProcessingImpl::AudioProcessingImpl(const Config& config)
: AudioProcessingImpl(config, nullptr) {}
AudioProcessingImpl::AudioProcessingImpl(const Config& config,
- Beamformer<float>* beamformer)
+ NonlinearBeamformer* beamformer)
: public_submodules_(new ApmPublicSubmodules()),
private_submodules_(new ApmPrivateSubmodules(beamformer)),
constants_(config.Get<ExperimentalAgc>().startup_min_volume,
@@ -680,8 +680,8 @@ int AudioProcessingImpl::ProcessStreamLocked() {
}
if (capture_nonlocked_.beamformer_enabled) {
- private_submodules_->beamformer->ProcessChunk(*ca->split_data_f(),
- ca->split_data_f());
+ private_submodules_->beamformer->AnalyzeChunk(*ca->split_data_f());
peah-webrtc 2016/06/08 12:04:55 What has changed here, is that now all the downmix
aluebs-webrtc 2016/06/09 02:11:46 What do you mean with downmixing? Before there was
peah-webrtc 2016/06/09 09:36:30 By downmixing I mean going from 2 to 1 channel, so
aluebs-webrtc 2016/06/09 19:21:42 Personally I find "downmixing" to have a blending
+ // Discards all channels by the leftmost one.
ca->set_num_channels(1);
}
@@ -722,6 +722,10 @@ int AudioProcessingImpl::ProcessStreamLocked() {
RETURN_ON_ERR(public_submodules_->echo_control_mobile->ProcessCaptureAudio(
ca, stream_delay_ms()));
+ if (capture_nonlocked_.beamformer_enabled) {
+ private_submodules_->beamformer->PostFilter(ca->split_data_f());
+ }
+
public_submodules_->voice_detection->ProcessCaptureAudio(ca);
if (constants_.use_experimental_agc &&

Powered by Google App Engine
This is Rietveld 408576698