OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 // Update the target bitrate according based on, among other things, | 54 // Update the target bitrate according based on, among other things, |
55 // the current rate control state, the current target bitrate and the incoming | 55 // the current rate control state, the current target bitrate and the incoming |
56 // bitrate. When in the "increase" state the bitrate will be increased either | 56 // bitrate. When in the "increase" state the bitrate will be increased either |
57 // additively or multiplicatively depending on the rate control region. When | 57 // additively or multiplicatively depending on the rate control region. When |
58 // in the "decrease" state the bitrate will be decreased to slightly below the | 58 // in the "decrease" state the bitrate will be decreased to slightly below the |
59 // incoming bitrate. When in the "hold" state the bitrate will be kept | 59 // incoming bitrate. When in the "hold" state the bitrate will be kept |
60 // constant to allow built up queues to drain. | 60 // constant to allow built up queues to drain. |
61 uint32_t ChangeBitrate(uint32_t current_bit_rate, | 61 uint32_t ChangeBitrate(uint32_t current_bit_rate, |
62 uint32_t incoming_bit_rate, | 62 uint32_t incoming_bit_rate, |
63 int64_t now_ms); | 63 int64_t now_ms); |
64 uint32_t ClampBitrate(uint32_t new_bitrate_bps, | |
nisse-webrtc
2017/02/13 09:55:35
I think this method deserves a comment.
stefan-webrtc
2017/02/13 14:41:13
Done.
| |
65 uint32_t incoming_bitrate_bps) const; | |
64 uint32_t MultiplicativeRateIncrease(int64_t now_ms, int64_t last_ms, | 66 uint32_t MultiplicativeRateIncrease(int64_t now_ms, int64_t last_ms, |
65 uint32_t current_bitrate_bps) const; | 67 uint32_t current_bitrate_bps) const; |
66 uint32_t AdditiveRateIncrease(int64_t now_ms, int64_t last_ms) const; | 68 uint32_t AdditiveRateIncrease(int64_t now_ms, int64_t last_ms) const; |
67 void UpdateChangePeriod(int64_t now_ms); | 69 void UpdateChangePeriod(int64_t now_ms); |
68 void UpdateMaxBitRateEstimate(float incoming_bit_rate_kbps); | 70 void UpdateMaxBitRateEstimate(float incoming_bit_rate_kbps); |
69 void ChangeState(const RateControlInput& input, int64_t now_ms); | 71 void ChangeState(const RateControlInput& input, int64_t now_ms); |
70 void ChangeState(RateControlState new_state); | 72 void ChangeState(RateControlState new_state); |
71 void ChangeRegion(RateControlRegion region); | 73 void ChangeRegion(RateControlRegion region); |
72 | 74 |
73 uint32_t min_configured_bitrate_bps_; | 75 uint32_t min_configured_bitrate_bps_; |
74 uint32_t max_configured_bitrate_bps_; | 76 uint32_t max_configured_bitrate_bps_; |
75 uint32_t current_bitrate_bps_; | 77 uint32_t current_bitrate_bps_; |
76 float avg_max_bitrate_kbps_; | 78 float avg_max_bitrate_kbps_; |
77 float var_max_bitrate_kbps_; | 79 float var_max_bitrate_kbps_; |
78 RateControlState rate_control_state_; | 80 RateControlState rate_control_state_; |
79 RateControlRegion rate_control_region_; | 81 RateControlRegion rate_control_region_; |
80 int64_t time_last_bitrate_change_; | 82 int64_t time_last_bitrate_change_; |
81 RateControlInput current_input_; | 83 RateControlInput current_input_; |
82 bool updated_; | 84 bool updated_; |
83 int64_t time_first_incoming_estimate_; | 85 int64_t time_first_incoming_estimate_; |
84 bool bitrate_is_initialized_; | 86 bool bitrate_is_initialized_; |
85 float beta_; | 87 float beta_; |
86 int64_t rtt_; | 88 int64_t rtt_; |
87 bool in_experiment_; | 89 bool in_experiment_; |
88 rtc::Optional<int> last_decrease_; | 90 rtc::Optional<int> last_decrease_; |
89 }; | 91 }; |
90 } // namespace webrtc | 92 } // namespace webrtc |
91 | 93 |
92 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_AIMD_RATE_CONTROL_H_ | 94 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_AIMD_RATE_CONTROL_H_ |
OLD | NEW |