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

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

Issue 1773173002: Dont always downsample to 16kHz in the reverse stream in APM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@aecm
Patch Set: Created 4 years, 9 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 void InitializeVoiceDetection() 197 void InitializeVoiceDetection()
198 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 198 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
199 void InitializeEchoCanceller() 199 void InitializeEchoCanceller()
200 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 200 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
201 int InitializeLocked(const ProcessingConfig& config) 201 int InitializeLocked(const ProcessingConfig& config)
202 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); 202 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
203 203
204 // Capture-side exclusive methods possibly running APM in a multi-threaded 204 // Capture-side exclusive methods possibly running APM in a multi-threaded
205 // manner that are called with the render lock already acquired. 205 // manner that are called with the render lock already acquired.
206 int ProcessStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 206 int ProcessStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
207 bool output_copy_needed(bool is_data_processed) const 207 bool output_copy_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
208 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
209 bool is_data_processed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 208 bool is_data_processed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
210 bool synthesis_needed(bool is_data_processed) const 209 bool synthesis_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
211 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 210 bool analysis_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
212 bool analysis_needed(bool is_data_processed) const
213 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
214 void MaybeUpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 211 void MaybeUpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
215 212
216 // Render-side exclusive methods possibly running APM in a multi-threaded 213 // Render-side exclusive methods possibly running APM in a multi-threaded
217 // manner that are called with the render lock already acquired. 214 // manner that are called with the render lock already acquired.
218 // TODO(ekm): Remove once all clients updated to new interface. 215 // TODO(ekm): Remove once all clients updated to new interface.
219 int AnalyzeReverseStreamLocked(const float* const* src, 216 int AnalyzeReverseStreamLocked(const float* const* src,
220 const StreamConfig& input_config, 217 const StreamConfig& input_config,
221 const StreamConfig& output_config) 218 const StreamConfig& output_config)
222 EXCLUSIVE_LOCKS_REQUIRED(crit_render_); 219 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
223 bool is_rev_processed() const EXCLUSIVE_LOCKS_REQUIRED(crit_render_); 220 bool is_rev_processed() const EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
221 bool rev_synthesis_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
222 bool rev_analysis_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
224 int ProcessReverseStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_render_); 223 int ProcessReverseStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
225 224
226 // Debug dump methods that are internal and called without locks. 225 // Debug dump methods that are internal and called without locks.
227 // TODO(peah): Make thread safe. 226 // TODO(peah): Make thread safe.
228 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP 227 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
229 // TODO(andrew): make this more graceful. Ideally we would split this stuff 228 // TODO(andrew): make this more graceful. Ideally we would split this stuff
230 // out into a separate class with an "enabled" and "disabled" implementation. 229 // out into a separate class with an "enabled" and "disabled" implementation.
231 static int WriteMessageToDebugFile(FileWrapper* debug_file, 230 static int WriteMessageToDebugFile(FileWrapper* debug_file,
232 int64_t* filesize_limit_bytes, 231 int64_t* filesize_limit_bytes,
233 rtc::CriticalSection* crit_debug, 232 rtc::CriticalSection* crit_debug,
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 339
341 struct ApmRenderState { 340 struct ApmRenderState {
342 std::unique_ptr<AudioConverter> render_converter; 341 std::unique_ptr<AudioConverter> render_converter;
343 std::unique_ptr<AudioBuffer> render_audio; 342 std::unique_ptr<AudioBuffer> render_audio;
344 } render_ GUARDED_BY(crit_render_); 343 } render_ GUARDED_BY(crit_render_);
345 }; 344 };
346 345
347 } // namespace webrtc 346 } // namespace webrtc
348 347
349 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ 348 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698