From 17642c0db96aa6ee03af4319fc7895bb314e89a9 Mon Sep 17 00:00:00 2001 From: Per K Date: Wed, 25 Sep 2024 07:33:13 +0000 Subject: [PATCH] Add posibility to scale max_allocated bitrate when deciding to skip probe. Add field trial parameter for setting scale factor of max allocated bitrate used for deciding when to skip probing. Currently, a factor of 2 is used in most places for max allocated bitrate but not if the field trial skip_estimate_larger_than_fraction_of_max is used. The purpose of this new field parameter is to be able to harmonize and always use the same factor. Bug: webrtc:42224658 Change-Id: I5e1580b9bb18ef881b819affc0b4038094e94316 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363400 Reviewed-by: Diep Bui Commit-Queue: Per Kjellander Cr-Commit-Position: refs/heads/main@{#43078} --- .../congestion_controller/goog_cc/probe_controller.cc | 10 +++++++--- .../congestion_controller/goog_cc/probe_controller.h | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/congestion_controller/goog_cc/probe_controller.cc b/modules/congestion_controller/goog_cc/probe_controller.cc index adf71aa0c7..5e9fb1e7cf 100644 --- a/modules/congestion_controller/goog_cc/probe_controller.cc +++ b/modules/congestion_controller/goog_cc/probe_controller.cc @@ -116,7 +116,8 @@ ProbeControllerConfig::ProbeControllerConfig( loss_limited_probe_scale("loss_limited_scale", 1.5), skip_if_estimate_larger_than_fraction_of_max( "skip_if_est_larger_than_fraction_of_max", - 0.0) { + 0.0), + skip_probe_max_allocated_scale("skip_max_allocated_scale", 1.0) { ParseFieldTrial({&first_exponential_probe_scale, &second_exponential_probe_scale, &further_exponential_probe_scale, @@ -140,7 +141,8 @@ ProbeControllerConfig::ProbeControllerConfig( &network_state_probe_duration, &min_probe_packets_sent, &loss_limited_probe_scale, - &skip_if_estimate_larger_than_fraction_of_max}, + &skip_if_estimate_larger_than_fraction_of_max, + &skip_probe_max_allocated_scale}, key_value_config->Lookup("WebRTC-Bwe-ProbingConfiguration")); // Specialized keys overriding subsets of WebRTC-Bwe-ProbingConfiguration @@ -554,7 +556,9 @@ std::vector ProbeController::InitiateProbing( DataRate max_probe_rate = max_total_allocated_bitrate_.IsZero() ? max_bitrate_ - : std::min(max_total_allocated_bitrate_, max_bitrate_); + : std::min(config_.skip_probe_max_allocated_scale * + max_total_allocated_bitrate_, + max_bitrate_); if (std::min(network_estimate, estimated_bitrate_) > config_.skip_if_estimate_larger_than_fraction_of_max * max_probe_rate) { UpdateState(State::kProbingComplete); diff --git a/modules/congestion_controller/goog_cc/probe_controller.h b/modules/congestion_controller/goog_cc/probe_controller.h index 7d769da99b..a66aa1bfce 100644 --- a/modules/congestion_controller/goog_cc/probe_controller.h +++ b/modules/congestion_controller/goog_cc/probe_controller.h @@ -82,8 +82,11 @@ struct ProbeControllerConfig { FieldTrialParameter min_probe_delta; FieldTrialParameter loss_limited_probe_scale; // Don't send a probe if min(estimate, network state estimate) is larger than - // this fraction of the set max bitrate. + // this fraction of the set max or max allocated bitrate. FieldTrialParameter skip_if_estimate_larger_than_fraction_of_max; + // Scale factor of the max allocated bitrate. Used when deciding if a probe + // can be skiped due to that the estimate is already high enough. + FieldTrialParameter skip_probe_max_allocated_scale; }; // Reason that bandwidth estimate is limited. Bandwidth estimate can be limited