Add field trial for rampup in quality based on available bandwidth.

Bug: none
Change-Id: I32e1ea6fb2f2e20fc631e09b02c8f3a11b6c9fac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158888
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29751}
This commit is contained in:
Åsa Persson
2019-11-08 15:56:00 +01:00
committed by Commit Bot
parent a4c1aaad8d
commit e644a03195
12 changed files with 412 additions and 2 deletions

View File

@ -166,6 +166,21 @@ void QualityScaler::ReportQp(int qp, int64_t time_sent_us) {
qp_smoother_low_->Add(qp, time_sent_us);
}
bool QualityScaler::QpFastFilterLow() const {
RTC_DCHECK_RUN_ON(&task_checker_);
size_t num_frames = config_.use_all_drop_reasons
? framedrop_percent_all_.Size()
: framedrop_percent_media_opt_.Size();
const size_t kMinNumFrames = 10;
if (num_frames < kMinNumFrames) {
return false; // Wait for more frames before making a decision.
}
absl::optional<int> avg_qp_high = qp_smoother_high_
? qp_smoother_high_->GetAvg()
: average_qp_.GetAverageRoundedDown();
return (avg_qp_high) ? (avg_qp_high.value() <= thresholds_.low) : false;
}
void QualityScaler::CheckQp() {
RTC_DCHECK_RUN_ON(&task_checker_);
// Should be set through InitEncode -> Should be set by now.

View File

@ -64,6 +64,7 @@ class QualityScaler {
void ReportQp(int qp, int64_t time_sent_us);
void SetQpThresholds(VideoEncoder::QpThresholds thresholds);
bool QpFastFilterLow() const;
// The following members declared protected for testing purposes.
protected: