Change to return no adjustment (default) if content_metrics=NULL,

and return true (default) for UEP flag if content_metrics=NULL.
Also parameter name change and get function for UEP in media_opt_util.
Review URL: http://webrtc-codereview.appspot.com/70002

git-svn-id: http://webrtc.googlecode.com/svn/trunk@199 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
marpan@google.com
2011-07-13 17:19:49 +00:00
parent 75e1239266
commit 59fd0f12e6
4 changed files with 40 additions and 29 deletions

View File

@@ -734,28 +734,24 @@ VCMQmRobustness::Reset()
// Adjust the FEC rate based on the content and the network state
// (packet loss rate, total rate/bandwidth, round trip time).
// Note that packetLoss here is the filtered loss value.
WebRtc_UWord8
float
VCMQmRobustness::AdjustFecFactor(WebRtc_UWord8 codeRateDelta, float totalRate,
float frameRate,WebRtc_UWord32 rttTime,
WebRtc_UWord8 packetLoss)
{
// Default: no adjustment
float adjustFec = 1.0f;
if (_contentMetrics == NULL)
{
return VCM_OK;
return adjustFec;
}
// Default: no adjustment
WebRtc_UWord8 codeRateDeltaAdjust = codeRateDelta;
float adjustFec = 1.0f;
// Compute class state of the content.
MotionNFD();
Spatial();
// TODO (marpan):
// Set FEC adjustment factor
codeRateDeltaAdjust = static_cast<WebRtc_UWord8>(codeRateDelta * adjustFec);
// TODO (marpan): Set FEC adjustment factor
// Keep track of previous values of network state:
// adjustment may be also based on pattern of changes in network state
@@ -765,7 +761,8 @@ VCMQmRobustness::AdjustFecFactor(WebRtc_UWord8 codeRateDelta, float totalRate,
_prevCodeRateDelta = codeRateDelta;
return codeRateDeltaAdjust;
return adjustFec;
}
// Set the UEP (unequal-protection) on/off for the FEC
@@ -773,13 +770,14 @@ bool
VCMQmRobustness::SetUepProtection(WebRtc_UWord8 codeRateDelta, float totalRate,
WebRtc_UWord8 packetLoss, bool frameType)
{
// Default:
bool uepProtection = true;
if (_contentMetrics == NULL)
{
return VCM_OK;
return uepProtection;
}
// Default: UEP on
bool uepProtection = true;
return uepProtection;
}