| 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 |
| 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ |
| 13 | 13 |
| 14 extern "C" { | 14 extern "C" { |
| 15 #include "webrtc/common_audio/ring_buffer.h" | 15 #include "webrtc/common_audio/ring_buffer.h" |
| 16 } | 16 } |
| 17 #include "webrtc/common_audio/wav_file.h" | 17 #include "webrtc/common_audio/wav_file.h" |
| 18 #include "webrtc/modules/audio_processing/aec/aec_common.h" | 18 #include "webrtc/modules/audio_processing/aec/aec_common.h" |
| 19 #include "webrtc/modules/audio_processing/aec/aec_core.h" | 19 #include "webrtc/modules/audio_processing/aec/aec_core.h" |
| 20 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" |
| 20 #include "webrtc/modules/audio_processing/utility/block_mean_calculator.h" | 21 #include "webrtc/modules/audio_processing/utility/block_mean_calculator.h" |
| 21 #include "webrtc/typedefs.h" | 22 #include "webrtc/typedefs.h" |
| 22 | 23 |
| 23 namespace webrtc { | 24 namespace webrtc { |
| 24 | 25 |
| 25 // Number of partitions for the extended filter mode. The first one is an enum | 26 // Number of partitions for the extended filter mode. The first one is an enum |
| 26 // to be used in array declarations, as it represents the maximum filter length. | 27 // to be used in array declarations, as it represents the maximum filter length. |
| 27 enum { kExtendedNumPartitions = 32 }; | 28 enum { kExtendedNumPartitions = 32 }; |
| 28 static const int kNormalNumPartitions = 12; | 29 static const int kNormalNumPartitions = 12; |
| 29 | 30 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void Clear(); | 68 void Clear(); |
| 68 | 69 |
| 69 size_t count_; | 70 size_t count_; |
| 70 size_t occurrence_; | 71 size_t occurrence_; |
| 71 float fraction_; | 72 float fraction_; |
| 72 | 73 |
| 73 RTC_DISALLOW_COPY_AND_ASSIGN(DivergentFilterFraction); | 74 RTC_DISALLOW_COPY_AND_ASSIGN(DivergentFilterFraction); |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 struct AecCore { | 77 struct AecCore { |
| 77 AecCore(); | 78 explicit AecCore(int instance_index); |
| 79 |
| 80 ApmDataDumper data_dumper; |
| 78 | 81 |
| 79 int farBufWritePos, farBufReadPos; | 82 int farBufWritePos, farBufReadPos; |
| 80 | 83 |
| 81 int knownDelay; | 84 int knownDelay; |
| 82 int inSamples, outSamples; | 85 int inSamples, outSamples; |
| 83 int delayEstCtr; | 86 int delayEstCtr; |
| 84 | 87 |
| 85 RingBuffer* nearFrBuf; | 88 RingBuffer* nearFrBuf; |
| 86 RingBuffer* outFrBuf; | 89 RingBuffer* outFrBuf; |
| 87 | 90 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 int extended_filter_enabled; | 181 int extended_filter_enabled; |
| 179 // 1 = next generation aec mode enabled, 0 = disabled. | 182 // 1 = next generation aec mode enabled, 0 = disabled. |
| 180 int aec3_enabled; | 183 int aec3_enabled; |
| 181 | 184 |
| 182 // Runtime selection of number of filter partitions. | 185 // Runtime selection of number of filter partitions. |
| 183 int num_partitions; | 186 int num_partitions; |
| 184 | 187 |
| 185 // Flag that extreme filter divergence has been detected by the Echo | 188 // Flag that extreme filter divergence has been detected by the Echo |
| 186 // Suppressor. | 189 // Suppressor. |
| 187 int extreme_filter_divergence; | 190 int extreme_filter_divergence; |
| 188 | |
| 189 #ifdef WEBRTC_AEC_DEBUG_DUMP | |
| 190 // Sequence number of this AEC instance, so that different instances can | |
| 191 // choose different dump file names. | |
| 192 int instance_index; | |
| 193 | |
| 194 // Number of times we've restarted dumping; used to pick new dump file names | |
| 195 // each time. | |
| 196 int debug_dump_count; | |
| 197 | |
| 198 rtc_WavWriter* farFile; | |
| 199 rtc_WavWriter* nearFile; | |
| 200 rtc_WavWriter* outFile; | |
| 201 rtc_WavWriter* outLinearFile; | |
| 202 FILE* e_fft_file; | |
| 203 #endif | |
| 204 }; | 191 }; |
| 205 | 192 |
| 206 typedef void (*WebRtcAecFilterFar)( | 193 typedef void (*WebRtcAecFilterFar)( |
| 207 int num_partitions, | 194 int num_partitions, |
| 208 int x_fft_buf_block_pos, | 195 int x_fft_buf_block_pos, |
| 209 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 196 float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
| 210 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1], | 197 float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1], |
| 211 float y_fft[2][PART_LEN1]); | 198 float y_fft[2][PART_LEN1]); |
| 212 extern WebRtcAecFilterFar WebRtcAec_FilterFar; | 199 extern WebRtcAecFilterFar WebRtcAec_FilterFar; |
| 213 typedef void (*WebRtcAecScaleErrorSignal)(int extended_filter_enabled, | 200 typedef void (*WebRtcAecScaleErrorSignal)(int extended_filter_enabled, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 typedef void (*WebRtcAecStoreAsComplex)(const float* data, | 239 typedef void (*WebRtcAecStoreAsComplex)(const float* data, |
| 253 float data_complex[2][PART_LEN1]); | 240 float data_complex[2][PART_LEN1]); |
| 254 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; | 241 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; |
| 255 | 242 |
| 256 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); | 243 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); |
| 257 extern WebRtcAecWindowData WebRtcAec_WindowData; | 244 extern WebRtcAecWindowData WebRtcAec_WindowData; |
| 258 | 245 |
| 259 } // namespace webrtc | 246 } // namespace webrtc |
| 260 | 247 |
| 261 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ | 248 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ |
| OLD | NEW |