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
diff --git a/webrtc/video_engine/overuse_frame_detector.cc b/webrtc/video_engine/overuse_frame_detector.cc
index 6efb4be..93375a7 100644
--- a/webrtc/video_engine/overuse_frame_detector.cc
+++ b/webrtc/video_engine/overuse_frame_detector.cc
@@ -37,13 +37,13 @@
// 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 4e5d4bd..a1c7f49 100644
--- a/webrtc/video_engine/overuse_frame_detector_unittest.cc
+++ b/webrtc/video_engine/overuse_frame_detector_unittest.cc
@@ -130,9 +130,12 @@
}
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 @@
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, 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 @@
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