OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 17 matching lines...) Expand all Loading... |
28 static const int kNormalNumPartitions = 12; | 28 static const int kNormalNumPartitions = 12; |
29 | 29 |
30 // Delay estimator constants, used for logging and delay compensation if | 30 // Delay estimator constants, used for logging and delay compensation if |
31 // if reported delays are disabled. | 31 // if reported delays are disabled. |
32 enum { kLookaheadBlocks = 15 }; | 32 enum { kLookaheadBlocks = 15 }; |
33 enum { | 33 enum { |
34 // 500 ms for 16 kHz which is equivalent with the limit of reported delays. | 34 // 500 ms for 16 kHz which is equivalent with the limit of reported delays. |
35 kHistorySizeBlocks = 125 | 35 kHistorySizeBlocks = 125 |
36 }; | 36 }; |
37 | 37 |
38 // Extended filter adaptation parameters. | 38 // Extended filter adaptation parameter. |
39 // TODO(ajm): No narrowband tuning yet. | 39 // TODO(ajm): No narrowband tuning yet. |
40 static const float kExtendedMu = 0.4f; | |
41 static const float kExtendedErrorThreshold = 1.0e-6f; | 40 static const float kExtendedErrorThreshold = 1.0e-6f; |
42 | 41 |
43 typedef struct PowerLevel { | 42 typedef struct PowerLevel { |
44 PowerLevel(); | 43 PowerLevel(); |
45 | 44 |
46 BlockMeanCalculator framelevel; | 45 BlockMeanCalculator framelevel; |
47 BlockMeanCalculator averagelevel; | 46 BlockMeanCalculator averagelevel; |
48 float minlevel; | 47 float minlevel; |
49 } PowerLevel; | 48 } PowerLevel; |
50 | 49 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 122 |
124 RingBuffer* far_time_buf; | 123 RingBuffer* far_time_buf; |
125 | 124 |
126 int system_delay; // Current system delay buffered in AEC. | 125 int system_delay; // Current system delay buffered in AEC. |
127 | 126 |
128 int mult; // sampling frequency multiple | 127 int mult; // sampling frequency multiple |
129 int sampFreq; | 128 int sampFreq; |
130 size_t num_bands; | 129 size_t num_bands; |
131 uint32_t seed; | 130 uint32_t seed; |
132 | 131 |
133 float normal_mu; // stepsize | 132 float filter_step_size; // stepsize |
134 float normal_error_threshold; // error threshold | 133 float normal_error_threshold; // error threshold |
135 | 134 |
136 int noiseEstCtr; | 135 int noiseEstCtr; |
137 | 136 |
138 PowerLevel farlevel; | 137 PowerLevel farlevel; |
139 PowerLevel nearlevel; | 138 PowerLevel nearlevel; |
140 PowerLevel linoutlevel; | 139 PowerLevel linoutlevel; |
141 PowerLevel nlpoutlevel; | 140 PowerLevel nlpoutlevel; |
142 | 141 |
143 int metricsMode; | 142 int metricsMode; |
(...skipping 27 matching lines...) Expand all Loading... |
171 float delay_quality_threshold; | 170 float delay_quality_threshold; |
172 int frame_count; | 171 int frame_count; |
173 | 172 |
174 // 0 = delay agnostic mode (signal based delay correction) disabled. | 173 // 0 = delay agnostic mode (signal based delay correction) disabled. |
175 // Otherwise enabled. | 174 // Otherwise enabled. |
176 int delay_agnostic_enabled; | 175 int delay_agnostic_enabled; |
177 // 1 = extended filter mode enabled, 0 = disabled. | 176 // 1 = extended filter mode enabled, 0 = disabled. |
178 int extended_filter_enabled; | 177 int extended_filter_enabled; |
179 // 1 = next generation aec mode enabled, 0 = disabled. | 178 // 1 = next generation aec mode enabled, 0 = disabled. |
180 int aec3_enabled; | 179 int aec3_enabled; |
| 180 bool refined_adaptive_filter_enabled; |
181 | 181 |
182 // Runtime selection of number of filter partitions. | 182 // Runtime selection of number of filter partitions. |
183 int num_partitions; | 183 int num_partitions; |
184 | 184 |
185 // Flag that extreme filter divergence has been detected by the Echo | 185 // Flag that extreme filter divergence has been detected by the Echo |
186 // Suppressor. | 186 // Suppressor. |
187 int extreme_filter_divergence; | 187 int extreme_filter_divergence; |
188 | 188 |
189 #ifdef WEBRTC_AEC_DEBUG_DUMP | 189 #ifdef WEBRTC_AEC_DEBUG_DUMP |
190 // Sequence number of this AEC instance, so that different instances can | 190 // Sequence number of this AEC instance, so that different instances can |
(...skipping 13 matching lines...) Expand all Loading... |
204 }; | 204 }; |
205 | 205 |
206 typedef void (*WebRtcAecFilterFar)( | 206 typedef void (*WebRtcAecFilterFar)( |
207 int num_partitions, | 207 int num_partitions, |
208 int x_fft_buf_block_pos, | 208 int x_fft_buf_block_pos, |
209 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 209 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
210 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 210 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
211 float y_fft[2][PART_LEN1]); | 211 float y_fft[2][PART_LEN1]); |
212 extern WebRtcAecFilterFar WebRtcAec_FilterFar; | 212 extern WebRtcAecFilterFar WebRtcAec_FilterFar; |
213 typedef void (*WebRtcAecScaleErrorSignal)(int extended_filter_enabled, | 213 typedef void (*WebRtcAecScaleErrorSignal)(int extended_filter_enabled, |
214 float normal_mu, | 214 float mu, |
215 float normal_error_threshold, | 215 float normal_error_threshold, |
216 float x_pow[PART_LEN1], | 216 float x_pow[PART_LEN1], |
217 float ef[2][PART_LEN1]); | 217 float ef[2][PART_LEN1]); |
218 extern WebRtcAecScaleErrorSignal WebRtcAec_ScaleErrorSignal; | 218 extern WebRtcAecScaleErrorSignal WebRtcAec_ScaleErrorSignal; |
219 typedef void (*WebRtcAecFilterAdaptation)( | 219 typedef void (*WebRtcAecFilterAdaptation)( |
220 int num_partitions, | 220 int num_partitions, |
221 int x_fft_buf_block_pos, | 221 int x_fft_buf_block_pos, |
222 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 222 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
223 float e_fft[2][PART_LEN1], | 223 float e_fft[2][PART_LEN1], |
224 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1]); | 224 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1]); |
(...skipping 27 matching lines...) Expand all Loading... |
252 typedef void (*WebRtcAecStoreAsComplex)(const float* data, | 252 typedef void (*WebRtcAecStoreAsComplex)(const float* data, |
253 float data_complex[2][PART_LEN1]); | 253 float data_complex[2][PART_LEN1]); |
254 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; | 254 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; |
255 | 255 |
256 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); | 256 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); |
257 extern WebRtcAecWindowData WebRtcAec_WindowData; | 257 extern WebRtcAecWindowData WebRtcAec_WindowData; |
258 | 258 |
259 } // namespace webrtc | 259 } // namespace webrtc |
260 | 260 |
261 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ | 261 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ |
OLD | NEW |