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

Side by Side Diff: webrtc/modules/audio_processing/aecm/echo_control_mobile.c

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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 if (WebRtcAecm_set_config(aecm, aecConfig) == -1) 192 if (WebRtcAecm_set_config(aecm, aecConfig) == -1)
193 { 193 {
194 aecm->lastError = AECM_UNSPECIFIED_ERROR; 194 aecm->lastError = AECM_UNSPECIFIED_ERROR;
195 return -1; 195 return -1;
196 } 196 }
197 197
198 return 0; 198 return 0;
199 } 199 }
200 200
201 int32_t WebRtcAecm_BufferFarend(void *aecmInst, const int16_t *farend, 201 int32_t WebRtcAecm_BufferFarend(void *aecmInst, const int16_t *farend,
202 int16_t nrOfSamples) 202 size_t nrOfSamples)
203 { 203 {
204 AecMobile* aecm = aecmInst; 204 AecMobile* aecm = aecmInst;
205 int32_t retVal = 0; 205 int32_t retVal = 0;
206 206
207 if (aecm == NULL) 207 if (aecm == NULL)
208 { 208 {
209 return -1; 209 return -1;
210 } 210 }
211 211
212 if (farend == NULL) 212 if (farend == NULL)
(...skipping 13 matching lines...) Expand all
226 aecm->lastError = AECM_BAD_PARAMETER_ERROR; 226 aecm->lastError = AECM_BAD_PARAMETER_ERROR;
227 return -1; 227 return -1;
228 } 228 }
229 229
230 // TODO: Is this really a good idea? 230 // TODO: Is this really a good idea?
231 if (!aecm->ECstartup) 231 if (!aecm->ECstartup)
232 { 232 {
233 WebRtcAecm_DelayComp(aecm); 233 WebRtcAecm_DelayComp(aecm);
234 } 234 }
235 235
236 WebRtc_WriteBuffer(aecm->farendBuf, farend, (size_t) nrOfSamples); 236 WebRtc_WriteBuffer(aecm->farendBuf, farend, nrOfSamples);
237 237
238 return retVal; 238 return retVal;
239 } 239 }
240 240
241 int32_t WebRtcAecm_Process(void *aecmInst, const int16_t *nearendNoisy, 241 int32_t WebRtcAecm_Process(void *aecmInst, const int16_t *nearendNoisy,
242 const int16_t *nearendClean, int16_t *out, 242 const int16_t *nearendClean, int16_t *out,
243 int16_t nrOfSamples, int16_t msInSndCardBuf) 243 size_t nrOfSamples, int16_t msInSndCardBuf)
244 { 244 {
245 AecMobile* aecm = aecmInst; 245 AecMobile* aecm = aecmInst;
246 int32_t retVal = 0; 246 int32_t retVal = 0;
247 short i; 247 size_t i;
248 short nmbrOfFilledBuffers; 248 short nmbrOfFilledBuffers;
249 short nBlocks10ms; 249 size_t nBlocks10ms;
250 short nFrames; 250 size_t nFrames;
251 #ifdef AEC_DEBUG 251 #ifdef AEC_DEBUG
252 short msInAECBuf; 252 short msInAECBuf;
253 #endif 253 #endif
254 254
255 if (aecm == NULL) 255 if (aecm == NULL)
256 { 256 {
257 return -1; 257 return -1;
258 } 258 }
259 259
260 if (nearendNoisy == NULL) 260 if (nearendNoisy == NULL)
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 nSampAdd = (int)(WEBRTC_SPL_MAX(((nSampSndCard >> 1) - nSampFar), 693 nSampAdd = (int)(WEBRTC_SPL_MAX(((nSampSndCard >> 1) - nSampFar),
694 FRAME_LEN)); 694 FRAME_LEN));
695 nSampAdd = WEBRTC_SPL_MIN(nSampAdd, maxStuffSamp); 695 nSampAdd = WEBRTC_SPL_MIN(nSampAdd, maxStuffSamp);
696 696
697 WebRtc_MoveReadPtr(aecm->farendBuf, -nSampAdd); 697 WebRtc_MoveReadPtr(aecm->farendBuf, -nSampAdd);
698 aecm->delayChange = 1; // the delay needs to be updated 698 aecm->delayChange = 1; // the delay needs to be updated
699 } 699 }
700 700
701 return 0; 701 return 0;
702 } 702 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698