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

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

Issue 2567513003: Added basic framework for AEC3 in the audio processing module (Closed)
Patch Set: Changes in response to reviewer comments Created 4 years 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // Updates the submodule state and returns true if it has changed. 161 // Updates the submodule state and returns true if it has changed.
162 bool Update(bool low_cut_filter_enabled, 162 bool Update(bool low_cut_filter_enabled,
163 bool echo_canceller_enabled, 163 bool echo_canceller_enabled,
164 bool mobile_echo_controller_enabled, 164 bool mobile_echo_controller_enabled,
165 bool residual_echo_detector_enabled, 165 bool residual_echo_detector_enabled,
166 bool noise_suppressor_enabled, 166 bool noise_suppressor_enabled,
167 bool intelligibility_enhancer_enabled, 167 bool intelligibility_enhancer_enabled,
168 bool beamformer_enabled, 168 bool beamformer_enabled,
169 bool adaptive_gain_controller_enabled, 169 bool adaptive_gain_controller_enabled,
170 bool level_controller_enabled, 170 bool level_controller_enabled,
171 bool echo_canceller3_enabled,
171 bool voice_activity_detector_enabled, 172 bool voice_activity_detector_enabled,
172 bool level_estimator_enabled, 173 bool level_estimator_enabled,
173 bool transient_suppressor_enabled); 174 bool transient_suppressor_enabled);
174 bool CaptureMultiBandSubModulesActive() const; 175 bool CaptureMultiBandSubModulesActive() const;
175 bool CaptureMultiBandProcessingActive() const; 176 bool CaptureMultiBandProcessingActive() const;
176 bool RenderMultiBandSubModulesActive() const; 177 bool RenderMultiBandSubModulesActive() const;
177 bool RenderMultiBandProcessingActive() const; 178 bool RenderMultiBandProcessingActive() const;
178 179
179 private: 180 private:
180 bool low_cut_filter_enabled_ = false; 181 bool low_cut_filter_enabled_ = false;
181 bool echo_canceller_enabled_ = false; 182 bool echo_canceller_enabled_ = false;
182 bool mobile_echo_controller_enabled_ = false; 183 bool mobile_echo_controller_enabled_ = false;
183 bool residual_echo_detector_enabled_ = false; 184 bool residual_echo_detector_enabled_ = false;
184 bool noise_suppressor_enabled_ = false; 185 bool noise_suppressor_enabled_ = false;
185 bool intelligibility_enhancer_enabled_ = false; 186 bool intelligibility_enhancer_enabled_ = false;
186 bool beamformer_enabled_ = false; 187 bool beamformer_enabled_ = false;
187 bool adaptive_gain_controller_enabled_ = false; 188 bool adaptive_gain_controller_enabled_ = false;
188 bool level_controller_enabled_ = false; 189 bool level_controller_enabled_ = false;
190 bool echo_canceller3_enabled_ = false;
189 bool level_estimator_enabled_ = false; 191 bool level_estimator_enabled_ = false;
190 bool voice_activity_detector_enabled_ = false; 192 bool voice_activity_detector_enabled_ = false;
191 bool transient_suppressor_enabled_ = false; 193 bool transient_suppressor_enabled_ = false;
192 bool first_update_ = true; 194 bool first_update_ = true;
193 }; 195 };
194 196
195 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP 197 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
196 // State for the debug dump. 198 // State for the debug dump.
197 struct ApmDebugDumpThreadState { 199 struct ApmDebugDumpThreadState {
198 ApmDebugDumpThreadState(); 200 ApmDebugDumpThreadState();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 void InitializeBeamformer() 246 void InitializeBeamformer()
245 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 247 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
246 void InitializeIntelligibility() 248 void InitializeIntelligibility()
247 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 249 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
248 int InitializeLocked(const ProcessingConfig& config) 250 int InitializeLocked(const ProcessingConfig& config)
249 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 251 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
250 void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 252 void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
251 void InitializeResidualEchoDetector() 253 void InitializeResidualEchoDetector()
252 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 254 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
253 void InitializeLowCutFilter() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 255 void InitializeLowCutFilter() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
256 void InitializeEchoCanceller3() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
254 257
255 void EmptyQueuedRenderAudio(); 258 void EmptyQueuedRenderAudio();
256 void AllocateRenderQueue() 259 void AllocateRenderQueue()
257 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 260 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
258 void QueueRenderAudio(AudioBuffer* audio) 261 void QueueRenderAudio(AudioBuffer* audio)
259 EXCLUSIVE_LOCKS_REQUIRED(crit_render_); 262 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
260 263
261 // Capture-side exclusive methods possibly running APM in a multi-threaded 264 // Capture-side exclusive methods possibly running APM in a multi-threaded
262 // manner that are called with the render lock already acquired. 265 // manner that are called with the render lock already acquired.
263 int ProcessCaptureStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 266 int ProcessCaptureStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 intelligibility_enabled(intelligibility_enabled) {} 378 intelligibility_enabled(intelligibility_enabled) {}
376 // Only the rate and samples fields of capture_processing_format_ are used 379 // Only the rate and samples fields of capture_processing_format_ are used
377 // because the forward processing number of channels is mutable and is 380 // because the forward processing number of channels is mutable and is
378 // tracked by the capture_audio_. 381 // tracked by the capture_audio_.
379 StreamConfig capture_processing_format; 382 StreamConfig capture_processing_format;
380 int split_rate; 383 int split_rate;
381 int stream_delay_ms; 384 int stream_delay_ms;
382 bool beamformer_enabled; 385 bool beamformer_enabled;
383 bool intelligibility_enabled; 386 bool intelligibility_enabled;
384 bool level_controller_enabled = false; 387 bool level_controller_enabled = false;
388 bool echo_canceller3_enabled = false;
385 } capture_nonlocked_; 389 } capture_nonlocked_;
386 390
387 struct ApmRenderState { 391 struct ApmRenderState {
388 ApmRenderState(); 392 ApmRenderState();
389 ~ApmRenderState(); 393 ~ApmRenderState();
390 std::unique_ptr<AudioConverter> render_converter; 394 std::unique_ptr<AudioConverter> render_converter;
391 std::unique_ptr<AudioBuffer> render_audio; 395 std::unique_ptr<AudioBuffer> render_audio;
392 } render_ GUARDED_BY(crit_render_); 396 } render_ GUARDED_BY(crit_render_);
393 397
394 size_t aec_render_queue_element_max_size_ GUARDED_BY(crit_render_) 398 size_t aec_render_queue_element_max_size_ GUARDED_BY(crit_render_)
(...skipping 28 matching lines...) Expand all
423 std::unique_ptr< 427 std::unique_ptr<
424 SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>> 428 SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>>
425 agc_render_signal_queue_; 429 agc_render_signal_queue_;
426 std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>> 430 std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>>
427 red_render_signal_queue_; 431 red_render_signal_queue_;
428 }; 432 };
429 433
430 } // namespace webrtc 434 } // namespace webrtc
431 435
432 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ 436 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/aec3/echo_canceller3.cc ('k') | webrtc/modules/audio_processing/audio_processing_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698