Add ability to configure quality scaler settings through field trial.

optional<int> min_frames: The minimum number frames to observe to make a
                          scaling decision.
Default: kMinFramesNeededToScale in quality_scaler.cc

optional<double> initial_scale_factor: The sample period scale factor.
Default: kSamplePeriodScaleFactor in quality_scaler.cc

optional<double> scale_factor: Option to use a reduced sampling interval when
                               last check did not result in an adaptation (if
                               unset the initial_scale_factor is used).

Bug: none
Change-Id: I3bb955d1f8d7d7d49bc118361614b5aa59605231
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135125
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27860}
This commit is contained in:
Åsa Persson
2019-05-06 14:17:35 +02:00
committed by Commit Bot
parent cfff652c82
commit 517678cc49
7 changed files with 222 additions and 5 deletions

View File

@ -15,6 +15,7 @@
#include <stdint.h>
#include <memory>
#include "absl/types/optional.h"
#include "api/video_codecs/video_encoder.h"
#include "rtc_base/experiments/quality_scaling_experiment.h"
#include "rtc_base/numerics/moving_average.h"
@ -93,6 +94,11 @@ class QualityScaler {
std::unique_ptr<QpSmoother> qp_smoother_high_ RTC_GUARDED_BY(&task_checker_);
std::unique_ptr<QpSmoother> qp_smoother_low_ RTC_GUARDED_BY(&task_checker_);
bool observed_enough_frames_ RTC_GUARDED_BY(&task_checker_);
const size_t min_frames_needed_;
const double initial_scale_factor_;
const absl::optional<double> scale_factor_;
bool last_adapted_ RTC_GUARDED_BY(&task_checker_);
};
} // namespace webrtc