From f1f3fb33b5a38a1251fd5a16e5f58cab91c82667 Mon Sep 17 00:00:00 2001 From: "marpan@google.com" Date: Mon, 3 Oct 2011 19:09:45 +0000 Subject: [PATCH] Update to rate-mismatch factor in media_opt_util. Review URL: http://webrtc-codereview.appspot.com/193003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@678 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/video_coding/main/source/media_opt_util.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/video_coding/main/source/media_opt_util.cc b/src/modules/video_coding/main/source/media_opt_util.cc index f74ab5eb3..c17374698 100644 --- a/src/modules/video_coding/main/source/media_opt_util.cc +++ b/src/modules/video_coding/main/source/media_opt_util.cc @@ -442,12 +442,18 @@ VCMFecMethod::ProtectionFactor(const VCMProtectionParameters* parameters) // 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 (small #packets) and low protection levels. + + float numPacketsFl = 1.0f + ((float) bitRatePerFrame * 1000.0 + / (float) (8.0 * _maxPayloadSize) + 0.5); + const float estNumFecGen = 0.5f + static_cast (_protectionFactorD * - avgTotPackets / 255.0f); + numPacketsFl / 255.0f); + + // We reduce cost factor (which will reduce overhead for FEC and // hybrid method) and not the protectionFactor. _corrFecCost = 1.0f; - if (estNumFecGen < 1.5f && _protectionFactorD < minProtLevelFec) + if (estNumFecGen < 1.1f && _protectionFactorD < minProtLevelFec) { _corrFecCost = 0.5f; }