Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h

Issue 1202253003: More Simulation Framework features (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Using rtc::scoped_ptr on nada_unittest.cc Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 22 matching lines...) Expand all
33 33
34 class NadaBweReceiver : public BweReceiver { 34 class NadaBweReceiver : public BweReceiver {
35 public: 35 public:
36 explicit NadaBweReceiver(int flow_id); 36 explicit NadaBweReceiver(int flow_id);
37 virtual ~NadaBweReceiver(); 37 virtual ~NadaBweReceiver();
38 38
39 void ReceivePacket(int64_t arrival_time_ms, 39 void ReceivePacket(int64_t arrival_time_ms,
40 const MediaPacket& media_packet) override; 40 const MediaPacket& media_packet) override;
41 FeedbackPacket* GetFeedback(int64_t now_ms) override; 41 FeedbackPacket* GetFeedback(int64_t now_ms) override;
42 42
43 size_t RecentReceivingRate();
44 static int64_t MedianFilter(int64_t* v, int size); 43 static int64_t MedianFilter(int64_t* v, int size);
45 static int64_t ExponentialSmoothingFilter(int64_t new_value, 44 static int64_t ExponentialSmoothingFilter(int64_t new_value,
46 int64_t last_smoothed_value, 45 int64_t last_smoothed_value,
47 float alpha); 46 float alpha);
48 47
49 static const int64_t kReceivingRateTimeWindowMs; 48 static const int64_t kReceivingRateTimeWindowMs;
50 49
51 private: 50 private:
52 SimulatedClock clock_; 51 SimulatedClock clock_;
53 int64_t last_feedback_ms_; 52 int64_t last_feedback_ms_;
(...skipping 26 matching lines...) Expand all
80 double smoothing_factor); 79 double smoothing_factor);
81 80
82 int bitrate_kbps() const { return bitrate_kbps_; } 81 int bitrate_kbps() const { return bitrate_kbps_; }
83 void set_bitrate_kbps(int bitrate_kbps) { bitrate_kbps_ = bitrate_kbps; } 82 void set_bitrate_kbps(int bitrate_kbps) { bitrate_kbps_ = bitrate_kbps; }
84 bool original_operating_mode() const { return original_operating_mode_; } 83 bool original_operating_mode() const { return original_operating_mode_; }
85 void set_original_operating_mode(bool original_operating_mode) { 84 void set_original_operating_mode(bool original_operating_mode) {
86 original_operating_mode_ = original_operating_mode; 85 original_operating_mode_ = original_operating_mode;
87 } 86 }
88 int64_t NowMs() const { return clock_->TimeInMilliseconds(); } 87 int64_t NowMs() const { return clock_->TimeInMilliseconds(); }
89 88
90 static const int kMinRefRateKbps; // Referred as R_min.
91 static const int kMaxRefRateKbps; // Referred as R_max.
92
93 private: 89 private:
94 Clock* const clock_; 90 Clock* const clock_;
95 BitrateObserver* const observer_; 91 BitrateObserver* const observer_;
96 // Used as an upper bound for calling AcceleratedRampDown. 92 // Used as an upper bound for calling AcceleratedRampDown.
97 const float kMaxCongestionSignalMs = 40.0f + kMinRefRateKbps / 15; 93 const float kMaxCongestionSignalMs = 40.0f + kMinBitrateKbps / 15;
98 // Referred as R_min, default initialization for bitrate R_n. 94 // Referred as R_min, default initialization for bitrate R_n.
99 int bitrate_kbps_; // Referred as "Reference Rate" = R_n.
100 int64_t last_feedback_ms_ = 0; 95 int64_t last_feedback_ms_ = 0;
101 // Referred as delta_0, initialized as an upper bound. 96 // Referred as delta_0, initialized as an upper bound.
102 int64_t min_feedback_delay_ms_ = 200; 97 int64_t min_feedback_delay_ms_ = 200;
103 // Referred as RTT_0, initialized as an upper bound. 98 // Referred as RTT_0, initialized as an upper bound.
104 int64_t min_round_trip_time_ms_ = 100; 99 int64_t min_round_trip_time_ms_ = 100;
105 bool original_operating_mode_; 100 bool original_operating_mode_;
106 101
107 DISALLOW_IMPLICIT_CONSTRUCTORS(NadaBweSender); 102 DISALLOW_IMPLICIT_CONSTRUCTORS(NadaBweSender);
108 }; 103 };
109 104
110 } // namespace bwe 105 } // namespace bwe
111 } // namespace testing 106 } // namespace testing
112 } // namespace webrtc 107 } // namespace webrtc
113 108
114 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_NADA_H_ 109 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_NADA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698