From c6432043219d59a4b00bd1e561b272c68926e8a6 Mon Sep 17 00:00:00 2001 From: Bjorn Terelius Date: Thu, 14 Dec 2017 11:58:19 +0100 Subject: [PATCH] Remove sparse BWE update field trial and instead enable it by default. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:7508 Change-Id: If84910820c2ca4cf2acbe4830f07ec5219cff977 Reviewed-on: https://webrtc-review.googlesource.com/33003 Reviewed-by: Stefan Holmer Commit-Queue: Björn Terelius Cr-Commit-Position: refs/heads/master@{#21514} --- .../congestion_controller/delay_based_bwe.cc | 29 +++++-------------- .../congestion_controller/delay_based_bwe.h | 5 +--- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/modules/congestion_controller/delay_based_bwe.cc b/modules/congestion_controller/delay_based_bwe.cc index fda0e61553..2092212f8b 100644 --- a/modules/congestion_controller/delay_based_bwe.cc +++ b/modules/congestion_controller/delay_based_bwe.cc @@ -47,7 +47,6 @@ constexpr double kDefaultTrendlineThresholdGain = 4.0; constexpr int kMaxConsecutiveFailedLookups = 5; -const char kBweSparseUpdateExperiment[] = "WebRTC-BweSparseUpdateExperiment"; const char kBweWindowSizeInPacketsExperiment[] = "WebRTC-BweWindowSizeInPackets"; @@ -101,9 +100,7 @@ DelayBasedBwe::DelayBasedBwe(RtcEventLog* event_log, const Clock* clock) trendline_threshold_gain_(kDefaultTrendlineThresholdGain), consecutive_delayed_feedbacks_(0), prev_bitrate_(0), - prev_state_(BandwidthUsage::kBwNormal), - in_sparse_update_experiment_( - webrtc::field_trial::IsEnabled(kBweSparseUpdateExperiment)) { + prev_state_(BandwidthUsage::kBwNormal) { RTC_LOG(LS_INFO) << "Using Trendline filter for delay change estimation with window size " << trendline_window_size_; @@ -133,7 +130,6 @@ DelayBasedBwe::Result DelayBasedBwe::IncomingPacketFeedbackVector( BweNames::kBweNamesMax); uma_recorded_ = true; } - bool overusing = false; bool delayed_feedback = true; bool recovered_from_overuse = false; BandwidthUsage prev_detector_state = detector_.State(); @@ -142,16 +138,12 @@ DelayBasedBwe::Result DelayBasedBwe::IncomingPacketFeedbackVector( continue; delayed_feedback = false; IncomingPacketFeedback(packet_feedback); - if (!in_sparse_update_experiment_) - overusing |= (detector_.State() == BandwidthUsage::kBwOverusing); if (prev_detector_state == BandwidthUsage::kBwUnderusing && detector_.State() == BandwidthUsage::kBwNormal) { recovered_from_overuse = true; } prev_detector_state = detector_.State(); } - if (in_sparse_update_experiment_) - overusing = (detector_.State() == BandwidthUsage::kBwOverusing); if (delayed_feedback) { ++consecutive_delayed_feedbacks_; @@ -161,8 +153,7 @@ DelayBasedBwe::Result DelayBasedBwe::IncomingPacketFeedbackVector( } } else { consecutive_delayed_feedbacks_ = 0; - return MaybeUpdateEstimate(overusing, acked_bitrate_bps, - recovered_from_overuse); + return MaybeUpdateEstimate(acked_bitrate_bps, recovered_from_overuse); } return Result(); } @@ -230,7 +221,6 @@ void DelayBasedBwe::IncomingPacketFeedback( } DelayBasedBwe::Result DelayBasedBwe::MaybeUpdateEstimate( - bool overusing, rtc::Optional acked_bitrate_bps, bool recovered_from_overuse) { Result result; @@ -239,11 +229,11 @@ DelayBasedBwe::Result DelayBasedBwe::MaybeUpdateEstimate( rtc::Optional probe_bitrate_bps = probe_bitrate_estimator_.FetchAndResetLastEstimatedBitrateBps(); // Currently overusing the bandwidth. - if (overusing) { + if (detector_.State() == BandwidthUsage::kBwOverusing) { if (acked_bitrate_bps && rate_control_.TimeToReduceFurther(now_ms, *acked_bitrate_bps)) { - result.updated = UpdateEstimate(now_ms, acked_bitrate_bps, overusing, - &result.target_bitrate_bps); + result.updated = + UpdateEstimate(now_ms, acked_bitrate_bps, &result.target_bitrate_bps); } else if (!acked_bitrate_bps && rate_control_.ValidEstimate() && rate_control_.TimeToReduceFurther( now_ms, rate_control_.LatestEstimate() / 2 - 1)) { @@ -264,8 +254,8 @@ DelayBasedBwe::Result DelayBasedBwe::MaybeUpdateEstimate( result.target_bitrate_bps = *probe_bitrate_bps; rate_control_.SetEstimate(*probe_bitrate_bps, now_ms); } else { - result.updated = UpdateEstimate(now_ms, acked_bitrate_bps, overusing, - &result.target_bitrate_bps); + result.updated = + UpdateEstimate(now_ms, acked_bitrate_bps, &result.target_bitrate_bps); result.recovered_from_overuse = recovered_from_overuse; } } @@ -289,13 +279,10 @@ DelayBasedBwe::Result DelayBasedBwe::MaybeUpdateEstimate( bool DelayBasedBwe::UpdateEstimate(int64_t now_ms, rtc::Optional acked_bitrate_bps, - bool overusing, uint32_t* target_bitrate_bps) { // TODO(terelius): RateControlInput::noise_var is deprecated and will be // removed. In the meantime, we set it to zero. - const RateControlInput input( - overusing ? BandwidthUsage::kBwOverusing : detector_.State(), - acked_bitrate_bps, 0); + const RateControlInput input(detector_.State(), acked_bitrate_bps, 0); *target_bitrate_bps = rate_control_.Update(&input, now_ms); return rate_control_.ValidEstimate(); } diff --git a/modules/congestion_controller/delay_based_bwe.h b/modules/congestion_controller/delay_based_bwe.h index 3766cd119f..79af11bbf0 100644 --- a/modules/congestion_controller/delay_based_bwe.h +++ b/modules/congestion_controller/delay_based_bwe.h @@ -61,14 +61,12 @@ class DelayBasedBwe { private: void IncomingPacketFeedback(const PacketFeedback& packet_feedback); Result OnLongFeedbackDelay(int64_t arrival_time_ms); - Result MaybeUpdateEstimate(bool overusing, - rtc::Optional acked_bitrate_bps, + Result MaybeUpdateEstimate(rtc::Optional acked_bitrate_bps, bool request_probe); // Updates the current remote rate estimate and returns true if a valid // estimate exists. bool UpdateEstimate(int64_t now_ms, rtc::Optional acked_bitrate_bps, - bool overusing, uint32_t* target_bitrate_bps); rtc::RaceChecker network_race_; @@ -87,7 +85,6 @@ class DelayBasedBwe { int consecutive_delayed_feedbacks_; uint32_t prev_bitrate_; BandwidthUsage prev_state_; - bool in_sparse_update_experiment_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); };