Move default thresholds from QualityScaler to encoders.

Overriding implementations of VideoEncoder::GetScalingSettings that
want to enable quality scaling must now provide the thresholds.

Bug: webrtc:8830
Change-Id: I75c47cb56ac1b9cf77401684980b3167e485f51c
Reviewed-on: https://webrtc-review.googlesource.com/46622
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22172}
This commit is contained in:
Niels Möller
2018-02-22 15:03:53 +01:00
committed by Commit Bot
parent 12fb17035c
commit 225c787c6e
16 changed files with 140 additions and 102 deletions

View File

@ -31,6 +31,10 @@ namespace {
const bool kOpenH264EncoderDetailedLogging = false;
// QP scaling thresholds.
static const int kLowH264QpThreshold = 24;
static const int kHighH264QpThreshold = 37;
// Used by histograms. Values of entries should not be changed.
enum H264EncoderImplEvent {
kH264EncoderEventInit = 0,
@ -503,7 +507,8 @@ int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) {
}
VideoEncoder::ScalingSettings H264EncoderImpl::GetScalingSettings() const {
return VideoEncoder::ScalingSettings(true);
return VideoEncoder::ScalingSettings(kLowH264QpThreshold,
kHighH264QpThreshold);
}
} // namespace webrtc