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

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

Issue 2823903003: Echo canceller 3 improvements for setups with headsets. (Closed)
Patch Set: Changes in response to reviewer comments 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
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/aec3/aec_state.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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 AecState(); 34 AecState();
35 ~AecState(); 35 ~AecState();
36 36
37 // Returns whether the linear filter estimate is usable. 37 // Returns whether the linear filter estimate is usable.
38 bool UsableLinearEstimate() const { return usable_linear_estimate_; } 38 bool UsableLinearEstimate() const { return usable_linear_estimate_; }
39 39
40 // Returns whether there has been echo leakage detected. 40 // Returns whether there has been echo leakage detected.
41 bool EchoLeakageDetected() const { return echo_leakage_detected_; } 41 bool EchoLeakageDetected() const { return echo_leakage_detected_; }
42 42
43 // Returns whether the render signal is currently active. 43 // Returns whether the render signal is currently active.
44 bool ActiveRender() const { return active_render_blocks_ > 200; } 44 // TODO(peah): Deprecate this in an upcoming CL.
45 bool ActiveRender() const { return blocks_with_filter_adaptation_ > 200; }
45 46
46 // Returns the ERLE. 47 // Returns the ERLE.
47 const std::array<float, kFftLengthBy2Plus1>& Erle() const { 48 const std::array<float, kFftLengthBy2Plus1>& Erle() const {
48 return erle_estimator_.Erle(); 49 return erle_estimator_.Erle();
49 } 50 }
50 51
51 // Returns the ERL. 52 // Returns the ERL.
52 const std::array<float, kFftLengthBy2Plus1>& Erl() const { 53 const std::array<float, kFftLengthBy2Plus1>& Erl() const {
53 return erl_estimator_.Erl(); 54 return erl_estimator_.Erl();
54 } 55 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 const std::array<float, kFftLengthBy2Plus1>& Y2, 93 const std::array<float, kFftLengthBy2Plus1>& Y2,
93 rtc::ArrayView<const float> x, 94 rtc::ArrayView<const float> x,
94 bool echo_leakage_detected); 95 bool echo_leakage_detected);
95 96
96 private: 97 private:
97 static int instance_count_; 98 static int instance_count_;
98 std::unique_ptr<ApmDataDumper> data_dumper_; 99 std::unique_ptr<ApmDataDumper> data_dumper_;
99 ErlEstimator erl_estimator_; 100 ErlEstimator erl_estimator_;
100 ErleEstimator erle_estimator_; 101 ErleEstimator erle_estimator_;
101 int echo_path_change_counter_; 102 int echo_path_change_counter_;
102 size_t active_render_blocks_ = 0; 103 size_t blocks_with_filter_adaptation_ = 0;
103 bool usable_linear_estimate_ = false; 104 bool usable_linear_estimate_ = false;
104 bool echo_leakage_detected_ = false; 105 bool echo_leakage_detected_ = false;
105 bool capture_signal_saturation_ = false; 106 bool capture_signal_saturation_ = false;
106 bool echo_saturation_ = false; 107 bool echo_saturation_ = false;
107 bool headset_detected_ = false; 108 bool headset_detected_ = false;
108 float previous_max_sample_ = 0.f; 109 float previous_max_sample_ = 0.f;
109 bool force_zero_gain_ = false; 110 bool force_zero_gain_ = false;
111 bool render_received_ = false;
110 size_t force_zero_gain_counter_ = 0; 112 size_t force_zero_gain_counter_ = 0;
111 rtc::Optional<size_t> filter_delay_; 113 rtc::Optional<size_t> filter_delay_;
112 rtc::Optional<size_t> external_delay_; 114 rtc::Optional<size_t> external_delay_;
113 size_t blocks_since_last_saturation_ = 1000; 115 size_t blocks_since_last_saturation_ = 1000;
114 116
115 RTC_DISALLOW_COPY_AND_ASSIGN(AecState); 117 RTC_DISALLOW_COPY_AND_ASSIGN(AecState);
116 }; 118 };
117 119
118 } // namespace webrtc 120 } // namespace webrtc
119 121
120 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC_STATE_H_ 122 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC_STATE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/aec3/aec_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698