Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc

Issue 2518523002: Fix the standard deviation calculation in the level controller perf tests. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc
diff --git a/webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc b/webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc
index 69ef28dce4e6c3406e190d4762df8550ba7b2fd2..1d003bee6288742b579d2717591c150169ddf53f 100644
--- a/webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc
+++ b/webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc
@@ -135,11 +135,11 @@ class SubmodulePerformanceTimer {
RTC_DCHECK(!timestamps_us_.empty());
double average_duration = GetDurationAverage();
- int64_t variance =
- std::accumulate(timestamps_us_.begin(), timestamps_us_.end(), 0,
- [average_duration](const int64_t& a, const int64_t& b) {
- return a + (b - average_duration);
- });
+ double variance = std::accumulate(
+ timestamps_us_.begin(), timestamps_us_.end(), 0.0,
+ [average_duration](const double& a, const int64_t& b) {
+ return a + (b - average_duration) * (b - average_duration);
+ });
return sqrt(variance / timestamps_us_.size());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698