Move MovingAverage to rtc_base/numerics and update it.
This utility class is needed in rtcp_rtp. Instead of reimplementing it again, the existing class is moved to rtc_base, cleaned from unused features and extended as required for the new usage. Bug: webrtc:9914 Change-Id: I3b0d83d08d8fa5e1384b4721a93c6a90781948fd Reviewed-on: https://webrtc-review.googlesource.com/c/109081 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25498}
This commit is contained in:
committed by
Commit Bot
parent
a1ead6f2ab
commit
26341990a1
@ -173,8 +173,8 @@ void QualityScaler::CheckQp() {
|
||||
// If we have not observed at least this many frames we can't make a good
|
||||
// scaling decision.
|
||||
const size_t frames = config_.use_all_drop_reasons
|
||||
? framedrop_percent_all_.size()
|
||||
: framedrop_percent_media_opt_.size();
|
||||
? framedrop_percent_all_.Size()
|
||||
: framedrop_percent_media_opt_.Size();
|
||||
if (frames < kMinFramesNeededToScale) {
|
||||
observed_enough_frames_ = false;
|
||||
return;
|
||||
@ -183,8 +183,9 @@ void QualityScaler::CheckQp() {
|
||||
|
||||
// Check if we should scale down due to high frame drop.
|
||||
const absl::optional<int> drop_rate =
|
||||
config_.use_all_drop_reasons ? framedrop_percent_all_.GetAverage()
|
||||
: framedrop_percent_media_opt_.GetAverage();
|
||||
config_.use_all_drop_reasons
|
||||
? framedrop_percent_all_.GetAverageRoundedDown()
|
||||
: framedrop_percent_media_opt_.GetAverageRoundedDown();
|
||||
if (drop_rate && *drop_rate >= kFramedropPercentThreshold) {
|
||||
RTC_LOG(LS_INFO) << "Reporting high QP, framedrop percent " << *drop_rate;
|
||||
ReportQpHigh();
|
||||
@ -192,11 +193,12 @@ void QualityScaler::CheckQp() {
|
||||
}
|
||||
|
||||
// Check if we should scale up or down based on QP.
|
||||
const absl::optional<int> avg_qp_high = qp_smoother_high_
|
||||
? qp_smoother_high_->GetAvg()
|
||||
: average_qp_.GetAverage();
|
||||
const absl::optional<int> avg_qp_high =
|
||||
qp_smoother_high_ ? qp_smoother_high_->GetAvg()
|
||||
: average_qp_.GetAverageRoundedDown();
|
||||
const absl::optional<int> avg_qp_low =
|
||||
qp_smoother_low_ ? qp_smoother_low_->GetAvg() : average_qp_.GetAverage();
|
||||
qp_smoother_low_ ? qp_smoother_low_->GetAvg()
|
||||
: average_qp_.GetAverageRoundedDown();
|
||||
if (avg_qp_high && avg_qp_low) {
|
||||
RTC_LOG(LS_INFO) << "Checking average QP " << *avg_qp_high << " ("
|
||||
<< *avg_qp_low << ").";
|
||||
|
||||
Reference in New Issue
Block a user