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:
@@ -842,11 +842,6 @@ void VCMJitterBuffer::FindAndInsertContinuousFrames(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VCMJitterBuffer::SetMaxJitterEstimate(bool enable) {
|
|
||||||
CriticalSectionScoped cs(crit_sect_);
|
|
||||||
jitter_estimate_.SetMaxJitterEstimate(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t VCMJitterBuffer::EstimatedJitterMs() {
|
uint32_t VCMJitterBuffer::EstimatedJitterMs() {
|
||||||
CriticalSectionScoped cs(crit_sect_);
|
CriticalSectionScoped cs(crit_sect_);
|
||||||
// Compute RTT multiplier for estimation.
|
// Compute RTT multiplier for estimation.
|
||||||
|
@@ -143,10 +143,6 @@ class VCMJitterBuffer {
|
|||||||
VCMFrameBufferEnum InsertPacket(const VCMPacket& packet,
|
VCMFrameBufferEnum InsertPacket(const VCMPacket& packet,
|
||||||
bool* retransmitted);
|
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.
|
// Returns the estimated jitter in milliseconds.
|
||||||
uint32_t EstimatedJitterMs();
|
uint32_t EstimatedJitterMs();
|
||||||
|
|
||||||
|
@@ -1384,26 +1384,6 @@ TEST_F(TestRunningJitterBuffer, EmptyPackets) {
|
|||||||
EXPECT_FALSE(request_key_frame);
|
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) {
|
TEST_F(TestRunningJitterBuffer, StatisticsTest) {
|
||||||
uint32_t num_delta_frames = 0;
|
uint32_t num_delta_frames = 0;
|
||||||
uint32_t num_key_frames = 0;
|
uint32_t num_key_frames = 0;
|
||||||
|
@@ -33,10 +33,7 @@ _numStdDevFrameSizeOutlier(3),
|
|||||||
_noiseStdDevs(2.33), // ~Less than 1% chance
|
_noiseStdDevs(2.33), // ~Less than 1% chance
|
||||||
// (look up in normal distribution table)...
|
// (look up in normal distribution table)...
|
||||||
_noiseStdDevOffset(30.0), // ...of getting 30 ms freezes
|
_noiseStdDevOffset(30.0), // ...of getting 30 ms freezes
|
||||||
_rttFilter(vcmId, receiverId),
|
_rttFilter(vcmId, receiverId) {
|
||||||
_jitterEstimateMode(kLastEstimate),
|
|
||||||
_maxJitterEstimateMs(0)
|
|
||||||
{
|
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,8 +61,6 @@ VCMJitterEstimator::operator=(const VCMJitterEstimator& rhs)
|
|||||||
_startupCount = rhs._startupCount;
|
_startupCount = rhs._startupCount;
|
||||||
_latestNackTimestamp = rhs._latestNackTimestamp;
|
_latestNackTimestamp = rhs._latestNackTimestamp;
|
||||||
_nackCount = rhs._nackCount;
|
_nackCount = rhs._nackCount;
|
||||||
_jitterEstimateMode = rhs._jitterEstimateMode;
|
|
||||||
_maxJitterEstimateMs = rhs._maxJitterEstimateMs;
|
|
||||||
_rttFilter = rhs._rttFilter;
|
_rttFilter = rhs._rttFilter;
|
||||||
}
|
}
|
||||||
return *this;
|
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,
|
// Returns the current filtered estimate if available,
|
||||||
// otherwise tries to calculate an estimate.
|
// otherwise tries to calculate an estimate.
|
||||||
int
|
int
|
||||||
@@ -428,13 +414,7 @@ VCMJitterEstimator::GetJitterEstimate(double rttMultiplier)
|
|||||||
{
|
{
|
||||||
jitterMS += _rttFilter.RttMs() * rttMultiplier;
|
jitterMS += _rttFilter.RttMs() * rttMultiplier;
|
||||||
}
|
}
|
||||||
int jitterMsInt = static_cast<uint32_t>(jitterMS + 0.5);
|
return static_cast<uint32_t>(jitterMS + 0.5);
|
||||||
if (_jitterEstimateMode == kLastEstimate) {
|
|
||||||
return jitterMsInt;
|
|
||||||
} else {
|
|
||||||
_maxJitterEstimateMs = VCM_MAX(_maxJitterEstimateMs, jitterMsInt);
|
|
||||||
return _maxJitterEstimateMs;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -17,12 +17,6 @@
|
|||||||
namespace webrtc
|
namespace webrtc
|
||||||
{
|
{
|
||||||
|
|
||||||
enum VCMJitterEstimateMode
|
|
||||||
{
|
|
||||||
kMaxEstimate,
|
|
||||||
kLastEstimate,
|
|
||||||
};
|
|
||||||
|
|
||||||
class VCMJitterEstimator
|
class VCMJitterEstimator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -64,10 +58,6 @@ public:
|
|||||||
|
|
||||||
void UpdateMaxFrameSize(uint32_t frameSizeBytes);
|
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
|
// A constant describing the delay from the jitter buffer
|
||||||
// to the delay on the receiving side which is not accounted
|
// to the delay on the receiving side which is not accounted
|
||||||
// for by the jitter buffer nor the decoding delay estimate.
|
// 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,
|
uint32_t _nackCount; // Keeps track of the number of nacks received,
|
||||||
// but never goes above _nackLimit
|
// but never goes above _nackLimit
|
||||||
VCMRttFilter _rttFilter;
|
VCMRttFilter _rttFilter;
|
||||||
VCMJitterEstimateMode _jitterEstimateMode;
|
|
||||||
int _maxJitterEstimateMs;
|
|
||||||
|
|
||||||
enum { kStartupDelaySamples = 30 };
|
enum { kStartupDelaySamples = 30 };
|
||||||
enum { kFsAccuStartupSamples = 5 };
|
enum { kFsAccuStartupSamples = 5 };
|
||||||
|
@@ -329,7 +329,6 @@ int VCMReceiver::SetMinReceiverDelay(int desired_delay_ms) {
|
|||||||
if (desired_delay_ms < 0 || desired_delay_ms > kMaxReceiverDelayMs) {
|
if (desired_delay_ms < 0 || desired_delay_ms > kMaxReceiverDelayMs) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
jitter_buffer_.SetMaxJitterEstimate(desired_delay_ms > 0);
|
|
||||||
max_video_delay_ms_ = desired_delay_ms + kMaxVideoDelayMs;
|
max_video_delay_ms_ = desired_delay_ms + kMaxVideoDelayMs;
|
||||||
// Initializing timing to the desired delay.
|
// Initializing timing to the desired delay.
|
||||||
timing_->set_min_playout_delay(desired_delay_ms);
|
timing_->set_min_playout_delay(desired_delay_ms);
|
||||||
|
Reference in New Issue
Block a user