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

Side by Side Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 1394103003: Make the nonlinear beamformer steerable (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@highfreq
Patch Set: Generalize interferer scenarios Created 5 years, 2 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 unified diff | Download patch
OLDNEW
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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 #endif 218 #endif
219 agc_startup_min_volume_(config.Get<ExperimentalAgc>().startup_min_volume), 219 agc_startup_min_volume_(config.Get<ExperimentalAgc>().startup_min_volume),
220 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) 220 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
221 transient_suppressor_enabled_(false), 221 transient_suppressor_enabled_(false),
222 #else 222 #else
223 transient_suppressor_enabled_(config.Get<ExperimentalNs>().enabled), 223 transient_suppressor_enabled_(config.Get<ExperimentalNs>().enabled),
224 #endif 224 #endif
225 beamformer_enabled_(config.Get<Beamforming>().enabled), 225 beamformer_enabled_(config.Get<Beamforming>().enabled),
226 beamformer_(beamformer), 226 beamformer_(beamformer),
227 array_geometry_(config.Get<Beamforming>().array_geometry), 227 array_geometry_(config.Get<Beamforming>().array_geometry),
228 target_direction_(config.Get<Beamforming>().target_direction),
228 intelligibility_enabled_(config.Get<Intelligibility>().enabled) { 229 intelligibility_enabled_(config.Get<Intelligibility>().enabled) {
229 echo_cancellation_ = new EchoCancellationImpl(this, crit_); 230 echo_cancellation_ = new EchoCancellationImpl(this, crit_);
230 component_list_.push_back(echo_cancellation_); 231 component_list_.push_back(echo_cancellation_);
231 232
232 echo_control_mobile_ = new EchoControlMobileImpl(this, crit_); 233 echo_control_mobile_ = new EchoControlMobileImpl(this, crit_);
233 component_list_.push_back(echo_control_mobile_); 234 component_list_.push_back(echo_control_mobile_);
234 235
235 gain_control_ = new GainControlImpl(this, crit_); 236 gain_control_ = new GainControlImpl(this, crit_);
236 component_list_.push_back(gain_control_); 237 component_list_.push_back(gain_control_);
237 238
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 } 1093 }
1093 transient_suppressor_->Initialize( 1094 transient_suppressor_->Initialize(
1094 fwd_proc_format_.sample_rate_hz(), split_rate_, 1095 fwd_proc_format_.sample_rate_hz(), split_rate_,
1095 api_format_.output_stream().num_channels()); 1096 api_format_.output_stream().num_channels());
1096 } 1097 }
1097 } 1098 }
1098 1099
1099 void AudioProcessingImpl::InitializeBeamformer() { 1100 void AudioProcessingImpl::InitializeBeamformer() {
1100 if (beamformer_enabled_) { 1101 if (beamformer_enabled_) {
1101 if (!beamformer_) { 1102 if (!beamformer_) {
1102 beamformer_.reset(new NonlinearBeamformer(array_geometry_)); 1103 beamformer_.reset(
1104 new NonlinearBeamformer(array_geometry_, target_direction_));
1103 } 1105 }
1104 beamformer_->Initialize(kChunkSizeMs, split_rate_); 1106 beamformer_->Initialize(kChunkSizeMs, split_rate_);
1105 } 1107 }
1106 } 1108 }
1107 1109
1108 void AudioProcessingImpl::InitializeIntelligibility() { 1110 void AudioProcessingImpl::InitializeIntelligibility() {
1109 if (intelligibility_enabled_) { 1111 if (intelligibility_enabled_) {
1110 IntelligibilityEnhancer::Config config; 1112 IntelligibilityEnhancer::Config config;
1111 config.sample_rate_hz = split_rate_; 1113 config.sample_rate_hz = split_rate_;
1112 config.num_capture_channels = capture_audio_->num_channels(); 1114 config.num_capture_channels = capture_audio_->num_channels();
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 1266
1265 event_msg_->set_type(audioproc::Event::CONFIG); 1267 event_msg_->set_type(audioproc::Event::CONFIG);
1266 event_msg_->mutable_config()->CopyFrom(config); 1268 event_msg_->mutable_config()->CopyFrom(config);
1267 1269
1268 RETURN_ON_ERR(WriteMessageToDebugFile()); 1270 RETURN_ON_ERR(WriteMessageToDebugFile());
1269 return kNoError; 1271 return kNoError;
1270 } 1272 }
1271 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1273 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1272 1274
1273 } // namespace webrtc 1275 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698