Only average positive quality stats.

Removes addition of at least one zero sample in webrtc_perf_tests that
can skew stats differently depending on how often these stats are
updated. Unclear if this skewing is different between now and before.

BUG=chromium:585071, chromium:586216
R=sprang@google.com, sprang@webrtc.org

Review URL: https://codereview.webrtc.org/1727583003 .

Cr-Commit-Position: refs/heads/master@{#11720}
This commit is contained in:
Peter Boström 2016-02-23 17:30:49 +01:00
parent b68e02fd86
commit b1eaa8df0d

View File

@ -387,10 +387,16 @@ class VideoAnalyzer : public PacketReceiver,
VideoSendStream::Stats stats = send_stream_->GetStats();
rtc::CritScope crit(&comparison_lock_);
encode_frame_rate_.AddSample(stats.encode_frame_rate);
encode_time_ms.AddSample(stats.avg_encode_time_ms);
encode_usage_percent.AddSample(stats.encode_usage_percent);
media_bitrate_bps.AddSample(stats.media_bitrate_bps);
// It's not certain that we yet have estimates for any of these stats. Check
// that they are positive before mixing them in.
if (stats.encode_frame_rate > 0)
encode_frame_rate_.AddSample(stats.encode_frame_rate);
if (stats.avg_encode_time_ms > 0)
encode_time_ms.AddSample(stats.avg_encode_time_ms);
if (stats.encode_usage_percent > 0)
encode_usage_percent.AddSample(stats.encode_usage_percent);
if (stats.media_bitrate_bps > 0)
media_bitrate_bps.AddSample(stats.media_bitrate_bps);
return true;
}