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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
434 } | 434 } |
435 | 435 |
436 int WebRtcAec_GetMetrics(void* handle, AecMetrics* metrics) { | 436 int WebRtcAec_GetMetrics(void* handle, AecMetrics* metrics) { |
437 const float kUpWeight = 0.7f; | 437 const float kUpWeight = 0.7f; |
438 float dtmp; | 438 float dtmp; |
439 int stmp; | 439 int stmp; |
440 Aec* self = reinterpret_cast<Aec*>(handle); | 440 Aec* self = reinterpret_cast<Aec*>(handle); |
441 Stats erl; | 441 Stats erl; |
442 Stats erle; | 442 Stats erle; |
443 Stats a_nlp; | 443 Stats a_nlp; |
444 float divergent_filter_fraction; | |
444 | 445 |
445 if (handle == NULL) { | 446 if (handle == NULL) { |
446 return -1; | 447 return -1; |
447 } | 448 } |
448 if (metrics == NULL) { | 449 if (metrics == NULL) { |
449 return AEC_NULL_POINTER_ERROR; | 450 return AEC_NULL_POINTER_ERROR; |
450 } | 451 } |
451 if (self->initFlag != initCheck) { | 452 if (self->initFlag != initCheck) { |
452 return AEC_UNINITIALIZED_ERROR; | 453 return AEC_UNINITIALIZED_ERROR; |
453 } | 454 } |
454 | 455 |
455 WebRtcAec_GetEchoStats(self->aec, &erl, &erle, &a_nlp); | 456 WebRtcAec_GetEchoStats(self->aec, &erl, &erle, &a_nlp, |
457 &divergent_filter_fraction); | |
peah-webrtc
2016/04/07 11:14:48
I cannot see that divergent_filter_fraction is use
minyue-webrtc
2016/04/07 11:22:53
Good catch. My bad. now fixed
| |
456 | 458 |
457 // ERL | 459 // ERL |
458 metrics->erl.instant = static_cast<int>(erl.instant); | 460 metrics->erl.instant = static_cast<int>(erl.instant); |
459 | 461 |
460 if ((erl.himean > kOffsetLevel) && (erl.average > kOffsetLevel)) { | 462 if ((erl.himean > kOffsetLevel) && (erl.average > kOffsetLevel)) { |
461 // Use a mix between regular average and upper part average. | 463 // Use a mix between regular average and upper part average. |
462 dtmp = kUpWeight * erl.himean + (1 - kUpWeight) * erl.average; | 464 dtmp = kUpWeight * erl.himean + (1 - kUpWeight) * erl.average; |
463 metrics->erl.average = static_cast<int>(dtmp); | 465 metrics->erl.average = static_cast<int>(dtmp); |
464 } else { | 466 } else { |
465 metrics->erl.average = kOffsetLevel; | 467 metrics->erl.average = kOffsetLevel; |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
877 } else { | 879 } else { |
878 self->timeForDelayChange = 0; | 880 self->timeForDelayChange = 0; |
879 } | 881 } |
880 self->lastDelayDiff = delay_difference; | 882 self->lastDelayDiff = delay_difference; |
881 | 883 |
882 if (self->timeForDelayChange > 25) { | 884 if (self->timeForDelayChange > 25) { |
883 self->knownDelay = WEBRTC_SPL_MAX((int)self->filtDelay - 256, 0); | 885 self->knownDelay = WEBRTC_SPL_MAX((int)self->filtDelay - 256, 0); |
884 } | 886 } |
885 } | 887 } |
886 } // namespace webrtc | 888 } // namespace webrtc |
OLD | NEW |