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 445be08..ff84fe0 100644
--- a/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc
+++ b/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc
@@ -463,12 +463,6 @@
   FieldTrialParameter<bool>
       not_increase_if_inherent_loss_less_than_average_loss(
           "NotIncreaseIfInherentLossLessThanAverageLoss", true);
-  FieldTrialParameter<double> high_loss_rate_threshold("HighLossRateThreshold",
-                                                       1.0);
-  FieldTrialParameter<DataRate> bandwidth_cap_at_high_loss_rate(
-      "BandwidthCapAtHighLossRate", DataRate::KilobitsPerSec(500.0));
-  FieldTrialParameter<double> slope_of_bwe_high_loss_func(
-      "SlopeOfBweHighLossFunc", 1000);
   FieldTrialParameter<bool> not_use_acked_rate_in_alr("NotUseAckedRateInAlr",
                                                       true);
   FieldTrialParameter<bool> use_in_start_phase("UseInStartPhase", false);
@@ -509,9 +503,6 @@
                      &max_increase_factor,
                      &delayed_increase_window,
                      &not_increase_if_inherent_loss_less_than_average_loss,
-                     &high_loss_rate_threshold,
-                     &bandwidth_cap_at_high_loss_rate,
-                     &slope_of_bwe_high_loss_func,
                      &not_use_acked_rate_in_alr,
                      &use_in_start_phase,
                      &min_num_observations,
@@ -571,10 +562,6 @@
   config->delayed_increase_window = delayed_increase_window.Get();
   config->not_increase_if_inherent_loss_less_than_average_loss =
       not_increase_if_inherent_loss_less_than_average_loss.Get();
-  config->high_loss_rate_threshold = high_loss_rate_threshold.Get();
-  config->bandwidth_cap_at_high_loss_rate =
-      bandwidth_cap_at_high_loss_rate.Get();
-  config->slope_of_bwe_high_loss_func = slope_of_bwe_high_loss_func.Get();
   config->not_use_acked_rate_in_alr = not_use_acked_rate_in_alr.Get();
   config->use_in_start_phase = use_in_start_phase.Get();
   config->min_num_observations = min_num_observations.Get();
@@ -757,12 +744,6 @@
                         << config_->delayed_increase_window.ms();
     valid = false;
   }
-  if (config_->high_loss_rate_threshold <= 0.0 ||
-      config_->high_loss_rate_threshold > 1.0) {
-    RTC_LOG(LS_WARNING) << "The high loss rate threshold must be in (0, 1]: "
-                        << config_->high_loss_rate_threshold;
-    valid = false;
-  }
   if (config_->min_num_observations <= 0) {
     RTC_LOG(LS_WARNING) << "The min number of observations must be positive: "
                         << config_->min_num_observations;
@@ -1058,14 +1039,6 @@
     instant_limit = config_->instant_upper_bound_bandwidth_balance /
                     (average_reported_loss_ratio -
                      config_->instant_upper_bound_loss_offset);
-    if (average_reported_loss_ratio > config_->high_loss_rate_threshold) {
-      instant_limit = std::min(
-          instant_limit, DataRate::KilobitsPerSec(std::max(
-                             static_cast<double>(min_bitrate_.kbps()),
-                             config_->bandwidth_cap_at_high_loss_rate.kbps() -
-                                 config_->slope_of_bwe_high_loss_func *
-                                     average_reported_loss_ratio)));
-    }
   }
 
   cached_instant_upper_bound_ = instant_limit;
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 228d598..2170ab8 100644
--- a/modules/congestion_controller/goog_cc/loss_based_bwe_v2.h
+++ b/modules/congestion_controller/goog_cc/loss_based_bwe_v2.h
@@ -114,9 +114,6 @@
     double max_increase_factor = 0.0;
     TimeDelta delayed_increase_window = TimeDelta::Zero();
     bool not_increase_if_inherent_loss_less_than_average_loss = false;
