Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: webrtc/modules/audio_processing/ns/ns_core.h

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 float maxSpecDiff; 44 float maxSpecDiff;
45 float minSpecDiff; 45 float minSpecDiff;
46 // Criteria of weight of histogram peak to accept/reject feature. 46 // Criteria of weight of histogram peak to accept/reject feature.
47 int thresWeightSpecFlat; 47 int thresWeightSpecFlat;
48 int thresWeightSpecDiff; 48 int thresWeightSpecDiff;
49 49
50 } NSParaExtract; 50 } NSParaExtract;
51 51
52 typedef struct NoiseSuppressionC_ { 52 typedef struct NoiseSuppressionC_ {
53 uint32_t fs; 53 uint32_t fs;
54 int blockLen; 54 size_t blockLen;
55 int windShift; 55 size_t windShift;
56 int anaLen; 56 size_t anaLen;
57 int magnLen; 57 size_t magnLen;
58 int aggrMode; 58 int aggrMode;
59 const float* window; 59 const float* window;
60 float analyzeBuf[ANAL_BLOCKL_MAX]; 60 float analyzeBuf[ANAL_BLOCKL_MAX];
61 float dataBuf[ANAL_BLOCKL_MAX]; 61 float dataBuf[ANAL_BLOCKL_MAX];
62 float syntBuf[ANAL_BLOCKL_MAX]; 62 float syntBuf[ANAL_BLOCKL_MAX];
63 63
64 int initFlag; 64 int initFlag;
65 // Parameters for quantile noise estimation. 65 // Parameters for quantile noise estimation.
66 float density[SIMULT * HALF_ANAL_BLOCKL]; 66 float density[SIMULT * HALF_ANAL_BLOCKL];
67 float lquantile[SIMULT * HALF_ANAL_BLOCKL]; 67 float lquantile[SIMULT * HALF_ANAL_BLOCKL];
68 float quantile[HALF_ANAL_BLOCKL]; 68 float quantile[HALF_ANAL_BLOCKL];
69 int counter[SIMULT]; 69 int counter[SIMULT];
70 int updates; 70 int updates;
71 // Parameters for Wiener filter. 71 // Parameters for Wiener filter.
72 float smooth[HALF_ANAL_BLOCKL]; 72 float smooth[HALF_ANAL_BLOCKL];
73 float overdrive; 73 float overdrive;
74 float denoiseBound; 74 float denoiseBound;
75 int gainmap; 75 int gainmap;
76 // FFT work arrays. 76 // FFT work arrays.
77 int ip[IP_LENGTH]; 77 size_t ip[IP_LENGTH];
78 float wfft[W_LENGTH]; 78 float wfft[W_LENGTH];
79 79
80 // Parameters for new method: some not needed, will reduce/cleanup later. 80 // Parameters for new method: some not needed, will reduce/cleanup later.
81 int32_t blockInd; // Frame index counter. 81 int32_t blockInd; // Frame index counter.
82 int modelUpdatePars[4]; // Parameters for updating or estimating. 82 int modelUpdatePars[4]; // Parameters for updating or estimating.
83 // Thresholds/weights for prior model. 83 // Thresholds/weights for prior model.
84 float priorModelPars[7]; // Parameters for prior model. 84 float priorModelPars[7]; // Parameters for prior model.
85 float noise[HALF_ANAL_BLOCKL]; // Noise spectrum from current frame. 85 float noise[HALF_ANAL_BLOCKL]; // Noise spectrum from current frame.
86 float noisePrev[HALF_ANAL_BLOCKL]; // Noise spectrum from previous frame. 86 float noisePrev[HALF_ANAL_BLOCKL]; // Noise spectrum from previous frame.
87 // Magnitude spectrum of previous analyze frame. 87 // Magnitude spectrum of previous analyze frame.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 * - self : Instance that should be initialized 174 * - self : Instance that should be initialized
175 * - inFrame : Input speech frame for each band 175 * - inFrame : Input speech frame for each band
176 * - num_bands : Number of bands 176 * - num_bands : Number of bands
177 * 177 *
178 * Output: 178 * Output:
179 * - self : Updated instance 179 * - self : Updated instance
180 * - outFrame : Output speech frame for each band 180 * - outFrame : Output speech frame for each band
181 */ 181 */
182 void WebRtcNs_ProcessCore(NoiseSuppressionC* self, 182 void WebRtcNs_ProcessCore(NoiseSuppressionC* self,
183 const float* const* inFrame, 183 const float* const* inFrame,
184 int num_bands, 184 size_t num_bands,
185 float* const* outFrame); 185 float* const* outFrame);
186 186
187 #ifdef __cplusplus 187 #ifdef __cplusplus
188 } 188 }
189 #endif 189 #endif
190 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_NS_NS_CORE_H_ 190 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_NS_NS_CORE_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/ns/noise_suppression.c ('k') | webrtc/modules/audio_processing/ns/ns_core.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698