From 23a4d8522e6a959a03f790bdd2b548f16a9e3f23 Mon Sep 17 00:00:00 2001 From: "asapersson@webrtc.org" Date: Wed, 13 Aug 2014 14:33:49 +0000 Subject: [PATCH] Decreased kMaxOverusesBeforeApplyRampupDelay (from 7 to 4). Increased kStandardRampUpDelayMs (30 to 40s). BUG=1577 R=mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/20129004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6886 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/video_engine/overuse_frame_detector.cc | 4 ++-- .../video_engine/overuse_frame_detector_unittest.cc | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/webrtc/video_engine/overuse_frame_detector.cc b/webrtc/video_engine/overuse_frame_detector.cc index 6efb4be9c1..93375a766d 100644 --- a/webrtc/video_engine/overuse_frame_detector.cc +++ b/webrtc/video_engine/overuse_frame_detector.cc @@ -37,13 +37,13 @@ const float kWeightFactorMean = 0.98f; // Delay between consecutive rampups. (Used for quick recovery.) const int kQuickRampUpDelayMs = 10 * 1000; // Delay between rampup attempts. Initially uses standard, scales up to max. -const int kStandardRampUpDelayMs = 30 * 1000; +const int kStandardRampUpDelayMs = 40 * 1000; const int kMaxRampUpDelayMs = 240 * 1000; // Expontential back-off factor, to prevent annoying up-down behaviour. const double kRampUpBackoffFactor = 2.0; // Max number of overuses detected before always applying the rampup delay. -const int kMaxOverusesBeforeApplyRampupDelay = 7; +const int kMaxOverusesBeforeApplyRampupDelay = 4; // The maximum exponent to use in VCMExpFilter. const float kSampleDiffMs = 33.0f; diff --git a/webrtc/video_engine/overuse_frame_detector_unittest.cc b/webrtc/video_engine/overuse_frame_detector_unittest.cc index 4e5d4bda27..a1c7f496bd 100644 --- a/webrtc/video_engine/overuse_frame_detector_unittest.cc +++ b/webrtc/video_engine/overuse_frame_detector_unittest.cc @@ -130,9 +130,12 @@ class OveruseFrameDetectorTest : public ::testing::Test { } void TriggerNormalUsageWithEncodeTime() { - const int kEncodeTimeMs = 5; + const int kEncodeTimeMs1 = 5; + const int kEncodeTimeMs2 = 6; InsertAndEncodeFramesWithInterval( - 1000, kFrameInterval33ms, kWidth, kHeight, kEncodeTimeMs); + 1300, kFrameInterval33ms, kWidth, kHeight, kEncodeTimeMs1); + InsertAndEncodeFramesWithInterval( + 1, kFrameInterval33ms, kWidth, kHeight, kEncodeTimeMs2); overuse_detector_->Process(); } @@ -215,7 +218,7 @@ TEST_F(OveruseFrameDetectorTest, TriggerNormalUsageWithMinProcessCount) { overuse_detector_->SetObserver(&overuse_observer_); options_.min_process_count = 1; overuse_detector_->SetOptions(options_); - InsertFramesWithInterval(900, kFrameInterval33ms, kWidth, kHeight); + InsertFramesWithInterval(1200, kFrameInterval33ms, kWidth, kHeight); overuse_detector_->Process(); EXPECT_EQ(0, overuse_observer_.normaluse_); clock_->AdvanceTimeMilliseconds(kProcessIntervalMs); @@ -444,7 +447,7 @@ TEST_F(OveruseFrameDetectorTest, TriggerOveruseWithEncodeRsd) { TEST_F(OveruseFrameDetectorTest, OveruseAndRecoverWithEncodeRsd) { options_.enable_capture_jitter_method = false; options_.enable_encode_usage_method = true; - options_.low_encode_time_rsd_threshold = 20; + options_.low_encode_time_rsd_threshold = 25; options_.high_encode_time_rsd_threshold = 80; overuse_detector_->SetOptions(options_); // rsd > high, usage < high => overuse @@ -460,7 +463,7 @@ TEST_F(OveruseFrameDetectorTest, NoUnderuseWithEncodeRsd_UsageGtLowThreshold) { options_.enable_capture_jitter_method = false; options_.enable_encode_usage_method = true; options_.low_encode_usage_threshold_percent = 1; - options_.low_encode_time_rsd_threshold = 20; + options_.low_encode_time_rsd_threshold = 25; options_.high_encode_time_rsd_threshold = 90; overuse_detector_->SetOptions(options_); // rsd < low, usage > low => no underuse