| OLD | NEW |
| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 if (handle == NULL) { | 445 if (handle == NULL) { |
| 446 return -1; | 446 return -1; |
| 447 } | 447 } |
| 448 if (metrics == NULL) { | 448 if (metrics == NULL) { |
| 449 return AEC_NULL_POINTER_ERROR; | 449 return AEC_NULL_POINTER_ERROR; |
| 450 } | 450 } |
| 451 if (self->initFlag != initCheck) { | 451 if (self->initFlag != initCheck) { |
| 452 return AEC_UNINITIALIZED_ERROR; | 452 return AEC_UNINITIALIZED_ERROR; |
| 453 } | 453 } |
| 454 | 454 |
| 455 WebRtcAec_GetEchoStats(self->aec, &erl, &erle, &a_nlp); | 455 WebRtcAec_GetEchoStats(self->aec, &erl, &erle, &a_nlp, |
| 456 &metrics->divergent_filter_fraction); |
| 456 | 457 |
| 457 // ERL | 458 // ERL |
| 458 metrics->erl.instant = static_cast<int>(erl.instant); | 459 metrics->erl.instant = static_cast<int>(erl.instant); |
| 459 | 460 |
| 460 if ((erl.himean > kOffsetLevel) && (erl.average > kOffsetLevel)) { | 461 if ((erl.himean > kOffsetLevel) && (erl.average > kOffsetLevel)) { |
| 461 // Use a mix between regular average and upper part average. | 462 // Use a mix between regular average and upper part average. |
| 462 dtmp = kUpWeight * erl.himean + (1 - kUpWeight) * erl.average; | 463 dtmp = kUpWeight * erl.himean + (1 - kUpWeight) * erl.average; |
| 463 metrics->erl.average = static_cast<int>(dtmp); | 464 metrics->erl.average = static_cast<int>(dtmp); |
| 464 } else { | 465 } else { |
| 465 metrics->erl.average = kOffsetLevel; | 466 metrics->erl.average = kOffsetLevel; |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 } else { | 878 } else { |
| 878 self->timeForDelayChange = 0; | 879 self->timeForDelayChange = 0; |
| 879 } | 880 } |
| 880 self->lastDelayDiff = delay_difference; | 881 self->lastDelayDiff = delay_difference; |
| 881 | 882 |
| 882 if (self->timeForDelayChange > 25) { | 883 if (self->timeForDelayChange > 25) { |
| 883 self->knownDelay = WEBRTC_SPL_MAX((int)self->filtDelay - 256, 0); | 884 self->knownDelay = WEBRTC_SPL_MAX((int)self->filtDelay - 256, 0); |
| 884 } | 885 } |
| 885 } | 886 } |
| 886 } // namespace webrtc | 887 } // namespace webrtc |
| OLD | NEW |