-    double high_loss_rate_threshold = 1.0;
-    DataRate bandwidth_cap_at_high_loss_rate = DataRate::MinusInfinity();
-    double slope_of_bwe_high_loss_func = 1000.0;
     bool not_use_acked_rate_in_alr = false;
     bool use_in_start_phase = false;
     int min_num_observations = 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 16aefcc..2399108 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
@@ -1054,164 +1054,6 @@
       DataRate::KilobitsPerSec(600));
 }
 
-TEST_F(LossBasedBweV2Test,
-       StricterBoundUsingHighLossRateThresholdAt10pLossRate) {
-  ExplicitKeyValueConfig key_value_config(
-      ShortObservationConfig("HighLossRateThreshold:0.09"));
-  LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
-  loss_based_bandwidth_estimator.SetMinMaxBitrate(
-      /*min_bitrate=*/DataRate::KilobitsPerSec(10),
-      /*max_bitrate=*/DataRate::KilobitsPerSec(1000000));
-  DataRate delay_based_estimate = DataRate::KilobitsPerSec(5000);
-  loss_based_bandwidth_estimator.SetBandwidthEstimate(
-      DataRate::KilobitsPerSec(600));
-
-  std::vector<PacketResult> enough_feedback_10p_loss_1 =
-      CreatePacketResultsWith10pPacketLossRate(
-          /*first_packet_timestamp=*/Timestamp::Zero());
-  loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
-      enough_feedback_10p_loss_1, delay_based_estimate,
-
-      /*in_alr=*/false);
-
-  std::vector<PacketResult> enough_feedback_10p_loss_2 =
-      CreatePacketResultsWith10pPacketLossRate(
-          /*first_packet_timestamp=*/Timestamp::Zero() +
-          kObservationDurationLowerBound);
-  loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
-      enough_feedback_10p_loss_2, delay_based_estimate,
-
-      /*in_alr=*/false);
-
-  // At 10% loss rate and high loss rate threshold to be 10%, cap the estimate
-  // to be 500 * 1000-0.1 = 400kbps.
-  EXPECT_EQ(
-      loss_based_bandwidth_estimator.GetLossBasedResult().bandwidth_estimate,
-      DataRate::KilobitsPerSec(400));
-}
-
-TEST_F(LossBasedBweV2Test,
-       StricterBoundUsingHighLossRateThresholdAt50pLossRate) {
-  ExplicitKeyValueConfig key_value_config(
-      ShortObservationConfig("HighLossRateThreshold:0.3"));
-  LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
-  loss_based_bandwidth_estimator.SetMinMaxBitrate(
-      /*min_bitrate=*/DataRate::KilobitsPerSec(10),
-      /*max_bitrate=*/DataRate::KilobitsPerSec(1000000));
-  DataRate delay_based_estimate = DataRate::KilobitsPerSec(5000);
-  loss_based_bandwidth_estimator.SetBandwidthEstimate(
-      DataRate::KilobitsPerSec(600));
-
-  std::vector<PacketResult> enough_feedback_50p_loss_1 =
-      CreatePacketResultsWith50pPacketLossRate(
-          /*first_packet_timestamp=*/Timestamp::Zero());
-  loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
-      enough_feedback_50p_loss_1, delay_based_estimate,
-
-      /*in_alr=*/false);
-
-  std::vector<PacketResult> enough_feedback_50p_loss_2 =
-      CreatePacketResultsWith50pPacketLossRate(
-          /*first_packet_timestamp=*/Timestamp::Zero() +
-          kObservationDurationLowerBound);
-  loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
-      enough_feedback_50p_loss_2, delay_based_estimate,
-
-      /*in_alr=*/false);
-
-  // At 50% loss rate and high loss rate threshold to be 30%, cap the estimate
-  // to be the min bitrate.
-  EXPECT_EQ(
-      loss_based_bandwidth_estimator.GetLossBasedResult().bandwidth_estimate,
-      DataRate::KilobitsPerSec(10));
-}
-
-TEST_F(LossBasedBweV2Test,
-       StricterBoundUsingHighLossRateThresholdAt100pLossRate) {
-  ExplicitKeyValueConfig key_value_config(
-      ShortObservationConfig("HighLossRateThreshold:0.3"));
-  LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
-  loss_based_bandwidth_estimator.SetMinMaxBitrate(
-      /*min_bitrate=*/DataRate::KilobitsPerSec(10),
-      /*max_bitrate=*/DataRate::KilobitsPerSec(1000000));
-  DataRate delay_based_estimate = DataRate::KilobitsPerSec(5000);
-  loss_based_bandwidth_estimator.SetBandwidthEstimate(
-      DataRate::KilobitsPerSec(600));
-
-  std::vector<PacketResult> enough_feedback_100p_loss_1 =
-      CreatePacketResultsWith100pLossRate(
-          /*first_packet_timestamp=*/Timestamp::Zero());
-  loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
-      enough_feedback_100p_loss_1, delay_based_estimate,
-
-      /*in_alr=*/false);
-
-  std::vector<PacketResult> enough_feedback_100p_loss_2 =
-      CreatePacketResultsWith100pLossRate(
-          /*first_packet_timestamp=*/Timestamp::Zero() +
-          kObservationDurationLowerBound);
-  loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
-      enough_feedback_100p_loss_2, delay_based_estimate,
-
-      /*in_alr=*/false);
-
-  // At 100% loss rate and high loss rate threshold to be 30%, cap the estimate
-  // to be the min bitrate.
-  EXPECT_EQ(
-      loss_based_bandwidth_estimator.GetLossBasedResult().bandwidth_estimate,
-      DataRate::KilobitsPerSec(10));
-}
-
-TEST_F(LossBasedBweV2Test, EstimateRecoversAfterHighLoss) {
-  ExplicitKeyValueConfig key_value_config(
-      ShortObservationConfig("HighLossRateThreshold:0.3"));
-  LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
-  loss_based_bandwidth_estimator.SetMinMaxBitrate(
-      /*min_bitrate=*/DataRate::KilobitsPerSec(10),
-      /*max_bitrate=*/DataRate::KilobitsPerSec(1000000));
-  DataRate delay_based_estimate = DataRate::KilobitsPerSec(5000);
-  loss_based_bandwidth_estimator.SetBandwidthEstimate(
-      DataRate::KilobitsPerSec(600));
-
-  std::vector<PacketResult> enough_feedback_100p_loss_1 =
-      CreatePacketResultsWith100pLossRate(
-          /*first_packet_timestamp=*/Timestamp::Zero());
-  loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
-      enough_feedback_100p_loss_1, delay_based_estimate,
-
-      /*in_alr=*/false);
-
-  // Make sure that the estimate is set to min bitrate because of 100% loss
-  // rate.
-  EXPECT_EQ(
-      loss_based_bandwidth_estimator.GetLossBasedResult().bandwidth_estimate,
-      DataRate::KilobitsPerSec(10));
-
-  // Create some feedbacks with 0 loss rate to simulate network recovering.
-  std::vector<PacketResult> enough_feedback_0p_loss_1 =
-      CreatePacketResultsWithReceivedPackets(
-          /*first_packet_timestamp=*/Timestamp::Zero() +
-          kObservationDurationLowerBound);
-  loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
-      enough_feedback_0p_loss_1, delay_based_estimate,
-
-      /*in_alr=*/false);
-
-  std::vector<PacketResult> enough_feedback_0p_loss_2 =
-      CreatePacketResultsWithReceivedPackets(
-          /*first_packet_timestamp=*/Timestamp::Zero() +
-          kObservationDurationLowerBound * 2);
-  loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
-      enough_feedback_0p_loss_2, delay_based_estimate,
-
-      /*in_alr=*/false);
-
-  // The estimate increases as network recovers.
-  EXPECT_GT(
-      loss_based_bandwidth_estimator.GetLossBasedResult().bandwidth_estimate,
-      DataRate::KilobitsPerSec(10));
-}
-
 TEST_F(LossBasedBweV2Test, EstimateIsNotHigherThanMaxBitrate) {
   ExplicitKeyValueConfig key_value_config(
       Config(/*enabled=*/true, /*valid=*/true));
