Use instant upper bound as LossBased candidate in ALR
Addes field trial UpperBoundCandidateInAlr to LossBasedBweV2. If an
instant upper bound exist in ALR that are lower than current estimate,
use it as a candidate.
Bug: webrtc:12707
Change-Id: I55595c7225c4289e1bc4edde9d9576e0443d3dce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324220
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Diep Bui <diepbp@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40986}
diff --git a/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc b/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc
index a5260bb..78f3cba 100644
--- a/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc
+++ b/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc
@@ -380,6 +380,8 @@
"AckedRateCandidate", true);
FieldTrialParameter<bool> append_delay_based_estimate_candidate(
"DelayBasedCandidate", true);
+ FieldTrialParameter<bool> append_upper_bound_candidate_in_alr(
+ "UpperBoundCandidateInAlr", false);
FieldTrialParameter<TimeDelta> observation_duration_lower_bound(
"ObservationDurationLowerBound", TimeDelta::Millis(250));
FieldTrialParameter<int> observation_window_size("ObservationWindowSize", 20);
@@ -433,6 +435,7 @@
&newton_step_size,
&append_acknowledged_rate_candidate,
&append_delay_based_estimate_candidate,
+ &append_upper_bound_candidate_in_alr,
&observation_duration_lower_bound,
&observation_window_size,
&sending_rate_smoothing_factor,
@@ -485,6 +488,8 @@
append_acknowledged_rate_candidate.Get();
config->append_delay_based_estimate_candidate =
append_delay_based_estimate_candidate.Get();
+ config->append_upper_bound_candidate_in_alr =
+ append_upper_bound_candidate_in_alr.Get();
config->observation_duration_lower_bound =
observation_duration_lower_bound.Get();
config->observation_window_size = observation_window_size.Get();
@@ -776,6 +781,11 @@
}
}
+ if (in_alr && config_->append_upper_bound_candidate_in_alr &&
+ current_best_estimate_.loss_limited_bandwidth > GetInstantUpperBound()) {
+ bandwidths.push_back(GetInstantUpperBound());
+ }
+
const DataRate candidate_bandwidth_upper_bound =
GetCandidateBandwidthUpperBound();
diff --git a/modules/congestion_controller/goog_cc/loss_based_bwe_v2.h b/modules/congestion_controller/goog_cc/loss_based_bwe_v2.h
index 4a95c10f..9221028 100644
--- a/modules/congestion_controller/goog_cc/loss_based_bwe_v2.h
+++ b/modules/congestion_controller/goog_cc/loss_based_bwe_v2.h
@@ -99,6 +99,7 @@
double newton_step_size = 0.0;
bool append_acknowledged_rate_candidate = true;
bool append_delay_based_estimate_candidate = false;
+ bool append_upper_bound_candidate_in_alr = false;
TimeDelta observation_duration_lower_bound = TimeDelta::Zero();
int observation_window_size = 0;
double sending_rate_smoothing_factor = 0.0;
diff --git a/modules/congestion_controller/goog_cc/loss_based_bwe_v2_test.cc b/modules/congestion_controller/goog_cc/loss_based_bwe_v2_test.cc
index a25dc95..8416f29 100644
--- a/modules/congestion_controller/goog_cc/loss_based_bwe_v2_test.cc
+++ b/modules/congestion_controller/goog_cc/loss_based_bwe_v2_test.cc
@@ -1388,6 +1388,38 @@
LossBasedState::kIncreasing);
}
+TEST_F(LossBasedBweV2Test,
+ EstimateIncreaseSlowlyFromInstantUpperBoundInAlrIfFieldTrial) {
+ ExplicitKeyValueConfig key_value_config(
+ ShortObservationConfig("UpperBoundCandidateInAlr:true"));
+ LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
+ loss_based_bandwidth_estimator.SetBandwidthEstimate(
+ DataRate::KilobitsPerSec(1000));
+ loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
+ DataRate::KilobitsPerSec(150));
+ loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
+ CreatePacketResultsWith50pLossRate(
+ /*first_packet_timestamp=*/Timestamp::Zero()),
+ /*delay_based_estimate=*/DataRate::PlusInfinity(),
+ /*in_alr=*/true);
+ LossBasedBweV2::Result result_after_loss =
+ loss_based_bandwidth_estimator.GetLossBasedResult();
+ ASSERT_EQ(result_after_loss.state, LossBasedState::kDecreasing);
+
+ for (int feedback_count = 1; feedback_count <= 3; ++feedback_count) {
+ loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
+ CreatePacketResultsWithReceivedPackets(
+ /*first_packet_timestamp=*/Timestamp::Zero() +
+ feedback_count * kObservationDurationLowerBound),
+ /*delay_based_estimate=*/DataRate::PlusInfinity(),
+ /*in_alr=*/true);
+ }
+ // Expect less than 100% increase.
+ EXPECT_LT(
+ loss_based_bandwidth_estimator.GetLossBasedResult().bandwidth_estimate,
+ 2 * result_after_loss.bandwidth_estimate);
+}
+
TEST_F(LossBasedBweV2Test, HasDelayBasedStateIfLossBasedBweIsMax) {
ExplicitKeyValueConfig key_value_config(ShortObservationConfig(""));
LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);