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 <assert.h> | 13 #include <assert.h> |
14 #include <math.h> | 14 #include <math.h> |
15 #include <stdlib.h> | 15 #include <stdlib.h> |
16 #include <string.h> | 16 #include <string.h> |
17 | 17 |
18 #include <algorithm> | 18 #include <algorithm> |
19 | 19 |
20 #include "webrtc/base/logging.h" | |
21 #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" | 20 #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" |
22 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" | 21 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" |
| 22 #include "webrtc/rtc_base/logging.h" |
23 | 23 |
24 namespace webrtc { | 24 namespace webrtc { |
25 | 25 |
26 enum { kMinFramePeriodHistoryLength = 60 }; | 26 enum { kMinFramePeriodHistoryLength = 60 }; |
27 enum { kDeltaCounterMax = 1000 }; | 27 enum { kDeltaCounterMax = 1000 }; |
28 | 28 |
29 OveruseEstimator::OveruseEstimator(const OverUseDetectorOptions& options) | 29 OveruseEstimator::OveruseEstimator(const OverUseDetectorOptions& options) |
30 : options_(options), | 30 : options_(options), |
31 num_of_deltas_(0), | 31 num_of_deltas_(0), |
32 slope_(options_.initial_slope), | 32 slope_(options_.initial_slope), |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 const double beta = pow(1 - alpha, ts_delta * 30.0 / 1000.0); | 157 const double beta = pow(1 - alpha, ts_delta * 30.0 / 1000.0); |
158 avg_noise_ = beta * avg_noise_ | 158 avg_noise_ = beta * avg_noise_ |
159 + (1 - beta) * residual; | 159 + (1 - beta) * residual; |
160 var_noise_ = beta * var_noise_ | 160 var_noise_ = beta * var_noise_ |
161 + (1 - beta) * (avg_noise_ - residual) * (avg_noise_ - residual); | 161 + (1 - beta) * (avg_noise_ - residual) * (avg_noise_ - residual); |
162 if (var_noise_ < 1) { | 162 if (var_noise_ < 1) { |
163 var_noise_ = 1; | 163 var_noise_ = 1; |
164 } | 164 } |
165 } | 165 } |
166 } // namespace webrtc | 166 } // namespace webrtc |
OLD | NEW |