| 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. | |
| 39 // TODO(ajm): No narrowband tuning yet. | |
| 40 static const float kExtendedMu = 0.4f; | |
| 41 static const float kExtendedErrorThreshold = 1.0e-6f; | |
| 42 | |
| 43 typedef struct PowerLevel { | 38 typedef struct PowerLevel { |
| 44 PowerLevel(); | 39 PowerLevel(); |
| 45 | 40 |
| 46 BlockMeanCalculator framelevel; | 41 BlockMeanCalculator framelevel; |
| 47 BlockMeanCalculator averagelevel; | 42 BlockMeanCalculator averagelevel; |
| 48 float minlevel; | 43 float minlevel; |
| 49 } PowerLevel; | 44 } PowerLevel; |
| 50 | 45 |
| 51 class DivergentFilterFraction { | 46 class DivergentFilterFraction { |
| 52 public: | 47 public: |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 short stNearState, echoState; | 114 short stNearState, echoState; |
| 120 short divergeState; | 115 short divergeState; |
| 121 | 116 |
| 122 int xfBufBlockPos; | 117 int xfBufBlockPos; |
| 123 | 118 |
| 124 RingBuffer* far_time_buf; | 119 RingBuffer* far_time_buf; |
| 125 | 120 |
| 126 int system_delay; // Current system delay buffered in AEC. | 121 int system_delay; // Current system delay buffered in AEC. |
| 127 | 122 |
| 128 int mult; // sampling frequency multiple | 123 int mult; // sampling frequency multiple |
| 129 int sampFreq; | 124 int sampFreq = 16000; |
| 130 size_t num_bands; | 125 size_t num_bands; |
| 131 uint32_t seed; | 126 uint32_t seed; |
| 132 | 127 |
| 133 float normal_mu; // stepsize | 128 float filter_step_size; // stepsize |
| 134 float normal_error_threshold; // error threshold | 129 float error_threshold; // error threshold |
| 135 | 130 |
| 136 int noiseEstCtr; | 131 int noiseEstCtr; |
| 137 | 132 |
| 138 PowerLevel farlevel; | 133 PowerLevel farlevel; |
| 139 PowerLevel nearlevel; | 134 PowerLevel nearlevel; |
| 140 PowerLevel linoutlevel; | 135 PowerLevel linoutlevel; |
| 141 PowerLevel nlpoutlevel; | 136 PowerLevel nlpoutlevel; |
| 142 | 137 |
| 143 int metricsMode; | 138 int metricsMode; |
| 144 int stateCounter; | 139 int stateCounter; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 171 float delay_quality_threshold; | 166 float delay_quality_threshold; |
| 172 int frame_count; | 167 int frame_count; |
| 173 | 168 |
| 174 // 0 = delay agnostic mode (signal based delay correction) disabled. | 169 // 0 = delay agnostic mode (signal based delay correction) disabled. |
| 175 // Otherwise enabled. | 170 // Otherwise enabled. |
| 176 int delay_agnostic_enabled; | 171 int delay_agnostic_enabled; |
| 177 // 1 = extended filter mode enabled, 0 = disabled. | 172 // 1 = extended filter mode enabled, 0 = disabled. |
| 178 int extended_filter_enabled; | 173 int extended_filter_enabled; |
| 179 // 1 = next generation aec mode enabled, 0 = disabled. | 174 // 1 = next generation aec mode enabled, 0 = disabled. |
| 180 int aec3_enabled; | 175 int aec3_enabled; |
| 176 bool refined_adaptive_filter_enabled; |
| 181 | 177 |
| 182 // Runtime selection of number of filter partitions. | 178 // Runtime selection of number of filter partitions. |
| 183 int num_partitions; | 179 int num_partitions; |
| 184 | 180 |
| 185 // Flag that extreme filter divergence has been detected by the Echo | 181 // Flag that extreme filter divergence has been detected by the Echo |
| 186 // Suppressor. | 182 // Suppressor. |
| 187 int extreme_filter_divergence; | 183 int extreme_filter_divergence; |
| 188 | 184 |
| 189 #ifdef WEBRTC_AEC_DEBUG_DUMP | 185 #ifdef WEBRTC_AEC_DEBUG_DUMP |
| 190 // Sequence number of this AEC instance, so that different instances can | 186 // Sequence number of this AEC instance, so that different instances can |
| (...skipping 12 matching lines...) Expand all Loading... |
| 203 #endif | 199 #endif |
| 204 }; | 200 }; |
| 205 | 201 |
| 206 typedef void (*WebRtcAecFilterFar)( | 202 typedef void (*WebRtcAecFilterFar)( |
| 207 int num_partitions, | 203 int num_partitions, |
| 208 int x_fft_buf_block_pos, | 204 int x_fft_buf_block_pos, |
| 209 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 205 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
| 210 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 206 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
| 211 float y_fft[2][PART_LEN1]); | 207 float y_fft[2][PART_LEN1]); |
| 212 extern WebRtcAecFilterFar WebRtcAec_FilterFar; | 208 extern WebRtcAecFilterFar WebRtcAec_FilterFar; |
| 213 typedef void (*WebRtcAecScaleErrorSignal)(int extended_filter_enabled, | 209 typedef void (*WebRtcAecScaleErrorSignal)(float mu, |
| 214 float normal_mu, | 210 float error_threshold, |
| 215 float normal_error_threshold, | |
| 216 float x_pow[PART_LEN1], | 211 float x_pow[PART_LEN1], |
| 217 float ef[2][PART_LEN1]); | 212 float ef[2][PART_LEN1]); |
| 218 extern WebRtcAecScaleErrorSignal WebRtcAec_ScaleErrorSignal; | 213 extern WebRtcAecScaleErrorSignal WebRtcAec_ScaleErrorSignal; |
| 219 typedef void (*WebRtcAecFilterAdaptation)( | 214 typedef void (*WebRtcAecFilterAdaptation)( |
| 220 int num_partitions, | 215 int num_partitions, |
| 221 int x_fft_buf_block_pos, | 216 int x_fft_buf_block_pos, |
| 222 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 217 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
| 223 float e_fft[2][PART_LEN1], | 218 float e_fft[2][PART_LEN1], |
| 224 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1]); | 219 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1]); |
| 225 extern WebRtcAecFilterAdaptation WebRtcAec_FilterAdaptation; | 220 extern WebRtcAecFilterAdaptation WebRtcAec_FilterAdaptation; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 252 typedef void (*WebRtcAecStoreAsComplex)(const float* data, | 247 typedef void (*WebRtcAecStoreAsComplex)(const float* data, |
| 253 float data_complex[2][PART_LEN1]); | 248 float data_complex[2][PART_LEN1]); |
| 254 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; | 249 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; |
| 255 | 250 |
| 256 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); | 251 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); |
| 257 extern WebRtcAecWindowData WebRtcAec_WindowData; | 252 extern WebRtcAecWindowData WebRtcAec_WindowData; |
| 258 | 253 |
| 259 } // namespace webrtc | 254 } // namespace webrtc |
| 260 | 255 |
| 261 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ | 256 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ |
| OLD | NEW |