OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/modules/remote_bitrate_estimator/rate_statistics.h" | 11 #include "webrtc/base/rate_statistics.h" |
12 | 12 |
13 #include <assert.h> | 13 #include <assert.h> |
14 | 14 |
15 namespace webrtc { | 15 namespace webrtc { |
16 | 16 |
17 RateStatistics::RateStatistics(uint32_t window_size_ms, float scale) | 17 RateStatistics::RateStatistics(uint32_t window_size_ms, float scale) |
18 : num_buckets_(window_size_ms + 1), // N ms in (N+1) buckets. | 18 : num_buckets_(window_size_ms + 1), // N ms in (N+1) buckets. |
19 buckets_(new size_t[num_buckets_]()), | 19 buckets_(new size_t[num_buckets_]()), |
20 accumulated_count_(0), | 20 accumulated_count_(0), |
21 oldest_time_(0), | 21 oldest_time_(0), |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (accumulated_count_ == 0) { | 76 if (accumulated_count_ == 0) { |
77 // This guarantees we go through all the buckets at most once, even if | 77 // This guarantees we go through all the buckets at most once, even if |
78 // |new_oldest_time| is far greater than |oldest_time_|. | 78 // |new_oldest_time| is far greater than |oldest_time_|. |
79 break; | 79 break; |
80 } | 80 } |
81 } | 81 } |
82 oldest_time_ = new_oldest_time; | 82 oldest_time_ = new_oldest_time; |
83 } | 83 } |
84 | 84 |
85 } // namespace webrtc | 85 } // namespace webrtc |
OLD | NEW |