Adding a max jitter filter to the JB estimate - allowing two modes, one will return the last estimate (current setting), and another will return the max value seen, and allow setting an initial value.

This cl also includes tests and some clean up.

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3445 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mikhal@webrtc.org
2013-01-31 17:18:02 +00:00
parent e07c661a29
commit 119c67df36
6 changed files with 132 additions and 66 deletions

View File

@ -764,21 +764,23 @@ VCMFrameBufferEnum VCMJitterBuffer::InsertPacket(VCMEncodedFrame* encoded_frame,
return ret;
}
void VCMJitterBuffer::EnableMaxJitterEstimate(bool enable,
uint32_t initial_delay_ms) {
CriticalSectionScoped cs(crit_sect_);
jitter_estimate_.EnableMaxJitterEstimate(enable, initial_delay_ms);
}
uint32_t VCMJitterBuffer::EstimatedJitterMs() {
CriticalSectionScoped cs(crit_sect_);
uint32_t estimate = VCMJitterEstimator::OPERATING_SYSTEM_JITTER;
// Compute RTT multiplier for estimation
// Compute RTT multiplier for estimation.
// low_rtt_nackThresholdMs_ == -1 means no FEC.
double rtt_mult = 1.0f;
if (nack_mode_ == kNackHybrid && (low_rtt_nack_threshold_ms_ >= 0 &&
static_cast<int>(rtt_ms_) > low_rtt_nack_threshold_ms_)) {
// from here we count on FEC
// From here we count on FEC.
rtt_mult = 0.0f;
}
estimate += static_cast<uint32_t>
(jitter_estimate_.GetJitterEstimate(rtt_mult) + 0.5);
return estimate;
return jitter_estimate_.GetJitterEstimate(rtt_mult);
}
void VCMJitterBuffer::UpdateRtt(uint32_t rtt_ms) {