diff --git a/modules/video_coding/timing/jitter_estimator.cc b/modules/video_coding/timing/jitter_estimator.cc index aaccf3d808..0bb56bb15d 100644 --- a/modules/video_coding/timing/jitter_estimator.cc +++ b/modules/video_coding/timing/jitter_estimator.cc @@ -52,8 +52,6 @@ JitterEstimator::JitterEstimator(Clock* clock, const FieldTrialsView& field_trials) : fps_counter_(30), // TODO(sprang): Use an estimator with limit based on // time, rather than number of samples. - enable_reduced_delay_( - !field_trials.IsEnabled("WebRTC-ReducedJitterDelayKillSwitch")), clock_(clock) { Reset(); } @@ -374,24 +372,22 @@ TimeDelta JitterEstimator::GetJitterEstimate( } } - if (enable_reduced_delay_) { - static const Frequency kJitterScaleLowThreshold = Frequency::Hertz(5); - static const Frequency kJitterScaleHighThreshold = Frequency::Hertz(10); - Frequency fps = GetFrameRate(); - // Ignore jitter for very low fps streams. - if (fps < kJitterScaleLowThreshold) { - if (fps.IsZero()) { - return std::max(TimeDelta::Zero(), jitter); - } - return TimeDelta::Zero(); + static const Frequency kJitterScaleLowThreshold = Frequency::Hertz(5); + static const Frequency kJitterScaleHighThreshold = Frequency::Hertz(10); + Frequency fps = GetFrameRate(); + // Ignore jitter for very low fps streams. + if (fps < kJitterScaleLowThreshold) { + if (fps.IsZero()) { + return std::max(TimeDelta::Zero(), jitter); } + return TimeDelta::Zero(); + } - // Semi-low frame rate; scale by factor linearly interpolated from 0.0 at - // kJitterScaleLowThreshold to 1.0 at kJitterScaleHighThreshold. - if (fps < kJitterScaleHighThreshold) { - jitter = (1.0 / (kJitterScaleHighThreshold - kJitterScaleLowThreshold)) * - (fps - kJitterScaleLowThreshold) * jitter; - } + // Semi-low frame rate; scale by factor linearly interpolated from 0.0 at + // kJitterScaleLowThreshold to 1.0 at kJitterScaleHighThreshold. + if (fps < kJitterScaleHighThreshold) { + jitter = (1.0 / (kJitterScaleHighThreshold - kJitterScaleLowThreshold)) * + (fps - kJitterScaleLowThreshold) * jitter; } return std::max(TimeDelta::Zero(), jitter); diff --git a/modules/video_coding/timing/jitter_estimator.h b/modules/video_coding/timing/jitter_estimator.h index 5150ef568d..7d84601b87 100644 --- a/modules/video_coding/timing/jitter_estimator.h +++ b/modules/video_coding/timing/jitter_estimator.h @@ -148,7 +148,6 @@ class JitterEstimator { // Tracks frame rates in microseconds. rtc::RollingAccumulator fps_counter_; - const bool enable_reduced_delay_; Clock* clock_; }; diff --git a/modules/video_coding/timing/jitter_estimator_unittest.cc b/modules/video_coding/timing/jitter_estimator_unittest.cc index 2001e1670a..f442dbb62d 100644 --- a/modules/video_coding/timing/jitter_estimator_unittest.cc +++ b/modules/video_coding/timing/jitter_estimator_unittest.cc @@ -65,9 +65,9 @@ class ValueGenerator { int64_t counter_; }; -// 5 fps, disable jitter delay altogether. TEST_F(TestJitterEstimator, TestLowRate) { ValueGenerator gen(10); + // At 5 fps, we disable jitter delay altogether. TimeDelta time_delta = 1 / Frequency::Hertz(5); for (int i = 0; i < 60; ++i) { estimator_->UpdateEstimate(gen.Delay(), gen.FrameSize()); @@ -79,23 +79,6 @@ TEST_F(TestJitterEstimator, TestLowRate) { } } -TEST_F(TestJitterEstimator, TestLowRateDisabled) { - test::ScopedKeyValueConfig field_trials( - field_trials_, "WebRTC-ReducedJitterDelayKillSwitch/Enabled/"); - SetUp(); - - ValueGenerator gen(10); - TimeDelta time_delta = 1 / Frequency::Hertz(5); - for (int i = 0; i < 60; ++i) { - estimator_->UpdateEstimate(gen.Delay(), gen.FrameSize()); - fake_clock_.AdvanceTime(time_delta); - if (i > 2) - EXPECT_GT(estimator_->GetJitterEstimate(0, absl::nullopt), - TimeDelta::Zero()); - gen.Advance(); - } -} - TEST_F(TestJitterEstimator, RttMultAddCap) { std::vector> jitter_by_rtt_mult_cap;