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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Clear all values added. | 65 // Clear all values added. |
66 void Clear(); | 66 void Clear(); |
67 | 67 |
68 size_t count_; | 68 size_t count_; |
69 size_t occurrence_; | 69 size_t occurrence_; |
70 float fraction_; | 70 float fraction_; |
71 | 71 |
72 RTC_DISALLOW_COPY_AND_ASSIGN(DivergentFilterFraction); | 72 RTC_DISALLOW_COPY_AND_ASSIGN(DivergentFilterFraction); |
73 }; | 73 }; |
74 | 74 |
| 75 typedef struct CoherenceState { |
| 76 complex_t sde[PART_LEN1]; // cross-psd of nearend and error |
| 77 complex_t sxd[PART_LEN1]; // cross-psd of farend and nearend |
| 78 float sx[PART_LEN1], sd[PART_LEN1], se[PART_LEN1]; // far, near, error psd |
| 79 } CoherenceState; |
| 80 |
75 struct AecCore { | 81 struct AecCore { |
76 explicit AecCore(int instance_index); | 82 explicit AecCore(int instance_index); |
77 ~AecCore(); | 83 ~AecCore(); |
78 | 84 |
79 std::unique_ptr<ApmDataDumper> data_dumper; | 85 std::unique_ptr<ApmDataDumper> data_dumper; |
80 | 86 |
| 87 CoherenceState coherence_state; |
| 88 |
81 int farBufWritePos, farBufReadPos; | 89 int farBufWritePos, farBufReadPos; |
82 | 90 |
83 int knownDelay; | 91 int knownDelay; |
84 int inSamples, outSamples; | 92 int inSamples, outSamples; |
85 int delayEstCtr; | 93 int delayEstCtr; |
86 | 94 |
87 RingBuffer* nearFrBuf; | 95 RingBuffer* nearFrBuf; |
88 RingBuffer* outFrBuf; | 96 RingBuffer* outFrBuf; |
89 | 97 |
90 RingBuffer* nearFrBufH[NUM_HIGH_BANDS_MAX]; | 98 RingBuffer* nearFrBufH[NUM_HIGH_BANDS_MAX]; |
91 RingBuffer* outFrBufH[NUM_HIGH_BANDS_MAX]; | 99 RingBuffer* outFrBufH[NUM_HIGH_BANDS_MAX]; |
92 | 100 |
93 float dBuf[PART_LEN2]; // nearend | 101 float dBuf[PART_LEN2]; // nearend |
94 float eBuf[PART_LEN2]; // error | 102 float eBuf[PART_LEN2]; // error |
95 | 103 |
96 float dBufH[NUM_HIGH_BANDS_MAX][PART_LEN2]; // nearend | 104 float dBufH[NUM_HIGH_BANDS_MAX][PART_LEN2]; // nearend |
97 | 105 |
98 float xPow[PART_LEN1]; | 106 float xPow[PART_LEN1]; |
99 float dPow[PART_LEN1]; | 107 float dPow[PART_LEN1]; |
100 float dMinPow[PART_LEN1]; | 108 float dMinPow[PART_LEN1]; |
101 float dInitMinPow[PART_LEN1]; | 109 float dInitMinPow[PART_LEN1]; |
102 float* noisePow; | 110 float* noisePow; |
103 | 111 |
104 float xfBuf[2][kExtendedNumPartitions * PART_LEN1]; // farend fft buffer | 112 float xfBuf[2][kExtendedNumPartitions * PART_LEN1]; // farend fft buffer |
105 float wfBuf[2][kExtendedNumPartitions * PART_LEN1]; // filter fft | 113 float wfBuf[2][kExtendedNumPartitions * PART_LEN1]; // filter fft |
106 complex_t sde[PART_LEN1]; // cross-psd of nearend and error | |
107 complex_t sxd[PART_LEN1]; // cross-psd of farend and nearend | |
108 // Farend windowed fft buffer. | 114 // Farend windowed fft buffer. |
109 complex_t xfwBuf[kExtendedNumPartitions * PART_LEN1]; | 115 complex_t xfwBuf[kExtendedNumPartitions * PART_LEN1]; |
110 | 116 |
111 float sx[PART_LEN1], sd[PART_LEN1], se[PART_LEN1]; // far, near, error psd | |
112 float hNs[PART_LEN1]; | 117 float hNs[PART_LEN1]; |
113 float hNlFbMin, hNlFbLocalMin; | 118 float hNlFbMin, hNlFbLocalMin; |
114 float hNlXdAvgMin; | 119 float hNlXdAvgMin; |
115 int hNlNewMin, hNlMinCtr; | 120 int hNlNewMin, hNlMinCtr; |
116 float overDrive; | 121 float overDrive; |
117 float overdrive_scaling; | 122 float overdrive_scaling; |
118 int nlp_mode; | 123 int nlp_mode; |
119 float outBuf[PART_LEN]; | 124 float outBuf[PART_LEN]; |
120 int delayIdx; | 125 int delayIdx; |
121 | 126 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 float efw[2][PART_LEN1]); | 221 float efw[2][PART_LEN1]); |
217 extern WebRtcAecOverdriveAndSuppress WebRtcAec_OverdriveAndSuppress; | 222 extern WebRtcAecOverdriveAndSuppress WebRtcAec_OverdriveAndSuppress; |
218 | 223 |
219 typedef void (*WebRtcAecComfortNoise)(AecCore* aec, | 224 typedef void (*WebRtcAecComfortNoise)(AecCore* aec, |
220 float efw[2][PART_LEN1], | 225 float efw[2][PART_LEN1], |
221 float comfortNoiseHband[2][PART_LEN1], | 226 float comfortNoiseHband[2][PART_LEN1], |
222 const float* noisePow, | 227 const float* noisePow, |
223 const float* lambda); | 228 const float* lambda); |
224 extern WebRtcAecComfortNoise WebRtcAec_ComfortNoise; | 229 extern WebRtcAecComfortNoise WebRtcAec_ComfortNoise; |
225 | 230 |
226 typedef void (*WebRtcAecSubBandCoherence)(AecCore* aec, | 231 typedef void (*WebRtcAecSubBandCoherence)(int mult, |
| 232 bool extended_filter_enabled, |
227 float efw[2][PART_LEN1], | 233 float efw[2][PART_LEN1], |
228 float dfw[2][PART_LEN1], | 234 float dfw[2][PART_LEN1], |
229 float xfw[2][PART_LEN1], | 235 float xfw[2][PART_LEN1], |
230 float* fft, | 236 float* fft, |
231 float* cohde, | 237 float* cohde, |
232 float* cohxd, | 238 float* cohxd, |
| 239 CoherenceState* coherence_state, |
| 240 short* filter_divergence_state, |
233 int* extreme_filter_divergence); | 241 int* extreme_filter_divergence); |
234 extern WebRtcAecSubBandCoherence WebRtcAec_SubbandCoherence; | 242 extern WebRtcAecSubBandCoherence WebRtcAec_SubbandCoherence; |
235 | 243 |
236 typedef int (*WebRtcAecPartitionDelay)(const AecCore* aec); | 244 typedef int (*WebRtcAecPartitionDelay)(const AecCore* aec); |
237 extern WebRtcAecPartitionDelay WebRtcAec_PartitionDelay; | 245 extern WebRtcAecPartitionDelay WebRtcAec_PartitionDelay; |
238 | 246 |
239 typedef void (*WebRtcAecStoreAsComplex)(const float* data, | 247 typedef void (*WebRtcAecStoreAsComplex)(const float* data, |
240 float data_complex[2][PART_LEN1]); | 248 float data_complex[2][PART_LEN1]); |
241 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; | 249 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; |
242 | 250 |
243 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); | 251 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); |
244 extern WebRtcAecWindowData WebRtcAec_WindowData; | 252 extern WebRtcAecWindowData WebRtcAec_WindowData; |
245 | 253 |
246 } // namespace webrtc | 254 } // namespace webrtc |
247 | 255 |
248 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ | 256 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ |
OLD | NEW |