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

Side by Side Diff: webrtc/modules/audio_processing/aec3/echo_canceller3.h

Issue 2784023002: Major AEC3 render pipeline changes (Closed)
Patch Set: Disabled one more DEATH test that caused issues due to bug on bots Created 3 years, 8 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 public: 64 public:
65 // Normal c-tor to use. 65 // Normal c-tor to use.
66 EchoCanceller3(int sample_rate_hz, bool use_highpass_filter); 66 EchoCanceller3(int sample_rate_hz, bool use_highpass_filter);
67 // Testing c-tor that is used only for testing purposes. 67 // Testing c-tor that is used only for testing purposes.
68 EchoCanceller3(int sample_rate_hz, 68 EchoCanceller3(int sample_rate_hz,
69 bool use_highpass_filter, 69 bool use_highpass_filter,
70 std::unique_ptr<BlockProcessor> block_processor); 70 std::unique_ptr<BlockProcessor> block_processor);
71 ~EchoCanceller3(); 71 ~EchoCanceller3();
72 // Analyzes and stores an internal copy of the split-band domain render 72 // Analyzes and stores an internal copy of the split-band domain render
73 // signal. 73 // signal.
74 bool AnalyzeRender(AudioBuffer* farend); 74 void AnalyzeRender(AudioBuffer* farend);
75 // Analyzes the full-band domain capture signal to detect signal saturation. 75 // Analyzes the full-band domain capture signal to detect signal saturation.
76 void AnalyzeCapture(AudioBuffer* capture); 76 void AnalyzeCapture(AudioBuffer* capture);
77 // Processes the split-band domain capture signal in order to remove any echo 77 // Processes the split-band domain capture signal in order to remove any echo
78 // present in the signal. 78 // present in the signal.
79 void ProcessCapture(AudioBuffer* capture, bool level_change); 79 void ProcessCapture(AudioBuffer* capture, bool level_change);
80 80
81 // Signals whether an external detector has detected echo leakage from the 81 // Signals whether an external detector has detected echo leakage from the
82 // echo canceller. 82 // echo canceller.
83 // Note that in the case echo leakage has been flagged, it should be unflagged 83 // Note that in the case echo leakage has been flagged, it should be unflagged
84 // once it is no longer occurring. 84 // once it is no longer occurring.
85 void UpdateEchoLeakageStatus(bool leakage_detected) { 85 void UpdateEchoLeakageStatus(bool leakage_detected) {
86 RTC_DCHECK_RUNS_SERIALIZED(&capture_race_checker_); 86 RTC_DCHECK_RUNS_SERIALIZED(&capture_race_checker_);
87 block_processor_->UpdateEchoLeakageStatus(leakage_detected); 87 block_processor_->UpdateEchoLeakageStatus(leakage_detected);
88 } 88 }
89 89
90 // Validates a config. 90 // Validates a config.
91 static bool Validate(const AudioProcessing::Config::EchoCanceller3& config); 91 static bool Validate(const AudioProcessing::Config::EchoCanceller3& config);
92 // Dumps a config to a string. 92 // Dumps a config to a string.
93 static std::string ToString( 93 static std::string ToString(
94 const AudioProcessing::Config::EchoCanceller3& config); 94 const AudioProcessing::Config::EchoCanceller3& config);
95 95
96 private: 96 private:
97 class RenderWriter; 97 class RenderWriter;
98 98
99 // Empties the render SwapQueue. A bool is returned that indicates the success 99 // Empties the render SwapQueue.
100 // of the operation. 100 void EmptyRenderQueue();
101 bool EmptyRenderQueue();
102 101
103 rtc::RaceChecker capture_race_checker_; 102 rtc::RaceChecker capture_race_checker_;
104 rtc::RaceChecker render_race_checker_; 103 rtc::RaceChecker render_race_checker_;
105 104
106 // State that is accessed by the AnalyzeRender call. 105 // State that is accessed by the AnalyzeRender call.
107 std::unique_ptr<RenderWriter> render_writer_ GUARDED_BY(render_race_checker_); 106 std::unique_ptr<RenderWriter> render_writer_ GUARDED_BY(render_race_checker_);
108 107
109 // State that may be accessed by the capture thread. 108 // State that may be accessed by the capture thread.
110 static int instance_count_; 109 static int instance_count_;
111 std::unique_ptr<ApmDataDumper> data_dumper_; 110 std::unique_ptr<ApmDataDumper> data_dumper_;
(...skipping 14 matching lines...) Expand all
126 bool saturated_microphone_signal_ GUARDED_BY(capture_race_checker_) = false; 125 bool saturated_microphone_signal_ GUARDED_BY(capture_race_checker_) = false;
127 std::vector<std::vector<float>> block_ GUARDED_BY(capture_race_checker_); 126 std::vector<std::vector<float>> block_ GUARDED_BY(capture_race_checker_);
128 std::vector<rtc::ArrayView<float>> sub_frame_view_ 127 std::vector<rtc::ArrayView<float>> sub_frame_view_
129 GUARDED_BY(capture_race_checker_); 128 GUARDED_BY(capture_race_checker_);
130 129
131 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCanceller3); 130 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCanceller3);
132 }; 131 };
133 } // namespace webrtc 132 } // namespace webrtc
134 133
135 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_ECHO_CANCELLER3_H_ 134 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_ECHO_CANCELLER3_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698