Rounding error fix in media_opt_util.

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3351 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
marpan@webrtc.org
2013-01-09 22:13:19 +00:00
parent a5e7e76def
commit ef1a760446

View File

@ -309,8 +309,10 @@ VCMFecMethod::AvgRecoveryFEC(const VCMProtectionParameters* parameters) const
const float protectionFactor = static_cast<float>(_protectionFactorD) /
255.0;
// Round down for estimated #FEC packets/frame, to keep
// |fecPacketsPerFrame| <= |sourcePacketsPerFrame|.
WebRtc_UWord8 fecPacketsPerFrame = static_cast<WebRtc_UWord8>
(0.5 + protectionFactor * avgTotPackets);
(protectionFactor * avgTotPackets);
WebRtc_UWord8 sourcePacketsPerFrame = avgTotPackets - fecPacketsPerFrame;