From 3f28061f3a62025f06f585e15c3f8c79b4e75099 Mon Sep 17 00:00:00 2001 From: "marpan@google.com" Date: Fri, 9 Sep 2011 16:39:40 +0000 Subject: [PATCH] media_opt_util: Modification to correction factor in FEC overhead. Review URL: http://webrtc-codereview.appspot.com/133019 git-svn-id: http://webrtc.googlecode.com/svn/trunk@573 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../video_coding/main/source/media_opt_util.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 70d2f837c..f74ab5eb3 100644 --- a/src/modules/video_coding/main/source/media_opt_util.cc +++ b/src/modules/video_coding/main/source/media_opt_util.cc @@ -305,6 +305,10 @@ VCMFecMethod::ProtectionFactor(const VCMProtectionParameters* parameters) // First partition protection: ~ 20% WebRtc_UWord8 firstPartitionProt = (WebRtc_UWord8) (255 * 0.20); + // Minimum protection level needed to generate one FEC packet for one + // source packet/frame (in RTP sender) + WebRtc_UWord8 minProtLevelFec = 85; + // Threshold on packetLoss and bitRrate/frameRate (=average #packets), // above which we allocate protection to cover at least first partition. WebRtc_UWord8 lossThr = 0; @@ -437,17 +441,17 @@ VCMFecMethod::ProtectionFactor(const VCMProtectionParameters* parameters) // 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. + // for cases of low rates (small #packets) and low protection levels. const float estNumFecGen = 0.5f + static_cast (_protectionFactorD * avgTotPackets / 255.0f); - // Note we reduce cost factor (which will reduce overhead for FEC and + // We reduce cost factor (which will reduce overhead for FEC and // hybrid method) and not the protectionFactor. _corrFecCost = 1.0f; - if (estNumFecGen < 1.5f) + if (estNumFecGen < 1.5f && _protectionFactorD < minProtLevelFec) { _corrFecCost = 0.5f; } - if (estNumFecGen < 1.0f) + if (estNumFecGen < 0.9f && _protectionFactorD < minProtLevelFec) { _corrFecCost = 0.0f; }