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/overuse_estimator.h" | 11 #include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <assert.h> | 14 #include <assert.h> |
15 #include <math.h> | 15 #include <math.h> |
16 #include <stdlib.h> | 16 #include <stdlib.h> |
17 #include <string.h> | 17 #include <string.h> |
18 | 18 |
| 19 #include "webrtc/base/logging.h" |
19 #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" | 20 #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" |
20 #include "webrtc/system_wrappers/include/logging.h" | |
21 | 21 |
22 namespace webrtc { | 22 namespace webrtc { |
23 | 23 |
24 enum { kMinFramePeriodHistoryLength = 60 }; | 24 enum { kMinFramePeriodHistoryLength = 60 }; |
25 enum { kDeltaCounterMax = 1000 }; | 25 enum { kDeltaCounterMax = 1000 }; |
26 | 26 |
27 OveruseEstimator::OveruseEstimator(const OverUseDetectorOptions& options) | 27 OveruseEstimator::OveruseEstimator(const OverUseDetectorOptions& options) |
28 : options_(options), | 28 : options_(options), |
29 num_of_deltas_(0), | 29 num_of_deltas_(0), |
30 slope_(options_.initial_slope), | 30 slope_(options_.initial_slope), |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 const double beta = pow(1 - alpha, ts_delta * 30.0 / 1000.0); | 144 const double beta = pow(1 - alpha, ts_delta * 30.0 / 1000.0); |
145 avg_noise_ = beta * avg_noise_ | 145 avg_noise_ = beta * avg_noise_ |
146 + (1 - beta) * residual; | 146 + (1 - beta) * residual; |
147 var_noise_ = beta * var_noise_ | 147 var_noise_ = beta * var_noise_ |
148 + (1 - beta) * (avg_noise_ - residual) * (avg_noise_ - residual); | 148 + (1 - beta) * (avg_noise_ - residual) * (avg_noise_ - residual); |
149 if (var_noise_ < 1) { | 149 if (var_noise_ < 1) { |
150 var_noise_ = 1; | 150 var_noise_ = 1; |
151 } | 151 } |
152 } | 152 } |
153 } // namespace webrtc | 153 } // namespace webrtc |
OLD | NEW |