OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 int NadaBweSender::GetFeedbackIntervalMs() const { | 172 int NadaBweSender::GetFeedbackIntervalMs() const { |
173 return 100; | 173 return 100; |
174 } | 174 } |
175 | 175 |
176 void NadaBweSender::GiveFeedback(const FeedbackPacket& feedback) { | 176 void NadaBweSender::GiveFeedback(const FeedbackPacket& feedback) { |
177 const NadaFeedback& fb = static_cast<const NadaFeedback&>(feedback); | 177 const NadaFeedback& fb = static_cast<const NadaFeedback&>(feedback); |
178 | 178 |
179 // Following parameters might be optimized. | 179 // Following parameters might be optimized. |
180 const int64_t kQueuingDelayUpperBoundMs = 10; | 180 const int64_t kQueuingDelayUpperBoundMs = 10; |
181 const float kDerivativeUpperBound = 10.0f / min_feedback_delay_ms_; | 181 const float kDerivativeUpperBound = |
| 182 10.0f / std::max<int64_t>(1, min_feedback_delay_ms_); |
182 // In the modified version, a higher kMinUpperBound allows a higher d_hat | 183 // In the modified version, a higher kMinUpperBound allows a higher d_hat |
183 // upper bound for calling AcceleratedRampUp. | 184 // upper bound for calling AcceleratedRampUp. |
184 const float kProportionalityDelayBits = 20.0f; | 185 const float kProportionalityDelayBits = 20.0f; |
185 | 186 |
186 int64_t now_ms = clock_->TimeInMilliseconds(); | 187 int64_t now_ms = clock_->TimeInMilliseconds(); |
187 float delta_s = now_ms - last_feedback_ms_; | 188 float delta_s = now_ms - last_feedback_ms_; |
188 last_feedback_ms_ = now_ms; | 189 last_feedback_ms_ = now_ms; |
189 // Update delta_0. | 190 // Update delta_0. |
190 min_feedback_delay_ms_ = | 191 min_feedback_delay_ms_ = |
191 std::min(min_feedback_delay_ms_, static_cast<int64_t>(delta_s)); | 192 std::min(min_feedback_delay_ms_, static_cast<int64_t>(delta_s)); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 (kTheta - (bitrate_kbps_ - kMinBitrateKbps) * x_hat)) / | 280 (kTheta - (bitrate_kbps_ - kMinBitrateKbps) * x_hat)) / |
280 (kTauOMs * kTauOMs) + | 281 (kTauOMs * kTauOMs) + |
281 0.5f); | 282 0.5f); |
282 | 283 |
283 bitrate_kbps_ = bitrate_kbps_ + smoothing_factor * original_increase; | 284 bitrate_kbps_ = bitrate_kbps_ + smoothing_factor * original_increase; |
284 } | 285 } |
285 | 286 |
286 } // namespace bwe | 287 } // namespace bwe |
287 } // namespace testing | 288 } // namespace testing |
288 } // namespace webrtc | 289 } // namespace webrtc |
OLD | NEW |