Ivo Creusen | 56d4609 | 2017-11-24 17:29:59 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_STATISTICS_H_ |
| 12 | #define MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_STATISTICS_H_ |
| 13 | |
| 14 | #include "api/optional.h" |
| 15 | |
| 16 | namespace webrtc { |
| 17 | // This version of the stats uses Optionals, it will replace the regular |
| 18 | // AudioProcessingStatistics struct. |
| 19 | struct AudioProcessingStats { |
| 20 | AudioProcessingStats(); |
| 21 | AudioProcessingStats(const AudioProcessingStats& other); |
| 22 | ~AudioProcessingStats(); |
| 23 | |
| 24 | // AEC Statistics. |
| 25 | // ERL = 10log_10(P_far / P_echo) |
| 26 | rtc::Optional<double> echo_return_loss; |
| 27 | // ERLE = 10log_10(P_echo / P_out) |
| 28 | rtc::Optional<double> echo_return_loss_enhancement; |
| 29 | // Fraction of time that the AEC linear filter is divergent, in a 1-second |
| 30 | // non-overlapped aggregation window. |
| 31 | rtc::Optional<double> divergent_filter_fraction; |
| 32 | |
| 33 | // The delay metrics consists of the delay median and standard deviation. It |
| 34 | // also consists of the fraction of delay estimates that can make the echo |
| 35 | // cancellation perform poorly. The values are aggregated until the first |
| 36 | // call to |GetStatistics()| and afterwards aggregated and updated every |
| 37 | // second. Note that if there are several clients pulling metrics from |
| 38 | // |GetStatistics()| during a session the first call from any of them will |
| 39 | // change to one second aggregation window for all. |
| 40 | rtc::Optional<int32_t> delay_median_ms; |
| 41 | rtc::Optional<int32_t> delay_standard_deviation_ms; |
| 42 | |
| 43 | // Residual echo detector likelihood. |
| 44 | rtc::Optional<double> residual_echo_likelihood; |
| 45 | // Maximum residual echo likelihood from the last time period. |
| 46 | rtc::Optional<double> residual_echo_likelihood_recent_max; |
| 47 | }; |
| 48 | |
| 49 | } // namespace webrtc |
| 50 | |
| 51 | #endif // MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_STATISTICS_H_ |