Revert "Probing integration in loss based bwe 2."
This reverts commit 332810ab5d41862b8f85ef30e84dbec4241f8b21. Reason for revert: This commit chain seems to cause problems in LossBasedBwe. Original change's description: > Probing integration in loss based bwe 2. > > - Loss based bwe has 3 states: increasing (increasing when loss limited), decreasing (decreasing when loss limited), or delay based bwe (the same as delay based estimate). > - When bandwidth is loss limited and decreasing, and probe result is available, GetLossBasedResult = min(estimate, probe result). > - When bandwidth is loss limited and increasing, and the estimate is bounded by acked bitrate * a factor. > - When bandwidth is loss limited and probe result is available, use probe bitrate as the current estimate, and reset probe bitrate. > > Bug: webrtc:12707 > Change-Id: I53cb82aa16397941c0cfaf1035116f775bdce72b > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277400 > Commit-Queue: Diep Bui <diepbp@webrtc.org> > Reviewed-by: Per Kjellander <perkj@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#38382} Bug: webrtc:12707 Change-Id: Ied86323b0ce94b87ac503a2ee34753cebef5f53d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279500 Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Per Kjellander <perkj@webrtc.org> Commit-Queue: Diep Bui <diepbp@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38412}
This commit is contained in:
@ -549,8 +549,8 @@ NetworkControlUpdate GoogCcNetworkController::OnTransportPacketsFeedback(
|
|||||||
bandwidth_estimation_->UpdateDelayBasedEstimate(report.feedback_time,
|
bandwidth_estimation_->UpdateDelayBasedEstimate(report.feedback_time,
|
||||||
result.target_bitrate);
|
result.target_bitrate);
|
||||||
}
|
}
|
||||||
bandwidth_estimation_->UpdateLossBasedEstimator(
|
bandwidth_estimation_->UpdateLossBasedEstimator(report,
|
||||||
report, result.delay_detector_state, probe_bitrate);
|
result.delay_detector_state);
|
||||||
if (result.updated) {
|
if (result.updated) {
|
||||||
// Update the estimate in the ProbeController, in case we want to probe.
|
// Update the estimate in the ProbeController, in case we want to probe.
|
||||||
MaybeTriggerOnNetworkChanged(&update, report.feedback_time);
|
MaybeTriggerOnNetworkChanged(&update, report.feedback_time);
|
||||||
|
|||||||
@ -42,10 +42,6 @@ bool IsValid(DataRate datarate) {
|
|||||||
return datarate.IsFinite();
|
return datarate.IsFinite();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsValid(absl::optional<DataRate> datarate) {
|
|
||||||
return datarate.has_value() && IsValid(datarate.value());
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsValid(Timestamp timestamp) {
|
bool IsValid(Timestamp timestamp) {
|
||||||
return timestamp.IsFinite();
|
return timestamp.IsFinite();
|
||||||
}
|
}
|
||||||
@ -138,10 +134,8 @@ bool LossBasedBweV2::IsReady() const {
|
|||||||
num_observations_ > 0;
|
num_observations_ > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LossBasedBweV2::Result LossBasedBweV2::GetLossBasedResult(
|
DataRate LossBasedBweV2::GetBandwidthEstimate(
|
||||||
DataRate delay_based_limit) const {
|
DataRate delay_based_limit) const {
|
||||||
Result result;
|
|
||||||
result.state = current_state_;
|
|
||||||
if (!IsReady()) {
|
if (!IsReady()) {
|
||||||
if (!IsEnabled()) {
|
if (!IsEnabled()) {
|
||||||
RTC_LOG(LS_WARNING)
|
RTC_LOG(LS_WARNING)
|
||||||
@ -156,21 +150,17 @@ LossBasedBweV2::Result LossBasedBweV2::GetLossBasedResult(
|
|||||||
"statistics before it can be used.";
|
"statistics before it can be used.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.bandwidth_estimate = IsValid(delay_based_limit)
|
return IsValid(delay_based_limit) ? delay_based_limit
|
||||||
? delay_based_limit
|
: DataRate::PlusInfinity();
|
||||||
: DataRate::PlusInfinity();
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsValid(delay_based_limit)) {
|
if (delay_based_limit.IsFinite()) {
|
||||||
result.bandwidth_estimate =
|
return std::min({current_estimate_.loss_limited_bandwidth,
|
||||||
std::min({current_estimate_.loss_limited_bandwidth,
|
GetInstantUpperBound(), delay_based_limit});
|
||||||
GetInstantUpperBound(), delay_based_limit});
|
|
||||||
} else {
|
} else {
|
||||||
result.bandwidth_estimate = std::min(
|
return std::min(current_estimate_.loss_limited_bandwidth,
|
||||||
current_estimate_.loss_limited_bandwidth, GetInstantUpperBound());
|
GetInstantUpperBound());
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LossBasedBweV2::SetAcknowledgedBitrate(DataRate acknowledged_bitrate) {
|
void LossBasedBweV2::SetAcknowledgedBitrate(DataRate acknowledged_bitrate) {
|
||||||
@ -200,25 +190,15 @@ void LossBasedBweV2::SetMinBitrate(DataRate min_bitrate) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LossBasedBweV2::SetProbeBitrate(absl::optional<DataRate> probe_bitrate) {
|
|
||||||
if (probe_bitrate.has_value() && IsValid(probe_bitrate.value())) {
|
|
||||||
if (!IsValid(probe_bitrate_) || probe_bitrate_ > probe_bitrate.value()) {
|
|
||||||
probe_bitrate_ = probe_bitrate.value();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LossBasedBweV2::UpdateBandwidthEstimate(
|
void LossBasedBweV2::UpdateBandwidthEstimate(
|
||||||
rtc::ArrayView<const PacketResult> packet_results,
|
rtc::ArrayView<const PacketResult> packet_results,
|
||||||
DataRate delay_based_estimate,
|
DataRate delay_based_estimate,
|
||||||
BandwidthUsage delay_detector_state,
|
BandwidthUsage delay_detector_state) {
|
||||||
absl::optional<DataRate> probe_bitrate) {
|
|
||||||
if (!IsEnabled()) {
|
if (!IsEnabled()) {
|
||||||
RTC_LOG(LS_WARNING)
|
RTC_LOG(LS_WARNING)
|
||||||
<< "The estimator must be enabled before it can be used.";
|
<< "The estimator must be enabled before it can be used.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SetProbeBitrate(probe_bitrate);
|
|
||||||
if (packet_results.empty()) {
|
if (packet_results.empty()) {
|
||||||
RTC_LOG(LS_VERBOSE)
|
RTC_LOG(LS_VERBOSE)
|
||||||
<< "The estimate cannot be updated without any loss statistics.";
|
<< "The estimate cannot be updated without any loss statistics.";
|
||||||
@ -261,75 +241,34 @@ void LossBasedBweV2::UpdateBandwidthEstimate(
|
|||||||
current_estimate_.loss_limited_bandwidth;
|
current_estimate_.loss_limited_bandwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsBandwidthLimitedDueToLoss()) {
|
// Bound the estimate increase if:
|
||||||
// Bound the estimate increase if:
|
// 1. The estimate is limited due to loss, and
|
||||||
// 1. The estimate has been increased for less than
|
// 2. The estimate has been increased for less than `delayed_increase_window`
|
||||||
// `delayed_increase_window` ago, and
|
// ago, and
|
||||||
// 2. The best candidate is greater than bandwidth_limit_in_current_window.
|
// 3. The best candidate is greater than bandwidth_limit_in_current_window.
|
||||||
if (recovering_after_loss_timestamp_.IsFinite() &&
|
if (limited_due_to_loss_candidate_ &&
|
||||||
recovering_after_loss_timestamp_ + config_->delayed_increase_window >
|
recovering_after_loss_timestamp_.IsFinite() &&
|
||||||
last_send_time_most_recent_observation_ &&
|
recovering_after_loss_timestamp_ + config_->delayed_increase_window >
|
||||||
best_candidate.loss_limited_bandwidth >
|
last_send_time_most_recent_observation_ &&
|
||||||
bandwidth_limit_in_current_window_) {
|
best_candidate.loss_limited_bandwidth >
|
||||||
best_candidate.loss_limited_bandwidth =
|
bandwidth_limit_in_current_window_) {
|
||||||
bandwidth_limit_in_current_window_;
|
best_candidate.loss_limited_bandwidth = bandwidth_limit_in_current_window_;
|
||||||
}
|
|
||||||
|
|
||||||
bool increasing_when_loss_limited =
|
|
||||||
IsEstimateIncreasingWhenLossLimited(best_candidate);
|
|
||||||
// Bound the best candidate by the acked bitrate unless there is a recent
|
|
||||||
// probe result.
|
|
||||||
if (increasing_when_loss_limited && !IsValid(probe_bitrate_) &&
|
|
||||||
IsValid(acknowledged_bitrate_)) {
|
|
||||||
best_candidate.loss_limited_bandwidth =
|
|
||||||
IsValid(best_candidate.loss_limited_bandwidth)
|
|
||||||
? std::min(best_candidate.loss_limited_bandwidth,
|
|
||||||
config_->bandwidth_rampup_upper_bound_factor *
|
|
||||||
(*acknowledged_bitrate_))
|
|
||||||
: config_->bandwidth_rampup_upper_bound_factor *
|
|
||||||
(*acknowledged_bitrate_);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use probe bitrate as the estimate as probe bitrate is trusted to be
|
|
||||||
// correct. After being used, the probe bitrate is reset.
|
|
||||||
if (config_->probe_integration_enabled && IsValid(probe_bitrate_)) {
|
|
||||||
best_candidate.loss_limited_bandwidth =
|
|
||||||
std::min(probe_bitrate_, best_candidate.loss_limited_bandwidth);
|
|
||||||
probe_bitrate_ = DataRate::MinusInfinity();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
limited_due_to_loss_candidate_ =
|
||||||
|
delay_based_estimate.IsFinite() &&
|
||||||
|
best_candidate.loss_limited_bandwidth < delay_based_estimate;
|
||||||
|
|
||||||
if (IsEstimateIncreasingWhenLossLimited(best_candidate)) {
|
if (limited_due_to_loss_candidate_ &&
|
||||||
current_state_ = LossBasedState::kIncreasing;
|
|
||||||
} else if (IsValid(delay_based_estimate) &&
|
|
||||||
best_candidate.loss_limited_bandwidth < delay_based_estimate) {
|
|
||||||
current_state_ = LossBasedState::kDecreasing;
|
|
||||||
} else if (IsValid(delay_based_estimate) &&
|
|
||||||
best_candidate.loss_limited_bandwidth == delay_based_estimate) {
|
|
||||||
current_state_ = LossBasedState::kDelayBasedEstimate;
|
|
||||||
}
|
|
||||||
current_estimate_ = best_candidate;
|
|
||||||
|
|
||||||
if (IsBandwidthLimitedDueToLoss() &&
|
|
||||||
(recovering_after_loss_timestamp_.IsInfinite() ||
|
(recovering_after_loss_timestamp_.IsInfinite() ||
|
||||||
recovering_after_loss_timestamp_ + config_->delayed_increase_window <
|
recovering_after_loss_timestamp_ + config_->delayed_increase_window <
|
||||||
last_send_time_most_recent_observation_)) {
|
last_send_time_most_recent_observation_)) {
|
||||||
bandwidth_limit_in_current_window_ =
|
bandwidth_limit_in_current_window_ = std::max(
|
||||||
std::max(kCongestionControllerMinBitrate,
|
kCongestionControllerMinBitrate,
|
||||||
current_estimate_.loss_limited_bandwidth *
|
best_candidate.loss_limited_bandwidth * config_->max_increase_factor);
|
||||||
config_->max_increase_factor);
|
|
||||||
recovering_after_loss_timestamp_ = last_send_time_most_recent_observation_;
|
recovering_after_loss_timestamp_ = last_send_time_most_recent_observation_;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool LossBasedBweV2::IsEstimateIncreasingWhenLossLimited(
|
current_estimate_ = best_candidate;
|
||||||
const ChannelParameters& best_candidate) {
|
|
||||||
return (current_estimate_.loss_limited_bandwidth <
|
|
||||||
best_candidate.loss_limited_bandwidth ||
|
|
||||||
(current_estimate_.loss_limited_bandwidth ==
|
|
||||||
best_candidate.loss_limited_bandwidth &&
|
|
||||||
current_state_ == LossBasedState::kIncreasing)) &&
|
|
||||||
IsBandwidthLimitedDueToLoss();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns a `LossBasedBweV2::Config` iff the `key_value_config` specifies a
|
// Returns a `LossBasedBweV2::Config` iff the `key_value_config` specifies a
|
||||||
@ -400,8 +339,6 @@ absl::optional<LossBasedBweV2::Config> LossBasedBweV2::CreateConfig(
|
|||||||
"BandwidthCapAtHighLossRate", DataRate::KilobitsPerSec(500.0));
|
"BandwidthCapAtHighLossRate", DataRate::KilobitsPerSec(500.0));
|
||||||
FieldTrialParameter<double> slope_of_bwe_high_loss_func(
|
FieldTrialParameter<double> slope_of_bwe_high_loss_func(
|
||||||
"SlopeOfBweHighLossFunc", 1000);
|
"SlopeOfBweHighLossFunc", 1000);
|
||||||
FieldTrialParameter<bool> probe_integration_enabled("ProbeIntegrationEnabled",
|
|
||||||
false);
|
|
||||||
if (key_value_config) {
|
if (key_value_config) {
|
||||||
ParseFieldTrial({&enabled,
|
ParseFieldTrial({&enabled,
|
||||||
&bandwidth_rampup_upper_bound_factor,
|
&bandwidth_rampup_upper_bound_factor,
|
||||||
@ -434,7 +371,6 @@ absl::optional<LossBasedBweV2::Config> LossBasedBweV2::CreateConfig(
|
|||||||
&delayed_increase_window,
|
&delayed_increase_window,
|
||||||
&use_acked_bitrate_only_when_overusing,
|
&use_acked_bitrate_only_when_overusing,
|
||||||
¬_increase_if_inherent_loss_less_than_average_loss,
|
¬_increase_if_inherent_loss_less_than_average_loss,
|
||||||
&probe_integration_enabled,
|
|
||||||
&high_loss_rate_threshold,
|
&high_loss_rate_threshold,
|
||||||
&bandwidth_cap_at_high_loss_rate,
|
&bandwidth_cap_at_high_loss_rate,
|
||||||
&slope_of_bwe_high_loss_func},
|
&slope_of_bwe_high_loss_func},
|
||||||
@ -497,8 +433,6 @@ absl::optional<LossBasedBweV2::Config> LossBasedBweV2::CreateConfig(
|
|||||||
config->bandwidth_cap_at_high_loss_rate =
|
config->bandwidth_cap_at_high_loss_rate =
|
||||||
bandwidth_cap_at_high_loss_rate.Get();
|
bandwidth_cap_at_high_loss_rate.Get();
|
||||||
config->slope_of_bwe_high_loss_func = slope_of_bwe_high_loss_func.Get();
|
config->slope_of_bwe_high_loss_func = slope_of_bwe_high_loss_func.Get();
|
||||||
config->probe_integration_enabled = probe_integration_enabled.Get();
|
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -711,7 +645,7 @@ double LossBasedBweV2::GetAverageReportedLossRatio() const {
|
|||||||
DataRate LossBasedBweV2::GetCandidateBandwidthUpperBound(
|
DataRate LossBasedBweV2::GetCandidateBandwidthUpperBound(
|
||||||
DataRate delay_based_estimate) const {
|
DataRate delay_based_estimate) const {
|
||||||
DataRate candidate_bandwidth_upper_bound = DataRate::PlusInfinity();
|
DataRate candidate_bandwidth_upper_bound = DataRate::PlusInfinity();
|
||||||
if (IsBandwidthLimitedDueToLoss()) {
|
if (limited_due_to_loss_candidate_) {
|
||||||
candidate_bandwidth_upper_bound = bandwidth_limit_in_current_window_;
|
candidate_bandwidth_upper_bound = bandwidth_limit_in_current_window_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -727,6 +661,14 @@ DataRate LossBasedBweV2::GetCandidateBandwidthUpperBound(
|
|||||||
if (!acknowledged_bitrate_.has_value())
|
if (!acknowledged_bitrate_.has_value())
|
||||||
return candidate_bandwidth_upper_bound;
|
return candidate_bandwidth_upper_bound;
|
||||||
|
|
||||||
|
candidate_bandwidth_upper_bound =
|
||||||
|
IsValid(candidate_bandwidth_upper_bound)
|
||||||
|
? std::min(candidate_bandwidth_upper_bound,
|
||||||
|
config_->bandwidth_rampup_upper_bound_factor *
|
||||||
|
(*acknowledged_bitrate_))
|
||||||
|
: config_->bandwidth_rampup_upper_bound_factor *
|
||||||
|
(*acknowledged_bitrate_);
|
||||||
|
|
||||||
if (config_->rampup_acceleration_max_factor > 0.0) {
|
if (config_->rampup_acceleration_max_factor > 0.0) {
|
||||||
const TimeDelta time_since_bandwidth_reduced = std::min(
|
const TimeDelta time_since_bandwidth_reduced = std::min(
|
||||||
config_->rampup_acceleration_maxout_time,
|
config_->rampup_acceleration_maxout_time,
|
||||||
@ -1053,8 +995,4 @@ bool LossBasedBweV2::PushBackObservation(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LossBasedBweV2::IsBandwidthLimitedDueToLoss() const {
|
|
||||||
return current_state_ != LossBasedState::kDelayBasedEstimate;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -27,21 +27,8 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
// State of the loss based estimate, which can be either increasing/decreasing
|
|
||||||
// when network is loss limited, or equal to the delay based estimate.
|
|
||||||
enum class LossBasedState {
|
|
||||||
kIncreasing = 0,
|
|
||||||
kDecreasing = 1,
|
|
||||||
kDelayBasedEstimate = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
class LossBasedBweV2 {
|
class LossBasedBweV2 {
|
||||||
public:
|
public:
|
||||||
struct Result {
|
|
||||||
~Result() = default;
|
|
||||||
DataRate bandwidth_estimate = DataRate::Zero();
|
|
||||||
LossBasedState state = LossBasedState::kDelayBasedEstimate;
|
|
||||||
};
|
|
||||||
// Creates a disabled `LossBasedBweV2` if the
|
// Creates a disabled `LossBasedBweV2` if the
|
||||||
// `key_value_config` is not valid.
|
// `key_value_config` is not valid.
|
||||||
explicit LossBasedBweV2(const FieldTrialsView* key_value_config);
|
explicit LossBasedBweV2(const FieldTrialsView* key_value_config);
|
||||||
@ -57,7 +44,7 @@ class LossBasedBweV2 {
|
|||||||
bool IsReady() const;
|
bool IsReady() const;
|
||||||
|
|
||||||
// Returns `DataRate::PlusInfinity` if no BWE can be calculated.
|
// Returns `DataRate::PlusInfinity` if no BWE can be calculated.
|
||||||
Result GetLossBasedResult(DataRate delay_based_limit) const;
|
DataRate GetBandwidthEstimate(DataRate delay_based_limit) const;
|
||||||
|
|
||||||
void SetAcknowledgedBitrate(DataRate acknowledged_bitrate);
|
void SetAcknowledgedBitrate(DataRate acknowledged_bitrate);
|
||||||
void SetBandwidthEstimate(DataRate bandwidth_estimate);
|
void SetBandwidthEstimate(DataRate bandwidth_estimate);
|
||||||
@ -65,8 +52,7 @@ class LossBasedBweV2 {
|
|||||||
void UpdateBandwidthEstimate(
|
void UpdateBandwidthEstimate(
|
||||||
rtc::ArrayView<const PacketResult> packet_results,
|
rtc::ArrayView<const PacketResult> packet_results,
|
||||||
DataRate delay_based_estimate,
|
DataRate delay_based_estimate,
|
||||||
BandwidthUsage delay_detector_state,
|
BandwidthUsage delay_detector_state);
|
||||||
absl::optional<DataRate> probe_bitrate);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct ChannelParameters {
|
struct ChannelParameters {
|
||||||
@ -109,7 +95,6 @@ class LossBasedBweV2 {
|
|||||||
double high_loss_rate_threshold = 1.0;
|
double high_loss_rate_threshold = 1.0;
|
||||||
DataRate bandwidth_cap_at_high_loss_rate = DataRate::MinusInfinity();
|
DataRate bandwidth_cap_at_high_loss_rate = DataRate::MinusInfinity();
|
||||||
double slope_of_bwe_high_loss_func = 1000.0;
|
double slope_of_bwe_high_loss_func = 1000.0;
|
||||||
bool probe_integration_enabled = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Derivatives {
|
struct Derivatives {
|
||||||
@ -170,10 +155,6 @@ class LossBasedBweV2 {
|
|||||||
const std::vector<PacketResult>& packet_feedbacks,
|
const std::vector<PacketResult>& packet_feedbacks,
|
||||||
Timestamp at_time);
|
Timestamp at_time);
|
||||||
void UpdateDelayDetector(BandwidthUsage delay_detector_state);
|
void UpdateDelayDetector(BandwidthUsage delay_detector_state);
|
||||||
bool IsEstimateIncreasingWhenLossLimited(
|
|
||||||
const ChannelParameters& best_candidate);
|
|
||||||
bool IsBandwidthLimitedDueToLoss() const;
|
|
||||||
void SetProbeBitrate(absl::optional<DataRate> probe_bitrate);
|
|
||||||
|
|
||||||
absl::optional<DataRate> acknowledged_bitrate_;
|
absl::optional<DataRate> acknowledged_bitrate_;
|
||||||
absl::optional<Config> config_;
|
absl::optional<Config> config_;
|
||||||
@ -189,9 +170,8 @@ class LossBasedBweV2 {
|
|||||||
std::deque<BandwidthUsage> delay_detector_states_;
|
std::deque<BandwidthUsage> delay_detector_states_;
|
||||||
Timestamp recovering_after_loss_timestamp_ = Timestamp::MinusInfinity();
|
Timestamp recovering_after_loss_timestamp_ = Timestamp::MinusInfinity();
|
||||||
DataRate bandwidth_limit_in_current_window_ = DataRate::PlusInfinity();
|
DataRate bandwidth_limit_in_current_window_ = DataRate::PlusInfinity();
|
||||||
|
bool limited_due_to_loss_candidate_ = false;
|
||||||
DataRate min_bitrate_ = DataRate::KilobitsPerSec(1);
|
DataRate min_bitrate_ = DataRate::KilobitsPerSec(1);
|
||||||
LossBasedState current_state_ = LossBasedState::kDelayBasedEstimate;
|
|
||||||
DataRate probe_bitrate_ = DataRate::PlusInfinity();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -202,10 +202,8 @@ TEST_P(LossBasedBweV2Test, ReturnsDelayBasedEstimateWhenDisabled) {
|
|||||||
/*trendline_integration_enabled=*/GetParam()));
|
/*trendline_integration_enabled=*/GetParam()));
|
||||||
LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
|
LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
|
||||||
|
|
||||||
EXPECT_EQ(loss_based_bandwidth_estimator
|
EXPECT_EQ(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::KilobitsPerSec(100)),
|
||||||
/*delay_based_limit=*/DataRate::KilobitsPerSec(100))
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(100));
|
DataRate::KilobitsPerSec(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,10 +214,8 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
/*trendline_integration_enabled=*/GetParam()));
|
/*trendline_integration_enabled=*/GetParam()));
|
||||||
LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
|
LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
|
||||||
|
|
||||||
EXPECT_EQ(loss_based_bandwidth_estimator
|
EXPECT_EQ(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::KilobitsPerSec(100)),
|
||||||
/*delay_based_limit=*/DataRate::KilobitsPerSec(100))
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(100));
|
DataRate::KilobitsPerSec(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,14 +233,13 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
EXPECT_TRUE(loss_based_bandwidth_estimator.IsReady());
|
EXPECT_TRUE(loss_based_bandwidth_estimator.IsReady());
|
||||||
EXPECT_TRUE(
|
EXPECT_TRUE(
|
||||||
loss_based_bandwidth_estimator
|
loss_based_bandwidth_estimator
|
||||||
.GetLossBasedResult(/*delay_based_limit=*/DataRate::PlusInfinity())
|
.GetBandwidthEstimate(/*delay_based_limit=*/DataRate::PlusInfinity())
|
||||||
.bandwidth_estimate.IsFinite());
|
.IsFinite());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(LossBasedBweV2Test, NoBandwidthEstimateGivenNoInitialization) {
|
TEST_P(LossBasedBweV2Test, NoBandwidthEstimateGivenNoInitialization) {
|
||||||
@ -257,14 +252,13 @@ TEST_P(LossBasedBweV2Test, NoBandwidthEstimateGivenNoInitialization) {
|
|||||||
LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
|
LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
EXPECT_FALSE(loss_based_bandwidth_estimator.IsReady());
|
EXPECT_FALSE(loss_based_bandwidth_estimator.IsReady());
|
||||||
EXPECT_TRUE(
|
EXPECT_TRUE(
|
||||||
loss_based_bandwidth_estimator
|
loss_based_bandwidth_estimator
|
||||||
.GetLossBasedResult(/*delay_based_limit=*/DataRate::PlusInfinity())
|
.GetBandwidthEstimate(/*delay_based_limit=*/DataRate::PlusInfinity())
|
||||||
.bandwidth_estimate.IsPlusInfinity());
|
.IsPlusInfinity());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(LossBasedBweV2Test, NoBandwidthEstimateGivenNotEnoughFeedback) {
|
TEST_P(LossBasedBweV2Test, NoBandwidthEstimateGivenNotEnoughFeedback) {
|
||||||
@ -292,18 +286,17 @@ TEST_P(LossBasedBweV2Test, NoBandwidthEstimateGivenNotEnoughFeedback) {
|
|||||||
EXPECT_FALSE(loss_based_bandwidth_estimator.IsReady());
|
EXPECT_FALSE(loss_based_bandwidth_estimator.IsReady());
|
||||||
EXPECT_TRUE(
|
EXPECT_TRUE(
|
||||||
loss_based_bandwidth_estimator
|
loss_based_bandwidth_estimator
|
||||||
.GetLossBasedResult(/*delay_based_limit=*/DataRate::PlusInfinity())
|
.GetBandwidthEstimate(/*delay_based_limit=*/DataRate::PlusInfinity())
|
||||||
.bandwidth_estimate.IsPlusInfinity());
|
.IsPlusInfinity());
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
not_enough_feedback, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
not_enough_feedback, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
EXPECT_FALSE(loss_based_bandwidth_estimator.IsReady());
|
EXPECT_FALSE(loss_based_bandwidth_estimator.IsReady());
|
||||||
EXPECT_TRUE(
|
EXPECT_TRUE(
|
||||||
loss_based_bandwidth_estimator
|
loss_based_bandwidth_estimator
|
||||||
.GetLossBasedResult(/*delay_based_limit=*/DataRate::PlusInfinity())
|
.GetBandwidthEstimate(/*delay_based_limit=*/DataRate::PlusInfinity())
|
||||||
.bandwidth_estimate.IsPlusInfinity());
|
.IsPlusInfinity());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(LossBasedBweV2Test,
|
TEST_P(LossBasedBweV2Test,
|
||||||
@ -324,32 +317,24 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
EXPECT_NE(loss_based_bandwidth_estimator
|
EXPECT_NE(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
|
|
||||||
EXPECT_EQ(loss_based_bandwidth_estimator
|
EXPECT_EQ(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
EXPECT_NE(loss_based_bandwidth_estimator
|
EXPECT_NE(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,42 +359,30 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
loss_based_bandwidth_estimator_2.SetBandwidthEstimate(
|
loss_based_bandwidth_estimator_2.SetBandwidthEstimate(
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
loss_based_bandwidth_estimator_1.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator_1.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
loss_based_bandwidth_estimator_2.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator_2.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
EXPECT_EQ(loss_based_bandwidth_estimator_1
|
EXPECT_EQ(loss_based_bandwidth_estimator_1.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(660));
|
DataRate::KilobitsPerSec(660));
|
||||||
|
|
||||||
loss_based_bandwidth_estimator_1.SetAcknowledgedBitrate(
|
loss_based_bandwidth_estimator_1.SetAcknowledgedBitrate(
|
||||||
DataRate::KilobitsPerSec(900));
|
DataRate::KilobitsPerSec(600));
|
||||||
|
|
||||||
EXPECT_EQ(loss_based_bandwidth_estimator_1
|
EXPECT_EQ(loss_based_bandwidth_estimator_1.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(660));
|
DataRate::KilobitsPerSec(660));
|
||||||
|
|
||||||
loss_based_bandwidth_estimator_1.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator_1.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
loss_based_bandwidth_estimator_2.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator_2.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
EXPECT_NE(loss_based_bandwidth_estimator_1
|
EXPECT_NE(loss_based_bandwidth_estimator_1.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
loss_based_bandwidth_estimator_2.GetBandwidthEstimate(
|
||||||
.bandwidth_estimate,
|
/*delay_based_limit=*/DataRate::PlusInfinity()));
|
||||||
loss_based_bandwidth_estimator_2
|
|
||||||
.GetLossBasedResult(
|
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(LossBasedBweV2Test,
|
TEST_P(LossBasedBweV2Test,
|
||||||
@ -427,12 +400,10 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_no_received_packets, DataRate::PlusInfinity(),
|
enough_feedback_no_received_packets, DataRate::PlusInfinity(),
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
EXPECT_EQ(loss_based_bandwidth_estimator
|
EXPECT_EQ(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(100));
|
DataRate::KilobitsPerSec(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,19 +429,14 @@ TEST_P(LossBasedBweV2Test, BandwidthEstimateNotIncreaseWhenNetworkUnderusing) {
|
|||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(),
|
enough_feedback_1, DataRate::PlusInfinity(),
|
||||||
BandwidthUsage::kBwUnderusing, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwUnderusing);
|
||||||
EXPECT_LE(loss_based_bandwidth_estimator
|
EXPECT_LE(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
EXPECT_LE(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
EXPECT_LE(loss_based_bandwidth_estimator
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
.GetLossBasedResult(
|
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -495,24 +461,18 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
// If the delay based estimate is infinity, then loss based estimate increases
|
// If the delay based estimate is infinity, then loss based estimate increases
|
||||||
// and not bounded by delay based estimate.
|
// and not bounded by delay based estimate.
|
||||||
EXPECT_GT(loss_based_bandwidth_estimator
|
EXPECT_GT(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
// If the delay based estimate is not infinity, then loss based estimate is
|
// If the delay based estimate is not infinity, then loss based estimate is
|
||||||
// bounded by delay based estimate.
|
// bounded by delay based estimate.
|
||||||
EXPECT_EQ(loss_based_bandwidth_estimator
|
EXPECT_EQ(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::KilobitsPerSec(500)),
|
||||||
/*delay_based_limit=*/DataRate::KilobitsPerSec(500))
|
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(500));
|
DataRate::KilobitsPerSec(500));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -540,18 +500,16 @@ TEST_P(LossBasedBweV2Test, UseAckedBitrateForEmegencyBackOff) {
|
|||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(acked_bitrate);
|
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(acked_bitrate);
|
||||||
// Update estimate when network is overusing, and 50% loss rate.
|
// Update estimate when network is overusing, and 50% loss rate.
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwOverusing,
|
enough_feedback_1, DataRate::PlusInfinity(),
|
||||||
/*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwOverusing);
|
||||||
// Update estimate again when network is continuously overusing, and 100%
|
// Update estimate again when network is continuously overusing, and 100%
|
||||||
// loss rate.
|
// loss rate.
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwOverusing,
|
enough_feedback_2, DataRate::PlusInfinity(),
|
||||||
/*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwOverusing);
|
||||||
// The estimate bitrate now is backed off based on acked bitrate.
|
// The estimate bitrate now is backed off based on acked bitrate.
|
||||||
EXPECT_LE(loss_based_bandwidth_estimator
|
EXPECT_LE(loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity()),
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate,
|
|
||||||
acked_bitrate);
|
acked_bitrate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -571,21 +529,15 @@ TEST_P(LossBasedBweV2Test, NoBweChangeIfObservationDurationUnchanged) {
|
|||||||
DataRate::KilobitsPerSec(300));
|
DataRate::KilobitsPerSec(300));
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
DataRate estimate_1 = loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
DataRate estimate_1 = loss_based_bandwidth_estimator
|
/*delay_based_limit=*/DataRate::PlusInfinity());
|
||||||
.GetLossBasedResult(
|
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate;
|
|
||||||
|
|
||||||
// Use the same feedback and check if the estimate is unchanged.
|
// Use the same feedback and check if the estimate is unchanged.
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
DataRate estimate_2 = loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
DataRate estimate_2 = loss_based_bandwidth_estimator
|
/*delay_based_limit=*/DataRate::PlusInfinity());
|
||||||
.GetLossBasedResult(
|
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate;
|
|
||||||
EXPECT_EQ(estimate_2, estimate_1);
|
EXPECT_EQ(estimate_2, estimate_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -608,20 +560,14 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
DataRate estimate_1 = loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
DataRate estimate_1 = loss_based_bandwidth_estimator
|
/*delay_based_limit=*/DataRate::PlusInfinity());
|
||||||
.GetLossBasedResult(
|
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate;
|
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
DataRate estimate_2 = loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
DataRate estimate_2 = loss_based_bandwidth_estimator
|
/*delay_based_limit=*/DataRate::PlusInfinity());
|
||||||
.GetLossBasedResult(
|
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate;
|
|
||||||
EXPECT_EQ(estimate_2, estimate_1);
|
EXPECT_EQ(estimate_2, estimate_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -644,20 +590,15 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
DataRate estimate_1 = loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
DataRate estimate_1 = loss_based_bandwidth_estimator
|
/*delay_based_limit=*/DataRate::PlusInfinity());
|
||||||
.GetLossBasedResult(
|
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate;
|
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, DataRate::PlusInfinity(),
|
enough_feedback_2, DataRate::PlusInfinity(),
|
||||||
BandwidthUsage::kBwUnderusing, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwUnderusing);
|
||||||
DataRate estimate_2 = loss_based_bandwidth_estimator
|
DataRate estimate_2 = loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity());
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate;
|
|
||||||
EXPECT_LE(estimate_2, estimate_1);
|
EXPECT_LE(estimate_2, estimate_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -687,20 +628,15 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
||||||
DataRate::KilobitsPerSec(300));
|
DataRate::KilobitsPerSec(300));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal,
|
enough_feedback_1, DataRate::PlusInfinity(), BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
DataRate estimate_1 = loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
DataRate estimate_1 = loss_based_bandwidth_estimator
|
/*delay_based_limit=*/DataRate::PlusInfinity());
|
||||||
.GetLossBasedResult(
|
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate;
|
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, DataRate::PlusInfinity(), BandwidthUsage::kBwOverusing,
|
enough_feedback_2, DataRate::PlusInfinity(),
|
||||||
/*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwOverusing);
|
||||||
DataRate estimate_2 = loss_based_bandwidth_estimator
|
DataRate estimate_2 = loss_based_bandwidth_estimator.GetBandwidthEstimate(
|
||||||
.GetLossBasedResult(
|
/*delay_based_limit=*/DataRate::PlusInfinity());
|
||||||
/*delay_based_limit=*/DataRate::PlusInfinity())
|
|
||||||
.bandwidth_estimate;
|
|
||||||
EXPECT_LT(estimate_2, estimate_1);
|
EXPECT_LT(estimate_2, estimate_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -722,73 +658,26 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, delay_based_estimate, BandwidthUsage::kBwNormal,
|
enough_feedback_1, delay_based_estimate, BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
delay_based_estimate);
|
delay_based_estimate);
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, delay_based_estimate, BandwidthUsage::kBwNormal,
|
enough_feedback_2, delay_based_estimate, BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
delay_based_estimate);
|
delay_based_estimate);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(LossBasedBweV2Test,
|
|
||||||
IncreaseByMaxIncreaseFactorAfterLossBasedBweBacksOff) {
|
|
||||||
ExplicitKeyValueConfig key_value_config(
|
|
||||||
"WebRTC-Bwe-LossBasedBweV2/"
|
|
||||||
"Enabled:true,CandidateFactors:1.2|1|0.5,AckedRateCandidate:true,"
|
|
||||||
"ObservationWindowSize:2,ObservationDurationLowerBound:200ms,"
|
|
||||||
"InstantUpperBoundBwBalance:10000kbps,"
|
|
||||||
"DelayBasedCandidate:true,MaxIncreaseFactor:1.5,BwRampupUpperBoundFactor:"
|
|
||||||
"2.0/");
|
|
||||||
LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
|
|
||||||
DataRate delay_based_estimate = DataRate::KilobitsPerSec(5000);
|
|
||||||
DataRate acked_rate = DataRate::KilobitsPerSec(300);
|
|
||||||
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
|
||||||
DataRate::KilobitsPerSec(600));
|
|
||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(acked_rate);
|
|
||||||
|
|
||||||
// Create some loss to create the loss limited scenario.
|
|
||||||
std::vector<PacketResult> enough_feedback_1 =
|
|
||||||
CreatePacketResultsWith100pLossRate(
|
|
||||||
/*first_packet_timestamp=*/Timestamp::Zero());
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
|
||||||
enough_feedback_1, delay_based_estimate, BandwidthUsage::kBwNormal,
|
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
LossBasedBweV2::Result result_at_loss =
|
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate);
|
|
||||||
|
|
||||||
// Network recovers after loss.
|
|
||||||
std::vector<PacketResult> enough_feedback_2 =
|
|
||||||
CreatePacketResultsWithReceivedPackets(
|
|
||||||
/*first_packet_timestamp=*/Timestamp::Zero() +
|
|
||||||
kObservationDurationLowerBound);
|
|
||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
|
||||||
DataRate::KilobitsPerSec(600));
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
|
||||||
enough_feedback_2, delay_based_estimate, BandwidthUsage::kBwNormal,
|
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
LossBasedBweV2::Result result_after_recovery =
|
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate);
|
|
||||||
EXPECT_EQ(result_after_recovery.bandwidth_estimate,
|
|
||||||
result_at_loss.bandwidth_estimate * 1.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
// After loss based bwe backs off, the next estimate is capped by
|
// After loss based bwe backs off, the next estimate is capped by
|
||||||
// a factor of acked bitrate.
|
// MaxIncreaseFactor * current estimate.
|
||||||
TEST_P(LossBasedBweV2Test,
|
TEST_P(LossBasedBweV2Test,
|
||||||
IncreaseByFactorOfAckedBitrateAfterLossBasedBweBacksOff) {
|
IncreaseByMaxIncreaseFactorAfterLossBasedBweBacksOff) {
|
||||||
std::vector<PacketResult> enough_feedback_1 =
|
std::vector<PacketResult> enough_feedback_1 =
|
||||||
CreatePacketResultsWith100pLossRate(
|
CreatePacketResultsWithReceivedPackets(
|
||||||
/*first_packet_timestamp=*/Timestamp::Zero());
|
/*first_packet_timestamp=*/Timestamp::Zero());
|
||||||
std::vector<PacketResult> enough_feedback_2 =
|
std::vector<PacketResult> enough_feedback_2 =
|
||||||
CreatePacketResultsWith10pLossRate(
|
CreatePacketResultsWithReceivedPackets(
|
||||||
/*first_packet_timestamp=*/Timestamp::Zero() +
|
/*first_packet_timestamp=*/Timestamp::Zero() +
|
||||||
kObservationDurationLowerBound);
|
kObservationDurationLowerBound);
|
||||||
ExplicitKeyValueConfig key_value_config(
|
ExplicitKeyValueConfig key_value_config(
|
||||||
@ -802,22 +691,22 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
||||||
DataRate::KilobitsPerSec(300));
|
DataRate::KilobitsPerSec(300));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, delay_based_estimate, BandwidthUsage::kBwNormal,
|
enough_feedback_1, delay_based_estimate, BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
DataRate estimate_1 =
|
||||||
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate);
|
||||||
// Change the acked bitrate to make sure that the estimate is bounded by a
|
// Increase the acknowledged bitrate to make sure that the estimate is not
|
||||||
// factor of acked bitrate.
|
// capped too low.
|
||||||
DataRate acked_bitrate = DataRate::KilobitsPerSec(50);
|
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(acked_bitrate);
|
DataRate::KilobitsPerSec(5000));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, delay_based_estimate, BandwidthUsage::kBwNormal,
|
enough_feedback_2, delay_based_estimate, BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
// The estimate is capped by acked_bitrate * BwRampupUpperBoundFactor.
|
// The estimate is capped by current_estimate * kMaxIncreaseFactor because it
|
||||||
|
// recently backed off.
|
||||||
DataRate estimate_2 =
|
DataRate estimate_2 =
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate);
|
||||||
.bandwidth_estimate;
|
EXPECT_EQ(estimate_2, estimate_1 * kMaxIncreaseFactor);
|
||||||
EXPECT_EQ(estimate_2, acked_bitrate * 1.2);
|
EXPECT_LE(estimate_2, delay_based_estimate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// After loss based bwe backs off, the estimate is bounded during the delayed
|
// After loss based bwe backs off, the estimate is bounded during the delayed
|
||||||
@ -846,30 +735,25 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
||||||
DataRate::KilobitsPerSec(300));
|
DataRate::KilobitsPerSec(300));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, delay_based_estimate, BandwidthUsage::kBwNormal,
|
enough_feedback_1, delay_based_estimate, BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
// Increase the acknowledged bitrate to make sure that the estimate is not
|
// Increase the acknowledged bitrate to make sure that the estimate is not
|
||||||
// capped too low.
|
// capped too low.
|
||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
||||||
DataRate::KilobitsPerSec(5000));
|
DataRate::KilobitsPerSec(5000));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, delay_based_estimate, BandwidthUsage::kBwNormal,
|
enough_feedback_2, delay_based_estimate, BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
// The estimate is capped by current_estimate * kMaxIncreaseFactor because
|
// The estimate is capped by current_estimate * kMaxIncreaseFactor because
|
||||||
// it recently backed off.
|
// it recently backed off.
|
||||||
DataRate estimate_2 =
|
DataRate estimate_2 =
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate);
|
||||||
.bandwidth_estimate;
|
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_3, delay_based_estimate, BandwidthUsage::kBwNormal,
|
enough_feedback_3, delay_based_estimate, BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
// The latest estimate is the same as the previous estimate since the sent
|
// The latest estimate is the same as the previous estimate since the sent
|
||||||
// packets were sent within the DelayedIncreaseWindow.
|
// packets were sent within the DelayedIncreaseWindow.
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
estimate_2);
|
estimate_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -897,29 +781,24 @@ TEST_P(LossBasedBweV2Test, KeepIncreasingEstimateAfterDelayedIncreaseWindow) {
|
|||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
||||||
DataRate::KilobitsPerSec(300));
|
DataRate::KilobitsPerSec(300));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_1, delay_based_estimate, BandwidthUsage::kBwNormal,
|
enough_feedback_1, delay_based_estimate, BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
// Increase the acknowledged bitrate to make sure that the estimate is not
|
// Increase the acknowledged bitrate to make sure that the estimate is not
|
||||||
// capped too low.
|
// capped too low.
|
||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
||||||
DataRate::KilobitsPerSec(5000));
|
DataRate::KilobitsPerSec(5000));
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_2, delay_based_estimate, BandwidthUsage::kBwNormal,
|
enough_feedback_2, delay_based_estimate, BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
// The estimate is capped by current_estimate * kMaxIncreaseFactor because it
|
// The estimate is capped by current_estimate * kMaxIncreaseFactor because it
|
||||||
// recently backed off.
|
// recently backed off.
|
||||||
DataRate estimate_2 =
|
DataRate estimate_2 =
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate);
|
||||||
.bandwidth_estimate;
|
|
||||||
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_3, delay_based_estimate, BandwidthUsage::kBwNormal,
|
enough_feedback_3, delay_based_estimate, BandwidthUsage::kBwNormal);
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
// The estimate can continue increasing after the DelayedIncreaseWindow.
|
// The estimate can continue increasing after the DelayedIncreaseWindow.
|
||||||
EXPECT_GE(
|
EXPECT_GE(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
estimate_2);
|
estimate_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -942,7 +821,7 @@ TEST_P(LossBasedBweV2Test, NotIncreaseIfInherentLossLessThanAverageLoss) {
|
|||||||
/*first_packet_timestamp=*/Timestamp::Zero());
|
/*first_packet_timestamp=*/Timestamp::Zero());
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_10p_loss_1, delay_based_estimate,
|
enough_feedback_10p_loss_1, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
std::vector<PacketResult> enough_feedback_10p_loss_2 =
|
std::vector<PacketResult> enough_feedback_10p_loss_2 =
|
||||||
CreatePacketResultsWith10pLossRate(
|
CreatePacketResultsWith10pLossRate(
|
||||||
@ -950,12 +829,11 @@ TEST_P(LossBasedBweV2Test, NotIncreaseIfInherentLossLessThanAverageLoss) {
|
|||||||
kObservationDurationLowerBound);
|
kObservationDurationLowerBound);
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_10p_loss_2, delay_based_estimate,
|
enough_feedback_10p_loss_2, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
// Do not increase the bitrate because inherent loss is less than average loss
|
// Do not increase the bitrate because inherent loss is less than average loss
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -980,7 +858,7 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
/*first_packet_timestamp=*/Timestamp::Zero());
|
/*first_packet_timestamp=*/Timestamp::Zero());
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_10p_loss_1, delay_based_estimate,
|
enough_feedback_10p_loss_1, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
std::vector<PacketResult> enough_feedback_10p_loss_2 =
|
std::vector<PacketResult> enough_feedback_10p_loss_2 =
|
||||||
CreatePacketResultsWith10pLossRate(
|
CreatePacketResultsWith10pLossRate(
|
||||||
@ -988,13 +866,12 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
kObservationDurationLowerBound);
|
kObservationDurationLowerBound);
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_10p_loss_2, delay_based_estimate,
|
enough_feedback_10p_loss_2, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
// Because LossThresholdOfHighBandwidthPreference is 20%, the average loss is
|
// Because LossThresholdOfHighBandwidthPreference is 20%, the average loss is
|
||||||
// 10%, bandwidth estimate should increase.
|
// 10%, bandwidth estimate should increase.
|
||||||
EXPECT_GT(
|
EXPECT_GT(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1019,7 +896,7 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
/*first_packet_timestamp=*/Timestamp::Zero());
|
/*first_packet_timestamp=*/Timestamp::Zero());
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_10p_loss_1, delay_based_estimate,
|
enough_feedback_10p_loss_1, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
std::vector<PacketResult> enough_feedback_10p_loss_2 =
|
std::vector<PacketResult> enough_feedback_10p_loss_2 =
|
||||||
CreatePacketResultsWith10pLossRate(
|
CreatePacketResultsWith10pLossRate(
|
||||||
@ -1027,54 +904,15 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
kObservationDurationLowerBound);
|
kObservationDurationLowerBound);
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_10p_loss_2, delay_based_estimate,
|
enough_feedback_10p_loss_2, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
// Because LossThresholdOfHighBandwidthPreference is 5%, the average loss is
|
// Because LossThresholdOfHighBandwidthPreference is 5%, the average loss is
|
||||||
// 10%, bandwidth estimate should decrease.
|
// 10%, bandwidth estimate should decrease.
|
||||||
EXPECT_LT(
|
EXPECT_LT(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(600));
|
DataRate::KilobitsPerSec(600));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(LossBasedBweV2Test, UseProbeResultWhenRecoveringFromLoss) {
|
|
||||||
ExplicitKeyValueConfig key_value_config(
|
|
||||||
"WebRTC-Bwe-LossBasedBweV2/"
|
|
||||||
"Enabled:true,CandidateFactors:1.2|1|0.5,AckedRateCandidate:true,"
|
|
||||||
"ObservationWindowSize:2,ObservationDurationLowerBound:200ms,"
|
|
||||||
"InstantUpperBoundBwBalance:10000kbps,"
|
|
||||||
"DelayBasedCandidate:true,MaxIncreaseFactor:1000,"
|
|
||||||
"BwRampupUpperBoundFactor:2.0,ProbeIntegrationEnabled:true/");
|
|
||||||
LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
|
|
||||||
DataRate delay_based_estimate = DataRate::KilobitsPerSec(5000);
|
|
||||||
DataRate acked_rate = DataRate::KilobitsPerSec(300);
|
|
||||||
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
|
||||||
DataRate::KilobitsPerSec(600));
|
|
||||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(acked_rate);
|
|
||||||
|
|
||||||
// Create some loss to create the loss limited scenario.
|
|
||||||
std::vector<PacketResult> enough_feedback_1 =
|
|
||||||
CreatePacketResultsWith100pLossRate(
|
|
||||||
/*first_packet_timestamp=*/Timestamp::Zero());
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
|
||||||
enough_feedback_1, delay_based_estimate, BandwidthUsage::kBwNormal,
|
|
||||||
/*probe_estimate=*/absl::nullopt);
|
|
||||||
|
|
||||||
// Network recovers after loss.
|
|
||||||
DataRate probe_estimate = DataRate::KilobitsPerSec(300);
|
|
||||||
std::vector<PacketResult> enough_feedback_2 =
|
|
||||||
CreatePacketResultsWithReceivedPackets(
|
|
||||||
/*first_packet_timestamp=*/Timestamp::Zero() +
|
|
||||||
kObservationDurationLowerBound);
|
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
|
||||||
enough_feedback_2, delay_based_estimate, BandwidthUsage::kBwNormal,
|
|
||||||
probe_estimate);
|
|
||||||
|
|
||||||
LossBasedBweV2::Result result_after_recovery =
|
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate);
|
|
||||||
EXPECT_EQ(result_after_recovery.bandwidth_estimate, probe_estimate);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(LossBasedBweV2Test,
|
TEST_P(LossBasedBweV2Test,
|
||||||
StricterBoundUsingHighLossRateThresholdAt10pLossRate) {
|
StricterBoundUsingHighLossRateThresholdAt10pLossRate) {
|
||||||
ExplicitKeyValueConfig key_value_config(
|
ExplicitKeyValueConfig key_value_config(
|
||||||
@ -1096,7 +934,7 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
/*first_packet_timestamp=*/Timestamp::Zero());
|
/*first_packet_timestamp=*/Timestamp::Zero());
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_10p_loss_1, delay_based_estimate,
|
enough_feedback_10p_loss_1, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
std::vector<PacketResult> enough_feedback_10p_loss_2 =
|
std::vector<PacketResult> enough_feedback_10p_loss_2 =
|
||||||
CreatePacketResultsWith10pLossRate(
|
CreatePacketResultsWith10pLossRate(
|
||||||
@ -1104,13 +942,12 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
kObservationDurationLowerBound);
|
kObservationDurationLowerBound);
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_10p_loss_2, delay_based_estimate,
|
enough_feedback_10p_loss_2, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
// At 10% loss rate and high loss rate threshold to be 10%, cap the estimate
|
// At 10% loss rate and high loss rate threshold to be 10%, cap the estimate
|
||||||
// to be 500 * 1000-0.1 = 400kbps.
|
// to be 500 * 1000-0.1 = 400kbps.
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(400));
|
DataRate::KilobitsPerSec(400));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1135,7 +972,7 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
/*first_packet_timestamp=*/Timestamp::Zero());
|
/*first_packet_timestamp=*/Timestamp::Zero());
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_50p_loss_1, delay_based_estimate,
|
enough_feedback_50p_loss_1, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
std::vector<PacketResult> enough_feedback_50p_loss_2 =
|
std::vector<PacketResult> enough_feedback_50p_loss_2 =
|
||||||
CreatePacketResultsWith50pLossRate(
|
CreatePacketResultsWith50pLossRate(
|
||||||
@ -1143,13 +980,12 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
kObservationDurationLowerBound);
|
kObservationDurationLowerBound);
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_50p_loss_2, delay_based_estimate,
|
enough_feedback_50p_loss_2, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
// At 50% loss rate and high loss rate threshold to be 30%, cap the estimate
|
// At 50% loss rate and high loss rate threshold to be 30%, cap the estimate
|
||||||
// to be the min bitrate.
|
// to be the min bitrate.
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(10));
|
DataRate::KilobitsPerSec(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1174,7 +1010,7 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
/*first_packet_timestamp=*/Timestamp::Zero());
|
/*first_packet_timestamp=*/Timestamp::Zero());
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_100p_loss_1, delay_based_estimate,
|
enough_feedback_100p_loss_1, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
std::vector<PacketResult> enough_feedback_100p_loss_2 =
|
std::vector<PacketResult> enough_feedback_100p_loss_2 =
|
||||||
CreatePacketResultsWith100pLossRate(
|
CreatePacketResultsWith100pLossRate(
|
||||||
@ -1182,13 +1018,12 @@ TEST_P(LossBasedBweV2Test,
|
|||||||
kObservationDurationLowerBound);
|
kObservationDurationLowerBound);
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_100p_loss_2, delay_based_estimate,
|
enough_feedback_100p_loss_2, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
// At 100% loss rate and high loss rate threshold to be 30%, cap the estimate
|
// At 100% loss rate and high loss rate threshold to be 30%, cap the estimate
|
||||||
// to be the min bitrate.
|
// to be the min bitrate.
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(10));
|
DataRate::KilobitsPerSec(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1212,13 +1047,12 @@ TEST_P(LossBasedBweV2Test, EstimateRecoversAfterHighLoss) {
|
|||||||
/*first_packet_timestamp=*/Timestamp::Zero());
|
/*first_packet_timestamp=*/Timestamp::Zero());
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_100p_loss_1, delay_based_estimate,
|
enough_feedback_100p_loss_1, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
// Make sure that the estimate is set to min bitrate because of 100% loss
|
// Make sure that the estimate is set to min bitrate because of 100% loss
|
||||||
// rate.
|
// rate.
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(10));
|
DataRate::KilobitsPerSec(10));
|
||||||
|
|
||||||
// Create some feedbacks with 0 loss rate to simulate network recovering.
|
// Create some feedbacks with 0 loss rate to simulate network recovering.
|
||||||
@ -1228,7 +1062,7 @@ TEST_P(LossBasedBweV2Test, EstimateRecoversAfterHighLoss) {
|
|||||||
kObservationDurationLowerBound);
|
kObservationDurationLowerBound);
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_0p_loss_1, delay_based_estimate,
|
enough_feedback_0p_loss_1, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
std::vector<PacketResult> enough_feedback_0p_loss_2 =
|
std::vector<PacketResult> enough_feedback_0p_loss_2 =
|
||||||
CreatePacketResultsWithReceivedPackets(
|
CreatePacketResultsWithReceivedPackets(
|
||||||
@ -1236,12 +1070,11 @@ TEST_P(LossBasedBweV2Test, EstimateRecoversAfterHighLoss) {
|
|||||||
kObservationDurationLowerBound * 2);
|
kObservationDurationLowerBound * 2);
|
||||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||||
enough_feedback_0p_loss_2, delay_based_estimate,
|
enough_feedback_0p_loss_2, delay_based_estimate,
|
||||||
BandwidthUsage::kBwNormal, /*probe_estimate=*/absl::nullopt);
|
BandwidthUsage::kBwNormal);
|
||||||
|
|
||||||
// The estimate increases as network recovers.
|
// The estimate increases as network recovers.
|
||||||
EXPECT_GT(
|
EXPECT_GT(
|
||||||
loss_based_bandwidth_estimator.GetLossBasedResult(delay_based_estimate)
|
loss_based_bandwidth_estimator.GetBandwidthEstimate(delay_based_estimate),
|
||||||
.bandwidth_estimate,
|
|
||||||
DataRate::KilobitsPerSec(10));
|
DataRate::KilobitsPerSec(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -229,7 +229,6 @@ SendSideBandwidthEstimation::SendSideBandwidthEstimation(
|
|||||||
bitrate_threshold_(kDefaultBitrateThreshold),
|
bitrate_threshold_(kDefaultBitrateThreshold),
|
||||||
loss_based_bandwidth_estimator_v1_(key_value_config),
|
loss_based_bandwidth_estimator_v1_(key_value_config),
|
||||||
loss_based_bandwidth_estimator_v2_(key_value_config),
|
loss_based_bandwidth_estimator_v2_(key_value_config),
|
||||||
loss_based_state_(LossBasedState::kDelayBasedEstimate),
|
|
||||||
disable_receiver_limit_caps_only_("Disabled") {
|
disable_receiver_limit_caps_only_("Disabled") {
|
||||||
RTC_DCHECK(event_log);
|
RTC_DCHECK(event_log);
|
||||||
if (BweLossExperimentIsEnabled()) {
|
if (BweLossExperimentIsEnabled()) {
|
||||||
@ -321,10 +320,6 @@ DataRate SendSideBandwidthEstimation::target_rate() const {
|
|||||||
return std::max(min_bitrate_configured_, target);
|
return std::max(min_bitrate_configured_, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
LossBasedState SendSideBandwidthEstimation::loss_based_state() const {
|
|
||||||
return loss_based_state_;
|
|
||||||
}
|
|
||||||
|
|
||||||
DataRate SendSideBandwidthEstimation::delay_based_limit() const {
|
DataRate SendSideBandwidthEstimation::delay_based_limit() const {
|
||||||
return delay_based_limit_;
|
return delay_based_limit_;
|
||||||
}
|
}
|
||||||
@ -369,16 +364,14 @@ void SendSideBandwidthEstimation::SetAcknowledgedRate(
|
|||||||
|
|
||||||
void SendSideBandwidthEstimation::UpdateLossBasedEstimator(
|
void SendSideBandwidthEstimation::UpdateLossBasedEstimator(
|
||||||
const TransportPacketsFeedback& report,
|
const TransportPacketsFeedback& report,
|
||||||
BandwidthUsage delay_detector_state,
|
BandwidthUsage delay_detector_state) {
|
||||||
absl::optional<DataRate> probe_bitrate) {
|
|
||||||
if (LossBasedBandwidthEstimatorV1Enabled()) {
|
if (LossBasedBandwidthEstimatorV1Enabled()) {
|
||||||
loss_based_bandwidth_estimator_v1_.UpdateLossStatistics(
|
loss_based_bandwidth_estimator_v1_.UpdateLossStatistics(
|
||||||
report.packet_feedbacks, report.feedback_time);
|
report.packet_feedbacks, report.feedback_time);
|
||||||
}
|
}
|
||||||
if (LossBasedBandwidthEstimatorV2Enabled()) {
|
if (LossBasedBandwidthEstimatorV2Enabled()) {
|
||||||
loss_based_bandwidth_estimator_v2_.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator_v2_.UpdateBandwidthEstimate(
|
||||||
report.packet_feedbacks, delay_based_limit_, delay_detector_state,
|
report.packet_feedbacks, delay_based_limit_, delay_detector_state);
|
||||||
probe_bitrate);
|
|
||||||
UpdateEstimate(report.feedback_time);
|
UpdateEstimate(report.feedback_time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -526,11 +519,10 @@ void SendSideBandwidthEstimation::UpdateEstimate(Timestamp at_time) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (LossBasedBandwidthEstimatorV2ReadyForUse()) {
|
if (LossBasedBandwidthEstimatorV2ReadyForUse()) {
|
||||||
LossBasedBweV2::Result result =
|
DataRate new_bitrate =
|
||||||
loss_based_bandwidth_estimator_v2_.GetLossBasedResult(
|
loss_based_bandwidth_estimator_v2_.GetBandwidthEstimate(
|
||||||
delay_based_limit_);
|
delay_based_limit_);
|
||||||
loss_based_state_ = result.state;
|
UpdateTargetBitrate(new_bitrate, at_time);
|
||||||
UpdateTargetBitrate(result.bandwidth_estimate, at_time);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,6 @@ class SendSideBandwidthEstimation {
|
|||||||
void OnRouteChange();
|
void OnRouteChange();
|
||||||
|
|
||||||
DataRate target_rate() const;
|
DataRate target_rate() const;
|
||||||
LossBasedState loss_based_state() const;
|
|
||||||
DataRate delay_based_limit() const;
|
DataRate delay_based_limit() const;
|
||||||
uint8_t fraction_loss() const { return last_fraction_loss_; }
|
uint8_t fraction_loss() const { return last_fraction_loss_; }
|
||||||
TimeDelta round_trip_time() const { return last_round_trip_time_; }
|
TimeDelta round_trip_time() const { return last_round_trip_time_; }
|
||||||
@ -120,8 +119,7 @@ class SendSideBandwidthEstimation {
|
|||||||
void SetAcknowledgedRate(absl::optional<DataRate> acknowledged_rate,
|
void SetAcknowledgedRate(absl::optional<DataRate> acknowledged_rate,
|
||||||
Timestamp at_time);
|
Timestamp at_time);
|
||||||
void UpdateLossBasedEstimator(const TransportPacketsFeedback& report,
|
void UpdateLossBasedEstimator(const TransportPacketsFeedback& report,
|
||||||
BandwidthUsage delay_detector_state,
|
BandwidthUsage delay_detector_state);
|
||||||
absl::optional<DataRate> probe_bitrate);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class GoogCcStatePrinter;
|
friend class GoogCcStatePrinter;
|
||||||
@ -203,7 +201,6 @@ class SendSideBandwidthEstimation {
|
|||||||
DataRate bitrate_threshold_;
|
DataRate bitrate_threshold_;
|
||||||
LossBasedBandwidthEstimation loss_based_bandwidth_estimator_v1_;
|
LossBasedBandwidthEstimation loss_based_bandwidth_estimator_v1_;
|
||||||
LossBasedBweV2 loss_based_bandwidth_estimator_v2_;
|
LossBasedBweV2 loss_based_bandwidth_estimator_v2_;
|
||||||
LossBasedState loss_based_state_;
|
|
||||||
FieldTrialFlag disable_receiver_limit_caps_only_;
|
FieldTrialFlag disable_receiver_limit_caps_only_;
|
||||||
};
|
};
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
Reference in New Issue
Block a user