| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 // Log received packet information. | 94 // Log received packet information. |
| 95 BweReceiver::ReceivePacket(arrival_time_ms, media_packet); | 95 BweReceiver::ReceivePacket(arrival_time_ms, media_packet); |
| 96 } | 96 } |
| 97 | 97 |
| 98 FeedbackPacket* NadaBweReceiver::GetFeedback(int64_t now_ms) { | 98 FeedbackPacket* NadaBweReceiver::GetFeedback(int64_t now_ms) { |
| 99 const int64_t kPacketLossPenaltyMs = 1000; // Referred as d_L. | 99 const int64_t kPacketLossPenaltyMs = 1000; // Referred as d_L. |
| 100 | 100 |
| 101 if (now_ms - last_feedback_ms_ < 100) { | 101 if (now_ms - last_feedback_ms_ < 100) { |
| 102 return NULL; | 102 return nullptr; |
| 103 } | 103 } |
| 104 | 104 |
| 105 float loss_fraction = RecentPacketLossRatio(); | 105 float loss_fraction = RecentPacketLossRatio(); |
| 106 | 106 |
| 107 int64_t loss_signal_ms = | 107 int64_t loss_signal_ms = |
| 108 static_cast<int64_t>(loss_fraction * kPacketLossPenaltyMs + 0.5f); | 108 static_cast<int64_t>(loss_fraction * kPacketLossPenaltyMs + 0.5f); |
| 109 int64_t congestion_signal_ms = est_queuing_delay_signal_ms_ + loss_signal_ms; | 109 int64_t congestion_signal_ms = est_queuing_delay_signal_ms_ + loss_signal_ms; |
| 110 | 110 |
| 111 float derivative = 0.0f; | 111 float derivative = 0.0f; |
| 112 if (last_feedback_ms_ > 0) { | 112 if (last_feedback_ms_ > 0) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 (kTheta - (bitrate_kbps_ - kMinNadaBitrateKbps) * x_hat)) / | 284 (kTheta - (bitrate_kbps_ - kMinNadaBitrateKbps) * x_hat)) / |
| 285 (kTauOMs * kTauOMs) + | 285 (kTauOMs * kTauOMs) + |
| 286 0.5f); | 286 0.5f); |
| 287 | 287 |
| 288 bitrate_kbps_ = bitrate_kbps_ + smoothing_factor * original_increase; | 288 bitrate_kbps_ = bitrate_kbps_ + smoothing_factor * original_increase; |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace bwe | 291 } // namespace bwe |
| 292 } // namespace testing | 292 } // namespace testing |
| 293 } // namespace webrtc | 293 } // namespace webrtc |
| OLD | NEW |