Revert of Remove VCMQmRobustness. (patchset #1 id:1 of https://codereview.webrtc.org/1917083003/ )
Reason for revert: Speculative revert for perf regression. Original issue's description: > Remove VCMQmRobustness. > > Class contained a lot of not-really-wired-up functionality that ended up > being complicated ways of saying return 1; or return false;. This > removes this dependency that complicates code readability significantly. > > BUG=webrtc:5066 > R=marpan@google.com, marpan@webrtc.org > TBR=stefan@webrtc.org > > Committed: https://crrev.com/73894369791cb5eedc8788baf918ec07d11d351d > Cr-Commit-Position: refs/heads/master@{#12516} TBR=marpan@webrtc.org,stefan@webrtc.org,marpan@google.com # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=webrtc:5066, chromium:607838 Review-Url: https://codereview.webrtc.org/1935753002 Cr-Commit-Position: refs/heads/master@{#12572}
This commit is contained in:
@ -898,4 +898,56 @@ void VCMQmResolution::SelectSpatialDirectionMode(float transition_rate) {
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user