Fixed problem with previous commit.
BUG= TEST= Review URL: https://webrtc-codereview.appspot.com/472002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1970 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
e5f74bdbbc
commit
b5617869fc
@ -47,19 +47,19 @@ class VideoSyncTest : public AfterStreamingFixture {
|
||||
}
|
||||
|
||||
void CheckEstimatesConvergeReasonablyWell(int min_estimate) {
|
||||
int standard_deviation = CollectEstimatesDuring15Seconds(min_estimate);
|
||||
EXPECT_LT(standard_deviation, 20);
|
||||
float standard_deviation = CollectEstimatesDuring15Seconds(min_estimate);
|
||||
EXPECT_LT(standard_deviation, 20.0f);
|
||||
}
|
||||
|
||||
// Computes the standard deviation by first estimating the sample variance
|
||||
// with an unbiased estimator.
|
||||
int ComputeStandardDeviation(std::vector<int>::const_iterator start,
|
||||
float ComputeStandardDeviation(std::vector<int>::const_iterator start,
|
||||
std::vector<int>::const_iterator end) const {
|
||||
int num_elements = end - start;
|
||||
int mean = std::accumulate(start, end, 0) / num_elements;
|
||||
assert(num_elements > 1);
|
||||
|
||||
int variance = 0;
|
||||
float variance = 0;
|
||||
for (; start != end; ++start) {
|
||||
variance += (*start - mean) * (*start - mean) / (num_elements - 1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user