Added a correction factor to FEC overhead in media_opt_util.
This is too handle cases of rate-mismatch (at low rates/low packet number) between estimate in mediaOpt and actual FEC generated in RTP. Review URL: http://webrtc-codereview.appspot.com/93012 git-svn-id: http://webrtc.googlecode.com/svn/trunk@284 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
f1ed5ad038
commit
191b780741
@ -114,7 +114,7 @@ VCMNackFecMethod::UpdateParameters(const VCMProtectionParameters* parameters)
|
|||||||
|
|
||||||
// Add FEC cost: ignore I frames for now
|
// Add FEC cost: ignore I frames for now
|
||||||
float fecRate = static_cast<float> (_protectionFactorD) / 255.0f;
|
float fecRate = static_cast<float> (_protectionFactorD) / 255.0f;
|
||||||
_efficiency = parameters->bitRate * fecRate;
|
_efficiency = parameters->bitRate * fecRate * _corrFecCost;
|
||||||
|
|
||||||
// Add NACK cost, when applicable
|
// Add NACK cost, when applicable
|
||||||
if (parameters->rtt < kHighRttNackMs)
|
if (parameters->rtt < kHighRttNackMs)
|
||||||
@ -430,6 +430,27 @@ VCMFecMethod::ProtectionFactor(const VCMProtectionParameters* parameters)
|
|||||||
_protectionFactorK = codeRateKey;
|
_protectionFactorK = codeRateKey;
|
||||||
_protectionFactorD = codeRateDelta;
|
_protectionFactorD = codeRateDelta;
|
||||||
|
|
||||||
|
// Generally there is a rate mis-match between the FEC cost estimated
|
||||||
|
// in mediaOpt and the actual FEC cost sent out in RTP module.
|
||||||
|
// This is more significant at low rates (small # of source packets), where
|
||||||
|
// the granularity of the FEC decreases. In this case, non-zero protection
|
||||||
|
// in mediaOpt may generate 0 FEC packets in RTP sender (since actual #FEC
|
||||||
|
// is based on rounding off protectionFactor on actual source packet number).
|
||||||
|
// The correction factor (_corrFecCost) attempts to corrects this, at least
|
||||||
|
// for cases of low rates/low # of packets.
|
||||||
|
const float estNumFecGen = 0.5f + static_cast<float> (_protectionFactorD *
|
||||||
|
avgTotPackets / 255.0f);
|
||||||
|
// Note we reduce cost factor (which will reduce overhead for FEC and
|
||||||
|
// hybrid method) and not the protectionFactor.
|
||||||
|
_corrFecCost = 1.0f;
|
||||||
|
if (estNumFecGen < 1.5f)
|
||||||
|
{
|
||||||
|
_corrFecCost = 0.5f;
|
||||||
|
}
|
||||||
|
if (estNumFecGen < 1.0f)
|
||||||
|
{
|
||||||
|
_corrFecCost = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO (marpan): Set the UEP protection on/off for Key and Delta frames
|
// TODO (marpan): Set the UEP protection on/off for Key and Delta frames
|
||||||
_useUepProtectionK = _qmRobustness->SetUepProtection(codeRateKey, bitRate,
|
_useUepProtectionK = _qmRobustness->SetUepProtection(codeRateKey, bitRate,
|
||||||
@ -485,7 +506,7 @@ VCMFecMethod::UpdateParameters(const VCMProtectionParameters* parameters)
|
|||||||
|
|
||||||
// in the new tables, the fecRate is defined relative to total number of
|
// in the new tables, the fecRate is defined relative to total number of
|
||||||
// packets (total rate), so overhead cost is:
|
// packets (total rate), so overhead cost is:
|
||||||
_efficiency = parameters->bitRate * fecRate;
|
_efficiency = parameters->bitRate * fecRate * _corrFecCost;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -92,8 +92,8 @@ public:
|
|||||||
VCMProtectionMethod(VCMProtectionMethodEnum type) : _effectivePacketLoss(0),
|
VCMProtectionMethod(VCMProtectionMethodEnum type) : _effectivePacketLoss(0),
|
||||||
_protectionFactorK(0), _protectionFactorD(0),
|
_protectionFactorK(0), _protectionFactorD(0),
|
||||||
_residualPacketLossFec(0.0), _scaleProtKey(2.0), _maxPayloadSize(1460),
|
_residualPacketLossFec(0.0), _scaleProtKey(2.0), _maxPayloadSize(1460),
|
||||||
_useUepProtectionK(false), _useUepProtectionD(true), _efficiency(0),
|
_useUepProtectionK(false), _useUepProtectionD(true), _corrFecCost(1.0),
|
||||||
_type(type)
|
_efficiency(0), _type(type)
|
||||||
{_qmRobustness = new VCMQmRobustness();}
|
{_qmRobustness = new VCMQmRobustness();}
|
||||||
|
|
||||||
virtual ~VCMProtectionMethod() { delete _qmRobustness;}
|
virtual ~VCMProtectionMethod() { delete _qmRobustness;}
|
||||||
@ -157,6 +157,7 @@ public:
|
|||||||
VCMQmRobustness* _qmRobustness;
|
VCMQmRobustness* _qmRobustness;
|
||||||
bool _useUepProtectionK;
|
bool _useUepProtectionK;
|
||||||
bool _useUepProtectionD;
|
bool _useUepProtectionD;
|
||||||
|
float _corrFecCost;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float _efficiency;
|
float _efficiency;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user