Add new histograms WebRTC.Audio.(Speech)ExpandRatePercent

These two new histograms relate to the packet-loss concealment that
happens when audio packets are lost or late for decoding, and the
NetEq must resort to extrapolating audio from the previously
decoded data.

Bug: webrtc:9126
Change-Id: I99cc97e653169fb742da0092653ab99fd10e5d7b
Reviewed-on: https://webrtc-review.googlesource.com/67861
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22812}
This commit is contained in:
Henrik Lundin
2018-04-10 15:10:26 +02:00
committed by Commit Bot
parent f0482ea9dd
commit 3ef3bfc2aa
5 changed files with 140 additions and 1 deletions

View File

@ -106,7 +106,13 @@ NetEqImpl::NetEqImpl(const NetEq::Config& config,
playout_mode_(config.playout_mode),
enable_fast_accelerate_(config.enable_fast_accelerate),
nack_enabled_(false),
enable_muted_state_(config.enable_muted_state) {
enable_muted_state_(config.enable_muted_state),
expand_uma_logger_("WebRTC.Audio.ExpandRatePercent",
10, // Report once every 10 s.
tick_timer_.get()),
speech_expand_uma_logger_("WebRTC.Audio.SpeechExpandRatePercent",
10, // Report once every 10 s.
tick_timer_.get()) {
RTC_LOG(LS_INFO) << "NetEq config: " << config.ToString();
int fs = config.sample_rate_hz;
if (fs != 8000 && fs != 16000 && fs != 32000 && fs != 48000) {
@ -837,6 +843,11 @@ int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame, bool* muted) {
last_decoded_timestamps_.clear();
tick_timer_->Increment();
stats_.IncreaseCounter(output_size_samples_, fs_hz_);
const auto lifetime_stats = stats_.GetLifetimeStatistics();
expand_uma_logger_.UpdateSampleCounter(lifetime_stats.concealed_samples,
fs_hz_);
speech_expand_uma_logger_.UpdateSampleCounter(
lifetime_stats.voice_concealed_samples, fs_hz_);
// Check for muted state.
if (enable_muted_state_ && expand_->Muted() && packet_buffer_->Empty()) {