Chromium Code Reviews

Side by Side Diff: webrtc/modules/audio_processing/aec/aec_core_internal.h

Issue 1739993003: Adding fraction of filter divergence in AEC metrics. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: adding a header Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « webrtc/modules/audio_processing/aec/aec_core.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 30 matching lines...)
41 static const float kExtendedErrorThreshold = 1.0e-6f; 41 static const float kExtendedErrorThreshold = 1.0e-6f;
42 42
43 typedef struct PowerLevel { 43 typedef struct PowerLevel {
44 PowerLevel(); 44 PowerLevel();
45 45
46 BlockMeanCalculator framelevel; 46 BlockMeanCalculator framelevel;
47 BlockMeanCalculator averagelevel; 47 BlockMeanCalculator averagelevel;
48 float minlevel; 48 float minlevel;
49 } PowerLevel; 49 } PowerLevel;
50 50
51 class DivergentFilterFraction {
52 public:
53 DivergentFilterFraction();
54
55 // Reset.
56 void Reset();
57
58 void AddObservation(const PowerLevel& nearlevel,
59 const PowerLevel& linoutlevel,
60 const PowerLevel& nlpoutlevel);
61
62 // Return the latest fraction.
63 float GetLatestFraction() const;
64
65 private:
66 // Clear all values added.
67 void Clear();
68
69 size_t count_;
70 size_t occurrence_;
71 float fraction_;
72
73 RTC_DISALLOW_COPY_AND_ASSIGN(DivergentFilterFraction);
74 };
75
51 struct AecCore { 76 struct AecCore {
52 AecCore(); 77 AecCore();
53 78
54 int farBufWritePos, farBufReadPos; 79 int farBufWritePos, farBufReadPos;
55 80
56 int knownDelay; 81 int knownDelay;
57 int inSamples, outSamples; 82 int inSamples, outSamples;
58 int delayEstCtr; 83 int delayEstCtr;
59 84
60 RingBuffer* nearFrBuf; 85 RingBuffer* nearFrBuf;
(...skipping 53 matching lines...)
114 PowerLevel nearlevel; 139 PowerLevel nearlevel;
115 PowerLevel linoutlevel; 140 PowerLevel linoutlevel;
116 PowerLevel nlpoutlevel; 141 PowerLevel nlpoutlevel;
117 142
118 int metricsMode; 143 int metricsMode;
119 int stateCounter; 144 int stateCounter;
120 Stats erl; 145 Stats erl;
121 Stats erle; 146 Stats erle;
122 Stats aNlp; 147 Stats aNlp;
123 Stats rerl; 148 Stats rerl;
149 DivergentFilterFraction divergent_filter_fraction;
124 150
125 // Quantities to control H band scaling for SWB input 151 // Quantities to control H band scaling for SWB input
126 int freq_avg_ic; // initial bin for averaging nlp gain 152 int freq_avg_ic; // initial bin for averaging nlp gain
127 int flag_Hband_cn; // for comfort noise 153 int flag_Hband_cn; // for comfort noise
128 float cn_scale_Hband; // scale for comfort noise in H band 154 float cn_scale_Hband; // scale for comfort noise in H band
129 155
130 int delay_metrics_delivered; 156 int delay_metrics_delivered;
131 int delay_histogram[kHistorySizeBlocks]; 157 int delay_histogram[kHistorySizeBlocks];
132 int num_delay_values; 158 int num_delay_values;
133 int delay_median; 159 int delay_median;
(...skipping 92 matching lines...)
226 typedef void (*WebRtcAecStoreAsComplex)(const float* data, 252 typedef void (*WebRtcAecStoreAsComplex)(const float* data,
227 float data_complex[2][PART_LEN1]); 253 float data_complex[2][PART_LEN1]);
228 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex; 254 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex;
229 255
230 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x); 256 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x);
231 extern WebRtcAecWindowData WebRtcAec_WindowData; 257 extern WebRtcAecWindowData WebRtcAec_WindowData;
232 258
233 } // namespace webrtc 259 } // namespace webrtc
234 260
235 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_ 261 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/aec/aec_core.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine