| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 int64_t delay_signal_ms_; // Referred as d_n. | 57 int64_t delay_signal_ms_; // Referred as d_n. |
| 58 int64_t last_congestion_signal_ms_; | 58 int64_t last_congestion_signal_ms_; |
| 59 int last_delays_index_; | 59 int last_delays_index_; |
| 60 int64_t exp_smoothed_delay_ms_; // Referred as d_hat_n. | 60 int64_t exp_smoothed_delay_ms_; // Referred as d_hat_n. |
| 61 int64_t est_queuing_delay_signal_ms_; // Referred as d_tilde_n. | 61 int64_t est_queuing_delay_signal_ms_; // Referred as d_tilde_n. |
| 62 int64_t last_delays_ms_[5]; // Used for Median Filter. | 62 int64_t last_delays_ms_[5]; // Used for Median Filter. |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 class NadaBweSender : public BweSender { | 65 class NadaBweSender : public BweSender { |
| 66 public: | 66 public: |
| 67 static const int kMinNadaBitrateKbps; |
| 68 |
| 67 NadaBweSender(int kbps, BitrateObserver* observer, Clock* clock); | 69 NadaBweSender(int kbps, BitrateObserver* observer, Clock* clock); |
| 68 NadaBweSender(BitrateObserver* observer, Clock* clock); | 70 NadaBweSender(BitrateObserver* observer, Clock* clock); |
| 69 virtual ~NadaBweSender(); | 71 virtual ~NadaBweSender(); |
| 70 | 72 |
| 71 int GetFeedbackIntervalMs() const override; | 73 int GetFeedbackIntervalMs() const override; |
| 72 // Updates the min_feedback_delay_ms_ and the min_round_trip_time_ms_. | 74 // Updates the min_feedback_delay_ms_ and the min_round_trip_time_ms_. |
| 73 void GiveFeedback(const FeedbackPacket& feedback) override; | 75 void GiveFeedback(const FeedbackPacket& feedback) override; |
| 74 void OnPacketsSent(const Packets& packets) override {} | 76 void OnPacketsSent(const Packets& packets) override {} |
| 75 int64_t TimeUntilNextProcess() override; | 77 int64_t TimeUntilNextProcess() override; |
| 76 void Process() override; | 78 void Process() override; |
| 77 void AcceleratedRampUp(const NadaFeedback& fb); | 79 void AcceleratedRampUp(const NadaFeedback& fb); |
| 78 void AcceleratedRampDown(const NadaFeedback& fb); | 80 void AcceleratedRampDown(const NadaFeedback& fb); |
| 79 void GradualRateUpdate(const NadaFeedback& fb, | 81 void GradualRateUpdate(const NadaFeedback& fb, |
| 80 float delta_s, | 82 float delta_s, |
| 81 double smoothing_factor); | 83 double smoothing_factor); |
| 82 | 84 |
| 83 int bitrate_kbps() const { return bitrate_kbps_; } | 85 int bitrate_kbps() const { return bitrate_kbps_; } |
| 84 void set_bitrate_kbps(int bitrate_kbps) { bitrate_kbps_ = bitrate_kbps; } | 86 void set_bitrate_kbps(int bitrate_kbps) { bitrate_kbps_ = bitrate_kbps; } |
| 85 bool original_operating_mode() const { return original_operating_mode_; } | 87 bool original_operating_mode() const { return original_operating_mode_; } |
| 86 void set_original_operating_mode(bool original_operating_mode) { | 88 void set_original_operating_mode(bool original_operating_mode) { |
| 87 original_operating_mode_ = original_operating_mode; | 89 original_operating_mode_ = original_operating_mode; |
| 88 } | 90 } |
| 89 int64_t NowMs() const { return clock_->TimeInMilliseconds(); } | 91 int64_t NowMs() const { return clock_->TimeInMilliseconds(); } |
| 90 | 92 |
| 91 private: | 93 private: |
| 92 Clock* const clock_; | 94 Clock* const clock_; |
| 93 BitrateObserver* const observer_; | 95 BitrateObserver* const observer_; |
| 94 // Used as an upper bound for calling AcceleratedRampDown. | |
| 95 const float kMaxCongestionSignalMs = 40.0f + kMinBitrateKbps / 15; | |
| 96 // Referred as R_min, default initialization for bitrate R_n. | 96 // Referred as R_min, default initialization for bitrate R_n. |
| 97 int64_t last_feedback_ms_ = 0; | 97 int64_t last_feedback_ms_ = 0; |
| 98 // Referred as delta_0, initialized as an upper bound. | 98 // Referred as delta_0, initialized as an upper bound. |
| 99 int64_t min_feedback_delay_ms_ = 200; | 99 int64_t min_feedback_delay_ms_ = 200; |
| 100 // Referred as RTT_0, initialized as an upper bound. | 100 // Referred as RTT_0, initialized as an upper bound. |
| 101 int64_t min_round_trip_time_ms_ = 100; | 101 int64_t min_round_trip_time_ms_ = 100; |
| 102 bool original_operating_mode_; | 102 bool original_operating_mode_; |
| 103 | 103 |
| 104 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(NadaBweSender); | 104 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(NadaBweSender); |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace bwe | 107 } // namespace bwe |
| 108 } // namespace testing | 108 } // namespace testing |
| 109 } // namespace webrtc | 109 } // namespace webrtc |
| 110 | 110 |
| 111 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_NADA_H_ | 111 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_NADA_H_ |
| OLD | NEW |