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

Unified Diff: webrtc/modules/congestion_controller/delay_based_bwe.h

Issue 2917873002: Refactored incoming bitrate estimator. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/congestion_controller/delay_based_bwe.h
diff --git a/webrtc/modules/congestion_controller/delay_based_bwe.h b/webrtc/modules/congestion_controller/delay_based_bwe.h
index eccd73ac4d49f7daea6b7fd1ae7366b6e6089d50..a1fc49cab2944959fa6a14c336bb1a2df981a173 100644
--- a/webrtc/modules/congestion_controller/delay_based_bwe.h
+++ b/webrtc/modules/congestion_controller/delay_based_bwe.h
@@ -18,6 +18,7 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/thread_checker.h"
+#include "webrtc/modules/congestion_controller/incoming_bitrate_estimator.h"
#include "webrtc/modules/congestion_controller/median_slope_estimator.h"
#include "webrtc/modules/congestion_controller/probe_bitrate_estimator.h"
#include "webrtc/modules/congestion_controller/trendline_estimator.h"
@@ -44,7 +45,9 @@ class DelayBasedBwe {
uint32_t target_bitrate_bps;
};
- DelayBasedBwe(RtcEventLog* event_log, const Clock* clock);
+ DelayBasedBwe(RtcEventLog* event_log,
+ IncomingBitrateEstimator* const receiver_incoming_bitrate,
+ const Clock* clock);
virtual ~DelayBasedBwe();
Result IncomingPacketFeedbackVector(
@@ -57,26 +60,6 @@ class DelayBasedBwe {
int64_t GetExpectedBwePeriodMs() const;
private:
- // Computes a bayesian estimate of the throughput given acks containing
- // the arrival time and payload size. Samples which are far from the current
- // estimate or are based on few packets are given a smaller weight, as they
- // are considered to be more likely to have been caused by, e.g., delay spikes
- // unrelated to congestion.
- class BitrateEstimator {
- public:
- BitrateEstimator();
- void Update(int64_t now_ms, int bytes);
- rtc::Optional<uint32_t> bitrate_bps() const;
-
- private:
- float UpdateWindow(int64_t now_ms, int bytes, int rate_window_ms);
- int sum_;
- int64_t current_win_ms_;
- int64_t prev_time_ms_;
- float bitrate_estimate_;
- float bitrate_estimate_var_;
- };
-
void IncomingPacketFeedback(const PacketFeedback& packet_feedback);
Result OnLongFeedbackDelay(int64_t arrival_time_ms);
@@ -94,7 +77,7 @@ class DelayBasedBwe {
std::unique_ptr<InterArrival> inter_arrival_;
std::unique_ptr<TrendlineEstimator> trendline_estimator_;
OveruseDetector detector_;
- BitrateEstimator receiver_incoming_bitrate_;
+ IncomingBitrateEstimator* const receiver_incoming_bitrate_;
int64_t last_seen_packet_ms_;
bool uma_recorded_;
AimdRateControl rate_control_;

Powered by Google App Engine
This is Rietveld 408576698