| 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 14 matching lines...) Expand all Loading... |
| 25 static const int kNormalNumPartitions = 12; | 25 static const int kNormalNumPartitions = 12; |
| 26 | 26 |
| 27 // Delay estimator constants, used for logging and delay compensation if | 27 // Delay estimator constants, used for logging and delay compensation if |
| 28 // if reported delays are disabled. | 28 // if reported delays are disabled. |
| 29 enum { kLookaheadBlocks = 15 }; | 29 enum { kLookaheadBlocks = 15 }; |
| 30 enum { | 30 enum { |
| 31 // 500 ms for 16 kHz which is equivalent with the limit of reported delays. | 31 // 500 ms for 16 kHz which is equivalent with the limit of reported delays. |
| 32 kHistorySizeBlocks = 125 | 32 kHistorySizeBlocks = 125 |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 // Extended filter adaptation parameters. | |
| 36 // TODO(ajm): No narrowband tuning yet. | |
| 37 static const float kExtendedMu = 0.4f; | |
| 38 static const float kExtendedErrorThreshold = 1.0e-6f; | |
| 39 | |
| 40 typedef struct PowerLevel { | 35 typedef struct PowerLevel { |
| 41 float sfrsum; | 36 float sfrsum; |
| 42 int sfrcounter; | 37 int sfrcounter; |
| 43 float framelevel; | 38 float framelevel; |
| 44 float frsum; | 39 float frsum; |
| 45 int frcounter; | 40 int frcounter; |
| 46 float minlevel; | 41 float minlevel; |
| 47 float averagelevel; | 42 float averagelevel; |
| 48 } PowerLevel; | 43 } PowerLevel; |
| 49 | 44 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 short stNearState, echoState; | 86 short stNearState, echoState; |
| 92 short divergeState; | 87 short divergeState; |
| 93 | 88 |
| 94 int xfBufBlockPos; | 89 int xfBufBlockPos; |
| 95 | 90 |
| 96 RingBuffer* far_time_buf; | 91 RingBuffer* far_time_buf; |
| 97 | 92 |
| 98 int system_delay; // Current system delay buffered in AEC. | 93 int system_delay; // Current system delay buffered in AEC. |
| 99 | 94 |
| 100 int mult; // sampling frequency multiple | 95 int mult; // sampling frequency multiple |
| 101 int sampFreq; | 96 int sampFreq = 16000; |
| 102 size_t num_bands; | 97 size_t num_bands; |
| 103 uint32_t seed; | 98 uint32_t seed; |
| 104 | 99 |
| 105 float normal_mu; // stepsize | 100 float filter_step_size; // stepsize |
| 106 float normal_error_threshold; // error threshold | 101 float error_threshold; // error threshold |
| 107 | 102 |
| 108 int noiseEstCtr; | 103 int noiseEstCtr; |
| 109 | 104 |
| 110 PowerLevel farlevel; | 105 PowerLevel farlevel; |
| 111 PowerLevel nearlevel; | 106 PowerLevel nearlevel; |
| 112 PowerLevel linoutlevel; | 107 PowerLevel linoutlevel; |
| 113 PowerLevel nlpoutlevel; | 108 PowerLevel nlpoutlevel; |
| 114 | 109 |
| 115 int metricsMode; | 110 int metricsMode; |
| 116 int stateCounter; | 111 int stateCounter; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 142 float delay_quality_threshold; | 137 float delay_quality_threshold; |
| 143 int frame_count; | 138 int frame_count; |
| 144 | 139 |
| 145 // 0 = delay agnostic mode (signal based delay correction) disabled. | 140 // 0 = delay agnostic mode (signal based delay correction) disabled. |
| 146 // Otherwise enabled. | 141 // Otherwise enabled. |
| 147 int delay_agnostic_enabled; | 142 int delay_agnostic_enabled; |
| 148 // 1 = extended filter mode enabled, 0 = disabled. | 143 // 1 = extended filter mode enabled, 0 = disabled. |
| 149 int extended_filter_enabled; | 144 int extended_filter_enabled; |
| 150 // 1 = next generation aec mode enabled, 0 = disabled. | 145 // 1 = next generation aec mode enabled, 0 = disabled. |
| 151 int next_generation_aec_enabled; | 146 int next_generation_aec_enabled; |
| 147 int refined_adaptive_filter_enabled; |
| 152 | 148 |
| 153 // Runtime selection of number of filter partitions. | 149 // Runtime selection of number of filter partitions. |
| 154 int num_partitions; | 150 int num_partitions; |
| 155 | 151 |
| 156 // Flag that extreme filter divergence has been detected by the Echo | 152 // Flag that extreme filter divergence has been detected by the Echo |
| 157 // Suppressor. | 153 // Suppressor. |
| 158 int extreme_filter_divergence; | 154 int extreme_filter_divergence; |
| 159 | 155 |
| 160 #ifdef WEBRTC_AEC_DEBUG_DUMP | 156 #ifdef WEBRTC_AEC_DEBUG_DUMP |
| 161 // Sequence number of this AEC instance, so that different instances can | 157 // Sequence number of this AEC instance, so that different instances can |
| (...skipping 12 matching lines...) Expand all Loading... |
| 174 #endif | 170 #endif |
| 175 }; | 171 }; |
| 176 | 172 |
| 177 typedef void (*WebRtcAecFilterFar)( | 173 typedef void (*WebRtcAecFilterFar)( |
| 178 int num_partitions, | 174 int num_partitions, |
| 179 int x_fft_buf_block_pos, | 175 int x_fft_buf_block_pos, |
| 180 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 176 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
| 181 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 177 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
| 182 float y_fft[2][PART_LEN1]); | 178 float y_fft[2][PART_LEN1]); |
| 183 extern WebRtcAecFilterFar WebRtcAec_FilterFar; | 179 extern WebRtcAecFilterFar WebRtcAec_FilterFar; |
| 184 typedef void (*WebRtcAecScaleErrorSignal)(int extended_filter_enabled, | 180 typedef void (*WebRtcAecScaleErrorSignal)(float mu, |
| 185 float normal_mu, | 181 float error_threshold, |
| 186 float normal_error_threshold, | |
| 187 float x_pow[PART_LEN1], | 182 float x_pow[PART_LEN1], |
| 188 float ef[2][PART_LEN1]); | 183 float ef[2][PART_LEN1]); |
| 189 extern WebRtcAecScaleErrorSignal WebRtcAec_ScaleErrorSignal; | 184 extern WebRtcAecScaleErrorSignal WebRtcAec_ScaleErrorSignal; |
| 190 typedef void (*WebRtcAecFilterAdaptation)( | 185 typedef void (*WebRtcAecFilterAdaptation)( |
| 191 int num_partitions, | 186 int num_partitions, |
| 192 int x_fft_buf_block_pos, | 187 int x_fft_buf_block_pos, |
| 193 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 188 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
| 194 float e_fft[2][PART_LEN1], | 189 float e_fft[2][PART_LEN1], |
| 195 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1]); | 190 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1]); |
| 196 extern WebRtcAecFilterAdaptation WebRtcAec_FilterAdaptation; | 191 extern WebRtcAecFilterAdaptation WebRtcAec_FilterAdaptation; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 221 extern WebRtcAecPartitionDelay WebRtcAec_PartitionDelay; | 216 extern WebRtcAecPartitionDelay WebRtcAec_PartitionDelay; |
| 222 | 217 |
| 223 typedef void (*WebRtcAecStoreAsComplex)(const float* data, | 218 typedef void (*WebRtcAecStoreAsComplex)(const float* data, |
| 224 float data_complex[2][PART_LEN1]); | 219 float data_complex[2][PART_LEN1]); |
| 225 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; | 220 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; |
| 226 | 221 |
| 227 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); | 222 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); |
| 228 extern WebRtcAecWindowData WebRtcAec_WindowData; | 223 extern WebRtcAecWindowData WebRtcAec_WindowData; |
| 229 | 224 |
| 230 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ | 225 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ |
| OLD | NEW |