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

Side by Side Diff: webrtc/modules/audio_processing/aec/echo_cancellation.c

Issue 1404743003: Removed the indirect error message reporting in aec and aecm. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@process_test_no_output_CL
Patch Set: Removed state variable for lastError. Removed function prototypes for unused functions. Added const qualifiers. Created 5 years, 2 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // largest possible drift compensation (kResamplerBufferSize) + "almost" an 139 // largest possible drift compensation (kResamplerBufferSize) + "almost" an
140 // FFT buffer (PART_LEN2 - 1). 140 // FFT buffer (PART_LEN2 - 1).
141 aecpc->far_pre_buf = 141 aecpc->far_pre_buf =
142 WebRtc_CreateBuffer(PART_LEN2 + kResamplerBufferSize, sizeof(float)); 142 WebRtc_CreateBuffer(PART_LEN2 + kResamplerBufferSize, sizeof(float));
143 if (!aecpc->far_pre_buf) { 143 if (!aecpc->far_pre_buf) {
144 WebRtcAec_Free(aecpc); 144 WebRtcAec_Free(aecpc);
145 return NULL; 145 return NULL;
146 } 146 }
147 147
148 aecpc->initFlag = 0; 148 aecpc->initFlag = 0;
149 aecpc->lastError = 0;
150 149
151 #ifdef WEBRTC_AEC_DEBUG_DUMP 150 #ifdef WEBRTC_AEC_DEBUG_DUMP
152 { 151 {
153 char filename[64]; 152 char filename[64];
154 sprintf(filename, "aec_buf%d.dat", webrtc_aec_instance_count); 153 sprintf(filename, "aec_buf%d.dat", webrtc_aec_instance_count);
155 aecpc->bufFile = fopen(filename, "wb"); 154 aecpc->bufFile = fopen(filename, "wb");
156 sprintf(filename, "aec_skew%d.dat", webrtc_aec_instance_count); 155 sprintf(filename, "aec_skew%d.dat", webrtc_aec_instance_count);
157 aecpc->skewFile = fopen(filename, "wb"); 156 aecpc->skewFile = fopen(filename, "wb");
158 sprintf(filename, "aec_delay%d.dat", webrtc_aec_instance_count); 157 sprintf(filename, "aec_delay%d.dat", webrtc_aec_instance_count);
159 aecpc->delayFile = fopen(filename, "wb"); 158 aecpc->delayFile = fopen(filename, "wb");
(...skipping 25 matching lines...) Expand all
185 } 184 }
186 185
187 int32_t WebRtcAec_Init(void* aecInst, int32_t sampFreq, int32_t scSampFreq) { 186 int32_t WebRtcAec_Init(void* aecInst, int32_t sampFreq, int32_t scSampFreq) {
188 Aec* aecpc = aecInst; 187 Aec* aecpc = aecInst;
189 AecConfig aecConfig; 188 AecConfig aecConfig;
190 189
191 if (sampFreq != 8000 && 190 if (sampFreq != 8000 &&
192 sampFreq != 16000 && 191 sampFreq != 16000 &&
193 sampFreq != 32000 && 192 sampFreq != 32000 &&
194 sampFreq != 48000) { 193 sampFreq != 48000) {
195 aecpc->lastError = AEC_BAD_PARAMETER_ERROR; 194 return AEC_BAD_PARAMETER_ERROR;
196 return -1;
197 } 195 }
198 aecpc->sampFreq = sampFreq; 196 aecpc->sampFreq = sampFreq;
199 197
200 if (scSampFreq < 1 || scSampFreq > 96000) { 198 if (scSampFreq < 1 || scSampFreq > 96000) {
201 aecpc->lastError = AEC_BAD_PARAMETER_ERROR; 199 return AEC_BAD_PARAMETER_ERROR;
202 return -1;
203 } 200 }
204 aecpc->scSampFreq = scSampFreq; 201 aecpc->scSampFreq = scSampFreq;
205 202
206 // Initialize echo canceller core 203 // Initialize echo canceller core
207 if (WebRtcAec_InitAec(aecpc->aec, aecpc->sampFreq) == -1) { 204 if (WebRtcAec_InitAec(aecpc->aec, aecpc->sampFreq) == -1) {
208 aecpc->lastError = AEC_UNSPECIFIED_ERROR; 205 return AEC_UNSPECIFIED_ERROR;
209 return -1;
210 } 206 }
211 207
212 if (WebRtcAec_InitResampler(aecpc->resampler, aecpc->scSampFreq) == -1) { 208 if (WebRtcAec_InitResampler(aecpc->resampler, aecpc->scSampFreq) == -1) {
213 aecpc->lastError = AEC_UNSPECIFIED_ERROR; 209 return AEC_UNSPECIFIED_ERROR;
214 return -1;
215 } 210 }
216 211
217 WebRtc_InitBuffer(aecpc->far_pre_buf); 212 WebRtc_InitBuffer(aecpc->far_pre_buf);
218 WebRtc_MoveReadPtr(aecpc->far_pre_buf, -PART_LEN); // Start overlap. 213 WebRtc_MoveReadPtr(aecpc->far_pre_buf, -PART_LEN); // Start overlap.
219 214
220 aecpc->initFlag = initCheck; // indicates that initialization has been done 215 aecpc->initFlag = initCheck; // indicates that initialization has been done
221 216
222 if (aecpc->sampFreq == 32000 || aecpc->sampFreq == 48000) { 217 if (aecpc->sampFreq == 32000 || aecpc->sampFreq == 48000) {
223 aecpc->splitSampFreq = 16000; 218 aecpc->splitSampFreq = 16000;
224 } else { 219 } else {
(...skipping 29 matching lines...) Expand all
254 249
255 aecpc->farend_started = 0; 250 aecpc->farend_started = 0;
256 251
257 // Default settings. 252 // Default settings.
258 aecConfig.nlpMode = kAecNlpModerate; 253 aecConfig.nlpMode = kAecNlpModerate;
259 aecConfig.skewMode = kAecFalse; 254 aecConfig.skewMode = kAecFalse;
260 aecConfig.metricsMode = kAecFalse; 255 aecConfig.metricsMode = kAecFalse;
261 aecConfig.delay_logging = kAecFalse; 256 aecConfig.delay_logging = kAecFalse;
262 257
263 if (WebRtcAec_set_config(aecpc, aecConfig) == -1) { 258 if (WebRtcAec_set_config(aecpc, aecConfig) == -1) {
264 aecpc->lastError = AEC_UNSPECIFIED_ERROR; 259 return AEC_UNSPECIFIED_ERROR;
265 return -1;
266 } 260 }
267 261
268 return 0; 262 return 0;
269 } 263 }
270 264
265 // Returns any error that is caused when buffering the
266 // farend signal.
267 int32_t WebRtcAec_GetBufferFarendError(void* aecInst,
268 const float* farend,
269 size_t nrOfSamples) {
270 Aec* aecpc = aecInst;
271
272 if (farend == NULL)
273 return AEC_NULL_POINTER_ERROR;
274
275 if (aecpc->initFlag != initCheck)
276 return AEC_UNINITIALIZED_ERROR;
277
278 // number of samples == 160 for SWB input
279 if (nrOfSamples != 80 && nrOfSamples != 160)
280 return AEC_BAD_PARAMETER_ERROR;
281
282 return 0;
283 }
284
271 // only buffer L band for farend 285 // only buffer L band for farend
272 int32_t WebRtcAec_BufferFarend(void* aecInst, 286 int32_t WebRtcAec_BufferFarend(void* aecInst,
273 const float* farend, 287 const float* farend,
274 size_t nrOfSamples) { 288 size_t nrOfSamples) {
275 Aec* aecpc = aecInst; 289 Aec* aecpc = aecInst;
276 size_t newNrOfSamples = nrOfSamples; 290 size_t newNrOfSamples = nrOfSamples;
277 float new_farend[MAX_RESAMP_LEN]; 291 float new_farend[MAX_RESAMP_LEN];
278 const float* farend_ptr = farend; 292 const float* farend_ptr = farend;
293 int32_t error_code;
279 294
280 if (farend == NULL) { 295 // Get any error caused by buffering the farend signal.
281 aecpc->lastError = AEC_NULL_POINTER_ERROR; 296 error_code = WebRtcAec_GetBufferFarendError(aecInst, farend, nrOfSamples);
282 return -1;
283 }
284 297
285 if (aecpc->initFlag != initCheck) { 298 if (error_code != 0)
286 aecpc->lastError = AEC_UNINITIALIZED_ERROR; 299 return error_code;
287 return -1;
288 }
289 300
290 // number of samples == 160 for SWB input
291 if (nrOfSamples != 80 && nrOfSamples != 160) {
292 aecpc->lastError = AEC_BAD_PARAMETER_ERROR;
293 return -1;
294 }
295 301
296 if (aecpc->skewMode == kAecTrue && aecpc->resample == kAecTrue) { 302 if (aecpc->skewMode == kAecTrue && aecpc->resample == kAecTrue) {
297 // Resample and get a new number of samples 303 // Resample and get a new number of samples
298 WebRtcAec_ResampleLinear(aecpc->resampler, 304 WebRtcAec_ResampleLinear(aecpc->resampler,
299 farend, 305 farend,
300 nrOfSamples, 306 nrOfSamples,
301 aecpc->skew, 307 aecpc->skew,
302 new_farend, 308 new_farend,
303 &newNrOfSamples); 309 &newNrOfSamples);
304 farend_ptr = new_farend; 310 farend_ptr = new_farend;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 const float* const* nearend, 342 const float* const* nearend,
337 size_t num_bands, 343 size_t num_bands,
338 float* const* out, 344 float* const* out,
339 size_t nrOfSamples, 345 size_t nrOfSamples,
340 int16_t msInSndCardBuf, 346 int16_t msInSndCardBuf,
341 int32_t skew) { 347 int32_t skew) {
342 Aec* aecpc = aecInst; 348 Aec* aecpc = aecInst;
343 int32_t retVal = 0; 349 int32_t retVal = 0;
344 350
345 if (out == NULL) { 351 if (out == NULL) {
346 aecpc->lastError = AEC_NULL_POINTER_ERROR; 352 return AEC_NULL_POINTER_ERROR;
347 return -1;
348 } 353 }
349 354
350 if (aecpc->initFlag != initCheck) { 355 if (aecpc->initFlag != initCheck) {
351 aecpc->lastError = AEC_UNINITIALIZED_ERROR; 356 return AEC_UNINITIALIZED_ERROR;
352 return -1;
353 } 357 }
354 358
355 // number of samples == 160 for SWB input 359 // number of samples == 160 for SWB input
356 if (nrOfSamples != 80 && nrOfSamples != 160) { 360 if (nrOfSamples != 80 && nrOfSamples != 160) {
357 aecpc->lastError = AEC_BAD_PARAMETER_ERROR; 361 return AEC_BAD_PARAMETER_ERROR;
358 return -1;
359 } 362 }
360 363
361 if (msInSndCardBuf < 0) { 364 if (msInSndCardBuf < 0) {
362 msInSndCardBuf = 0; 365 msInSndCardBuf = 0;
363 aecpc->lastError = AEC_BAD_PARAMETER_WARNING; 366 retVal = AEC_BAD_PARAMETER_WARNING;
364 retVal = -1;
365 } else if (msInSndCardBuf > kMaxTrustedDelayMs) { 367 } else if (msInSndCardBuf > kMaxTrustedDelayMs) {
366 // The clamping is now done in ProcessExtended/Normal(). 368 // The clamping is now done in ProcessExtended/Normal().
367 aecpc->lastError = AEC_BAD_PARAMETER_WARNING; 369 retVal = AEC_BAD_PARAMETER_WARNING;
368 retVal = -1;
369 } 370 }
370 371
371 // This returns the value of aec->extended_filter_enabled. 372 // This returns the value of aec->extended_filter_enabled.
372 if (WebRtcAec_extended_filter_enabled(aecpc->aec)) { 373 if (WebRtcAec_extended_filter_enabled(aecpc->aec)) {
373 ProcessExtended(aecpc, 374 ProcessExtended(aecpc,
374 nearend, 375 nearend,
375 num_bands, 376 num_bands,
376 out, 377 out,
377 nrOfSamples, 378 nrOfSamples,
378 msInSndCardBuf, 379 msInSndCardBuf,
379 skew); 380 skew);
380 } else { 381 } else {
381 if (ProcessNormal(aecpc, 382 retVal = ProcessNormal(aecpc,
382 nearend, 383 nearend,
383 num_bands, 384 num_bands,
384 out, 385 out,
385 nrOfSamples, 386 nrOfSamples,
386 msInSndCardBuf, 387 msInSndCardBuf,
387 skew) != 0) { 388 skew);
388 retVal = -1;
389 }
390 } 389 }
391 390
392 #ifdef WEBRTC_AEC_DEBUG_DUMP 391 #ifdef WEBRTC_AEC_DEBUG_DUMP
393 { 392 {
394 int16_t far_buf_size_ms = (int16_t)(WebRtcAec_system_delay(aecpc->aec) / 393 int16_t far_buf_size_ms = (int16_t)(WebRtcAec_system_delay(aecpc->aec) /
395 (sampMsNb * aecpc->rate_factor)); 394 (sampMsNb * aecpc->rate_factor));
396 (void)fwrite(&far_buf_size_ms, 2, 1, aecpc->bufFile); 395 (void)fwrite(&far_buf_size_ms, 2, 1, aecpc->bufFile);
397 (void)fwrite( 396 (void)fwrite(
398 &aecpc->knownDelay, sizeof(aecpc->knownDelay), 1, aecpc->delayFile); 397 &aecpc->knownDelay, sizeof(aecpc->knownDelay), 1, aecpc->delayFile);
399 } 398 }
400 #endif 399 #endif
401 400
402 return retVal; 401 return retVal;
403 } 402 }
404 403
405 int WebRtcAec_set_config(void* handle, AecConfig config) { 404 int WebRtcAec_set_config(void* handle, AecConfig config) {
406 Aec* self = (Aec*)handle; 405 Aec* self = (Aec*)handle;
407 if (self->initFlag != initCheck) { 406 if (self->initFlag != initCheck) {
408 self->lastError = AEC_UNINITIALIZED_ERROR; 407 // Due to the initialization scheme the indirect
Andrew MacDonald 2015/10/16 06:05:09 This looks pretty direct; what do you mean? In an
peah-webrtc 2015/10/16 08:14:39 Done.
peah-webrtc 2015/10/16 08:14:39 Totally correct. Good find! That was a leftover co
409 return -1; 408 // reporting of this error code cannot yet be changed to be
409 // direct.
410 return AEC_UNINITIALIZED_ERROR;
410 } 411 }
411 412
412 if (config.skewMode != kAecFalse && config.skewMode != kAecTrue) { 413 if (config.skewMode != kAecFalse && config.skewMode != kAecTrue) {
413 self->lastError = AEC_BAD_PARAMETER_ERROR; 414 // Due to the initialization scheme the indirect
414 return -1; 415 // reporting of this error code cannot yet be changed to be
416 // direct.
417 return AEC_BAD_PARAMETER_ERROR;
415 } 418 }
416 self->skewMode = config.skewMode; 419 self->skewMode = config.skewMode;
417 420
418 if (config.nlpMode != kAecNlpConservative && 421 if (config.nlpMode != kAecNlpConservative &&
419 config.nlpMode != kAecNlpModerate && 422 config.nlpMode != kAecNlpModerate &&
420 config.nlpMode != kAecNlpAggressive) { 423 config.nlpMode != kAecNlpAggressive) {
421 self->lastError = AEC_BAD_PARAMETER_ERROR; 424 // Due to the initialization scheme the indirect
422 return -1; 425 // reporting of this error code cannot yet be changed to be
426 // direct.
427 return AEC_BAD_PARAMETER_ERROR;
423 } 428 }
424 429
425 if (config.metricsMode != kAecFalse && config.metricsMode != kAecTrue) { 430 if (config.metricsMode != kAecFalse && config.metricsMode != kAecTrue) {
426 self->lastError = AEC_BAD_PARAMETER_ERROR; 431 // Due to the initialization scheme the indirect
427 return -1; 432 // reporting of this error code cannot yet be changed to be
433 // direct.
434 return AEC_BAD_PARAMETER_ERROR;
428 } 435 }
429 436
430 if (config.delay_logging != kAecFalse && config.delay_logging != kAecTrue) { 437 if (config.delay_logging != kAecFalse && config.delay_logging != kAecTrue) {
431 self->lastError = AEC_BAD_PARAMETER_ERROR; 438 // Due to the initialization scheme the indirect
432 return -1; 439 // reporting of this error code cannot yet be changed to be
440 // direct.
441 return AEC_BAD_PARAMETER_ERROR;
433 } 442 }
434 443
435 WebRtcAec_SetConfigCore( 444 WebRtcAec_SetConfigCore(
436 self->aec, config.nlpMode, config.metricsMode, config.delay_logging); 445 self->aec, config.nlpMode, config.metricsMode, config.delay_logging);
437 return 0; 446 return 0;
438 } 447 }
439 448
440 int WebRtcAec_get_echo_status(void* handle, int* status) { 449 int WebRtcAec_get_echo_status(void* handle, int* status) {
441 Aec* self = (Aec*)handle; 450 Aec* self = (Aec*)handle;
442 if (status == NULL) { 451 if (status == NULL) {
443 self->lastError = AEC_NULL_POINTER_ERROR; 452 return AEC_NULL_POINTER_ERROR;
444 return -1;
445 } 453 }
446 if (self->initFlag != initCheck) { 454 if (self->initFlag != initCheck) {
447 self->lastError = AEC_UNINITIALIZED_ERROR; 455 return AEC_UNINITIALIZED_ERROR;
448 return -1;
449 } 456 }
450 457
451 *status = WebRtcAec_echo_state(self->aec); 458 *status = WebRtcAec_echo_state(self->aec);
452 459
453 return 0; 460 return 0;
454 } 461 }
455 462
456 int WebRtcAec_GetMetrics(void* handle, AecMetrics* metrics) { 463 int WebRtcAec_GetMetrics(void* handle, AecMetrics* metrics) {
457 const float kUpWeight = 0.7f; 464 const float kUpWeight = 0.7f;
458 float dtmp; 465 float dtmp;
459 int stmp; 466 int stmp;
460 Aec* self = (Aec*)handle; 467 Aec* self = (Aec*)handle;
461 Stats erl; 468 Stats erl;
462 Stats erle; 469 Stats erle;
463 Stats a_nlp; 470 Stats a_nlp;
464 471
465 if (handle == NULL) { 472 if (handle == NULL) {
466 return -1; 473 return -1;
467 } 474 }
468 if (metrics == NULL) { 475 if (metrics == NULL) {
469 self->lastError = AEC_NULL_POINTER_ERROR; 476 return AEC_NULL_POINTER_ERROR;
470 return -1;
471 } 477 }
472 if (self->initFlag != initCheck) { 478 if (self->initFlag != initCheck) {
473 self->lastError = AEC_UNINITIALIZED_ERROR; 479 return AEC_UNINITIALIZED_ERROR;
474 return -1;
475 } 480 }
476 481
477 WebRtcAec_GetEchoStats(self->aec, &erl, &erle, &a_nlp); 482 WebRtcAec_GetEchoStats(self->aec, &erl, &erle, &a_nlp);
478 483
479 // ERL 484 // ERL
480 metrics->erl.instant = (int)erl.instant; 485 metrics->erl.instant = (int)erl.instant;
481 486
482 if ((erl.himean > kOffsetLevel) && (erl.average > kOffsetLevel)) { 487 if ((erl.himean > kOffsetLevel) && (erl.average > kOffsetLevel)) {
483 // Use a mix between regular average and upper part average. 488 // Use a mix between regular average and upper part average.
484 dtmp = kUpWeight * erl.himean + (1 - kUpWeight) * erl.average; 489 dtmp = kUpWeight * erl.himean + (1 - kUpWeight) * erl.average;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 554
550 return 0; 555 return 0;
551 } 556 }
552 557
553 int WebRtcAec_GetDelayMetrics(void* handle, 558 int WebRtcAec_GetDelayMetrics(void* handle,
554 int* median, 559 int* median,
555 int* std, 560 int* std,
556 float* fraction_poor_delays) { 561 float* fraction_poor_delays) {
557 Aec* self = handle; 562 Aec* self = handle;
558 if (median == NULL) { 563 if (median == NULL) {
559 self->lastError = AEC_NULL_POINTER_ERROR; 564 return AEC_NULL_POINTER_ERROR;
560 return -1;
561 } 565 }
562 if (std == NULL) { 566 if (std == NULL) {
563 self->lastError = AEC_NULL_POINTER_ERROR; 567 return AEC_NULL_POINTER_ERROR;
564 return -1;
565 } 568 }
566 if (self->initFlag != initCheck) { 569 if (self->initFlag != initCheck) {
567 self->lastError = AEC_UNINITIALIZED_ERROR; 570 return AEC_UNINITIALIZED_ERROR;
568 return -1;
569 } 571 }
570 if (WebRtcAec_GetDelayMetricsCore(self->aec, median, std, 572 if (WebRtcAec_GetDelayMetricsCore(self->aec, median, std,
571 fraction_poor_delays) == 573 fraction_poor_delays) ==
572 -1) { 574 -1) {
573 // Logging disabled. 575 // Logging disabled.
574 self->lastError = AEC_UNSUPPORTED_FUNCTION_ERROR; 576 return AEC_UNSUPPORTED_FUNCTION_ERROR;
575 return -1;
576 } 577 }
577 578
578 return 0; 579 return 0;
579 } 580 }
580 581
581 int32_t WebRtcAec_get_error_code(void* aecInst) {
582 Aec* aecpc = aecInst;
583 return aecpc->lastError;
584 }
585 582
586 AecCore* WebRtcAec_aec_core(void* handle) { 583 AecCore* WebRtcAec_aec_core(void* handle) {
587 if (!handle) { 584 if (!handle) {
588 return NULL; 585 return NULL;
589 } 586 }
590 return ((Aec*)handle)->aec; 587 return ((Aec*)handle)->aec;
591 } 588 }
592 589
593 static int ProcessNormal(Aec* aecpc, 590 static int ProcessNormal(Aec* aecpc,
594 const float* const* nearend, 591 const float* const* nearend,
(...skipping 15 matching lines...) Expand all
610 msInSndCardBuf += 10; 607 msInSndCardBuf += 10;
611 aecpc->msInSndCardBuf = msInSndCardBuf; 608 aecpc->msInSndCardBuf = msInSndCardBuf;
612 609
613 if (aecpc->skewMode == kAecTrue) { 610 if (aecpc->skewMode == kAecTrue) {
614 if (aecpc->skewFrCtr < 25) { 611 if (aecpc->skewFrCtr < 25) {
615 aecpc->skewFrCtr++; 612 aecpc->skewFrCtr++;
616 } else { 613 } else {
617 retVal = WebRtcAec_GetSkew(aecpc->resampler, skew, &aecpc->skew); 614 retVal = WebRtcAec_GetSkew(aecpc->resampler, skew, &aecpc->skew);
618 if (retVal == -1) { 615 if (retVal == -1) {
619 aecpc->skew = 0; 616 aecpc->skew = 0;
620 aecpc->lastError = AEC_BAD_PARAMETER_WARNING; 617 retVal = AEC_BAD_PARAMETER_WARNING;
621 } 618 }
622 619
623 aecpc->skew /= aecpc->sampFactor * nrOfSamples; 620 aecpc->skew /= aecpc->sampFactor * nrOfSamples;
624 621
625 if (aecpc->skew < 1.0e-3 && aecpc->skew > -1.0e-3) { 622 if (aecpc->skew < 1.0e-3 && aecpc->skew > -1.0e-3) {
626 aecpc->resample = kAecFalse; 623 aecpc->resample = kAecFalse;
627 } else { 624 } else {
628 aecpc->resample = kAecTrue; 625 aecpc->resample = kAecTrue;
629 } 626 }
630 627
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 } 911 }
915 } else { 912 } else {
916 self->timeForDelayChange = 0; 913 self->timeForDelayChange = 0;
917 } 914 }
918 self->lastDelayDiff = delay_difference; 915 self->lastDelayDiff = delay_difference;
919 916
920 if (self->timeForDelayChange > 25) { 917 if (self->timeForDelayChange > 25) {
921 self->knownDelay = WEBRTC_SPL_MAX((int)self->filtDelay - 256, 0); 918 self->knownDelay = WEBRTC_SPL_MAX((int)self->filtDelay - 256, 0);
922 } 919 }
923 } 920 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698