VCM: removing max jitter estimate

BUG= 1921
R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1690004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4249 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mikhal@webrtc.org
2013-06-20 20:13:07 +00:00
parent 0851df8d60
commit 9ca7360b97
6 changed files with 2 additions and 64 deletions

View File

@@ -842,11 +842,6 @@ void VCMJitterBuffer::FindAndInsertContinuousFrames(
}
}
void VCMJitterBuffer::SetMaxJitterEstimate(bool enable) {
CriticalSectionScoped cs(crit_sect_);
jitter_estimate_.SetMaxJitterEstimate(enable);
}
uint32_t VCMJitterBuffer::EstimatedJitterMs() {
CriticalSectionScoped cs(crit_sect_);
// Compute RTT multiplier for estimation.

View File

@@ -143,10 +143,6 @@ class VCMJitterBuffer {
VCMFrameBufferEnum InsertPacket(const VCMPacket& packet,
bool* retransmitted);
// Enable a max filter on the jitter estimate by setting an initial
// non-zero delay.
void SetMaxJitterEstimate(bool enable);
// Returns the estimated jitter in milliseconds.
uint32_t EstimatedJitterMs();

View File

@@ -1384,26 +1384,6 @@ TEST_F(TestRunningJitterBuffer, EmptyPackets) {
EXPECT_FALSE(request_key_frame);
}
TEST_F(TestRunningJitterBuffer, JitterEstimateMode) {
bool request_key_frame = false;
// Default value (should be in kLastEstimate mode).
InsertFrame(kVideoFrameKey);
EXPECT_FALSE(request_key_frame);
InsertFrame(kVideoFrameDelta);
EXPECT_FALSE(request_key_frame);
EXPECT_GT(20u, jitter_buffer_->EstimatedJitterMs());
jitter_buffer_->SetMaxJitterEstimate(true);
InsertFrame(kVideoFrameDelta);
EXPECT_FALSE(request_key_frame);
// Jitter cannot decrease.
InsertFrames(2, kVideoFrameDelta);
EXPECT_FALSE(request_key_frame);
uint32_t je1 = jitter_buffer_->EstimatedJitterMs();
InsertFrames(2, kVideoFrameDelta);
EXPECT_FALSE(request_key_frame);
EXPECT_GE(je1, jitter_buffer_->EstimatedJitterMs());
}
TEST_F(TestRunningJitterBuffer, StatisticsTest) {
uint32_t num_delta_frames = 0;
uint32_t num_key_frames = 0;

View File

@@ -33,10 +33,7 @@ _numStdDevFrameSizeOutlier(3),
_noiseStdDevs(2.33), // ~Less than 1% chance
// (look up in normal distribution table)...
_noiseStdDevOffset(30.0), // ...of getting 30 ms freezes
_rttFilter(vcmId, receiverId),
_jitterEstimateMode(kLastEstimate),
_maxJitterEstimateMs(0)
{
_rttFilter(vcmId, receiverId) {
Reset();
}
@@ -64,8 +61,6 @@ VCMJitterEstimator::operator=(const VCMJitterEstimator& rhs)
_startupCount = rhs._startupCount;
_latestNackTimestamp = rhs._latestNackTimestamp;
_nackCount = rhs._nackCount;
_jitterEstimateMode = rhs._jitterEstimateMode;
_maxJitterEstimateMs = rhs._maxJitterEstimateMs;
_rttFilter = rhs._rttFilter;
}
return *this;
@@ -405,15 +400,6 @@ VCMJitterEstimator::UpdateMaxFrameSize(uint32_t frameSizeBytes)
}
}
void VCMJitterEstimator::SetMaxJitterEstimate(bool enable)
{
if (enable) {
_jitterEstimateMode = kMaxEstimate;
} else {
_jitterEstimateMode = kLastEstimate;
}
}
// Returns the current filtered estimate if available,
// otherwise tries to calculate an estimate.
int
@@ -428,13 +414,7 @@ VCMJitterEstimator::GetJitterEstimate(double rttMultiplier)
{
jitterMS += _rttFilter.RttMs() * rttMultiplier;
}
int jitterMsInt = static_cast<uint32_t>(jitterMS + 0.5);
if (_jitterEstimateMode == kLastEstimate) {
return jitterMsInt;
} else {
_maxJitterEstimateMs = VCM_MAX(_maxJitterEstimateMs, jitterMsInt);
return _maxJitterEstimateMs;
}
return static_cast<uint32_t>(jitterMS + 0.5);
}
}

View File

@@ -17,12 +17,6 @@
namespace webrtc
{
enum VCMJitterEstimateMode
{
kMaxEstimate,
kLastEstimate,
};
class VCMJitterEstimator
{
public:
@@ -64,10 +58,6 @@ public:
void UpdateMaxFrameSize(uint32_t frameSizeBytes);
// Set a max filter on the jitter estimate. When disabled (default), the
// last jitter estimate will be used.
void SetMaxJitterEstimate(bool enable);
// A constant describing the delay from the jitter buffer
// to the delay on the receiving side which is not accounted
// for by the jitter buffer nor the decoding delay estimate.
@@ -154,8 +144,6 @@ private:
uint32_t _nackCount; // Keeps track of the number of nacks received,
// but never goes above _nackLimit
VCMRttFilter _rttFilter;
VCMJitterEstimateMode _jitterEstimateMode;
int _maxJitterEstimateMs;
enum { kStartupDelaySamples = 30 };
enum { kFsAccuStartupSamples = 5 };

View File

@@ -329,7 +329,6 @@ int VCMReceiver::SetMinReceiverDelay(int desired_delay_ms) {
if (desired_delay_ms < 0 || desired_delay_ms > kMaxReceiverDelayMs) {
return -1;
}
jitter_buffer_.SetMaxJitterEstimate(desired_delay_ms > 0);
max_video_delay_ms_ = desired_delay_ms + kMaxVideoDelayMs;
// Initializing timing to the desired delay.
timing_->set_min_playout_delay(desired_delay_ms);