| Index: webrtc/modules/video_coding/qm_select.cc
|
| diff --git a/webrtc/modules/video_coding/qm_select.cc b/webrtc/modules/video_coding/qm_select.cc
|
| index a090ba1e333a51965c151a009902415f4374d221..9da42bb33c6e51652b972f4353d3818654cc737d 100644
|
| --- a/webrtc/modules/video_coding/qm_select.cc
|
| +++ b/webrtc/modules/video_coding/qm_select.cc
|
| @@ -898,4 +898,56 @@
|
| }
|
| }
|
|
|
| +// ROBUSTNESS CLASS
|
| +
|
| +VCMQmRobustness::VCMQmRobustness() {
|
| + Reset();
|
| +}
|
| +
|
| +VCMQmRobustness::~VCMQmRobustness() {}
|
| +
|
| +void VCMQmRobustness::Reset() {
|
| + prev_total_rate_ = 0.0f;
|
| + prev_rtt_time_ = 0;
|
| + prev_packet_loss_ = 0;
|
| + prev_code_rate_delta_ = 0;
|
| + ResetQM();
|
| +}
|
| +
|
| +// 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.
|
| +float VCMQmRobustness::AdjustFecFactor(uint8_t code_rate_delta,
|
| + float total_rate,
|
| + float framerate,
|
| + int64_t rtt_time,
|
| + uint8_t packet_loss) {
|
| + // Default: no adjustment
|
| + float adjust_fec = 1.0f;
|
| + if (content_metrics_ == NULL) {
|
| + return adjust_fec;
|
| + }
|
| + // Compute class state of the content.
|
| + ComputeMotionNFD();
|
| + ComputeSpatial();
|
| +
|
| + // 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.
|
| + prev_total_rate_ = total_rate;
|
| + prev_rtt_time_ = rtt_time;
|
| + prev_packet_loss_ = packet_loss;
|
| + prev_code_rate_delta_ = code_rate_delta;
|
| + return adjust_fec;
|
| +}
|
| +
|
| +// Set the UEP (unequal-protection across packets) on/off for the FEC.
|
| +bool VCMQmRobustness::SetUepProtection(uint8_t code_rate_delta,
|
| + float total_rate,
|
| + uint8_t packet_loss,
|
| + bool frame_type) {
|
| + // Default.
|
| + return false;
|
| +}
|
| } // namespace webrtc
|
|
|