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

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

Issue 2848593002: AGC2 as a new APM sub-module operating with hard-coded gain. (Closed)
Patch Set: unneeded DCHECK removed Created 3 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 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 23 matching lines...) Expand all
34 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD 34 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD
35 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h" 35 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h"
36 #else 36 #else
37 #include "webrtc/modules/audio_processing/debug.pb.h" 37 #include "webrtc/modules/audio_processing/debug.pb.h"
38 #endif 38 #endif
39 RTC_POP_IGNORING_WUNDEF() 39 RTC_POP_IGNORING_WUNDEF()
40 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 40 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
41 41
42 namespace webrtc { 42 namespace webrtc {
43 43
44 class AgcManagerDirect;
45 class AudioConverter; 44 class AudioConverter;
46
47 class NonlinearBeamformer; 45 class NonlinearBeamformer;
48 46
49 class AudioProcessingImpl : public AudioProcessing { 47 class AudioProcessingImpl : public AudioProcessing {
50 public: 48 public:
51 // Methods forcing APM to run in a single-threaded manner. 49 // Methods forcing APM to run in a single-threaded manner.
52 // Acquires both the render and capture locks. 50 // Acquires both the render and capture locks.
53 explicit AudioProcessingImpl(const webrtc::Config& config); 51 explicit AudioProcessingImpl(const webrtc::Config& config);
54 // AudioProcessingImpl takes ownership of beamformer. 52 // AudioProcessingImpl takes ownership of beamformer.
55 AudioProcessingImpl(const webrtc::Config& config, 53 AudioProcessingImpl(const webrtc::Config& config,
56 NonlinearBeamformer* beamformer); 54 NonlinearBeamformer* beamformer);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 ApmSubmoduleStates(); 158 ApmSubmoduleStates();
161 // Updates the submodule state and returns true if it has changed. 159 // Updates the submodule state and returns true if it has changed.
162 bool Update(bool low_cut_filter_enabled, 160 bool Update(bool low_cut_filter_enabled,
163 bool echo_canceller_enabled, 161 bool echo_canceller_enabled,
164 bool mobile_echo_controller_enabled, 162 bool mobile_echo_controller_enabled,
165 bool residual_echo_detector_enabled, 163 bool residual_echo_detector_enabled,
166 bool noise_suppressor_enabled, 164 bool noise_suppressor_enabled,
167 bool intelligibility_enhancer_enabled, 165 bool intelligibility_enhancer_enabled,
168 bool beamformer_enabled, 166 bool beamformer_enabled,
169 bool adaptive_gain_controller_enabled, 167 bool adaptive_gain_controller_enabled,
168 bool gain_controller2_enabled,
170 bool level_controller_enabled, 169 bool level_controller_enabled,
171 bool echo_canceller3_enabled, 170 bool echo_canceller3_enabled,
172 bool voice_activity_detector_enabled, 171 bool voice_activity_detector_enabled,
173 bool level_estimator_enabled, 172 bool level_estimator_enabled,
174 bool transient_suppressor_enabled); 173 bool transient_suppressor_enabled);
175 bool CaptureMultiBandSubModulesActive() const; 174 bool CaptureMultiBandSubModulesActive() const;
176 bool CaptureMultiBandProcessingActive() const; 175 bool CaptureMultiBandProcessingActive() const;
177 bool RenderMultiBandSubModulesActive() const; 176 bool RenderMultiBandSubModulesActive() const;
178 bool RenderMultiBandProcessingActive() const; 177 bool RenderMultiBandProcessingActive() const;
179 178
180 private: 179 private:
181 bool low_cut_filter_enabled_ = false; 180 bool low_cut_filter_enabled_ = false;
182 bool echo_canceller_enabled_ = false; 181 bool echo_canceller_enabled_ = false;
183 bool mobile_echo_controller_enabled_ = false; 182 bool mobile_echo_controller_enabled_ = false;
184 bool residual_echo_detector_enabled_ = false; 183 bool residual_echo_detector_enabled_ = false;
185 bool noise_suppressor_enabled_ = false; 184 bool noise_suppressor_enabled_ = false;
186 bool intelligibility_enhancer_enabled_ = false; 185 bool intelligibility_enhancer_enabled_ = false;
187 bool beamformer_enabled_ = false; 186 bool beamformer_enabled_ = false;
188 bool adaptive_gain_controller_enabled_ = false; 187 bool adaptive_gain_controller_enabled_ = false;
188 bool gain_controller2_enabled_ = false;
189 bool level_controller_enabled_ = false; 189 bool level_controller_enabled_ = false;
190 bool echo_canceller3_enabled_ = false; 190 bool echo_canceller3_enabled_ = false;
191 bool level_estimator_enabled_ = false; 191 bool level_estimator_enabled_ = false;
192 bool voice_activity_detector_enabled_ = false; 192 bool voice_activity_detector_enabled_ = false;
193 bool transient_suppressor_enabled_ = false; 193 bool transient_suppressor_enabled_ = false;
194 bool first_update_ = true; 194 bool first_update_ = true;
195 }; 195 };
196 196
197 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP 197 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
198 // State for the debug dump. 198 // State for the debug dump.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 247 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
248 void InitializeIntelligibility() 248 void InitializeIntelligibility()
249 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 249 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
250 int InitializeLocked(const ProcessingConfig& config) 250 int InitializeLocked(const ProcessingConfig& config)
251 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 251 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
252 void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 252 void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
253 void InitializeResidualEchoDetector() 253 void InitializeResidualEchoDetector()
254 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 254 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
255 void InitializeLowCutFilter() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 255 void InitializeLowCutFilter() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
256 void InitializeEchoCanceller3() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 256 void InitializeEchoCanceller3() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
257 void InitializeGainController2();
257 258
258 void EmptyQueuedRenderAudio(); 259 void EmptyQueuedRenderAudio();
259 void AllocateRenderQueue() 260 void AllocateRenderQueue()
260 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 261 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
261 void QueueBandedRenderAudio(AudioBuffer* audio) 262 void QueueBandedRenderAudio(AudioBuffer* audio)
262 EXCLUSIVE_LOCKS_REQUIRED(crit_render_); 263 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
263 void QueueNonbandedRenderAudio(AudioBuffer* audio) 264 void QueueNonbandedRenderAudio(AudioBuffer* audio)
264 EXCLUSIVE_LOCKS_REQUIRED(crit_render_); 265 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
265 266
266 // Capture-side exclusive methods possibly running APM in a multi-threaded 267 // Capture-side exclusive methods possibly running APM in a multi-threaded
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 // Only the rate and samples fields of capture_processing_format_ are used 384 // Only the rate and samples fields of capture_processing_format_ are used
384 // because the forward processing number of channels is mutable and is 385 // because the forward processing number of channels is mutable and is
385 // tracked by the capture_audio_. 386 // tracked by the capture_audio_.
386 StreamConfig capture_processing_format; 387 StreamConfig capture_processing_format;
387 int split_rate; 388 int split_rate;
388 int stream_delay_ms; 389 int stream_delay_ms;
389 bool beamformer_enabled; 390 bool beamformer_enabled;
390 bool intelligibility_enabled; 391 bool intelligibility_enabled;
391 bool level_controller_enabled = false; 392 bool level_controller_enabled = false;
392 bool echo_canceller3_enabled = false; 393 bool echo_canceller3_enabled = false;
394 bool gain_controller2_enabled = false;
393 } capture_nonlocked_; 395 } capture_nonlocked_;
394 396
395 struct ApmRenderState { 397 struct ApmRenderState {
396 ApmRenderState(); 398 ApmRenderState();
397 ~ApmRenderState(); 399 ~ApmRenderState();
398 std::unique_ptr<AudioConverter> render_converter; 400 std::unique_ptr<AudioConverter> render_converter;
399 std::unique_ptr<AudioBuffer> render_audio; 401 std::unique_ptr<AudioBuffer> render_audio;
400 } render_ GUARDED_BY(crit_render_); 402 } render_ GUARDED_BY(crit_render_);
401 403
402 size_t aec_render_queue_element_max_size_ GUARDED_BY(crit_render_) 404 size_t aec_render_queue_element_max_size_ GUARDED_BY(crit_render_)
(...skipping 29 matching lines...) Expand all
432 std::unique_ptr< 434 std::unique_ptr<
433 SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>> 435 SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>>
434 agc_render_signal_queue_; 436 agc_render_signal_queue_;
435 std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>> 437 std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>>
436 red_render_signal_queue_; 438 red_render_signal_queue_;
437 }; 439 };
438 440
439 } // namespace webrtc 441 } // namespace webrtc
440 442
441 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ 443 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698