Move the QP scaling thresholds to the relevant encoders.
Also provide a new set of thresholds for the VideoToolbox encoder. The new thresholds were experimentally determined to work well on the iPhone 6S, and also adequately on the iPhone 5S.
BUG=webrtc:5678
Review-Url: https://codereview.webrtc.org/2309743002
Cr-Commit-Position: refs/heads/master@{#14420}
diff --git a/webrtc/api/android/jni/androidmediaencoder_jni.cc b/webrtc/api/android/jni/androidmediaencoder_jni.cc
index 8d0d3b5..e84b850 100644
--- a/webrtc/api/android/jni/androidmediaencoder_jni.cc
+++ b/webrtc/api/android/jni/androidmediaencoder_jni.cc
@@ -395,16 +395,9 @@
ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled");
if (scale_) {
- if (codecType_ == kVideoCodecVP8) {
- quality_scaler_.Init(
- QualityScaler::kLowVp8QpThreshold, QualityScaler::kBadVp8QpThreshold,
- codec_settings->startBitrate, codec_settings->width,
- codec_settings->height, codec_settings->maxFramerate);
- } else if (codecType_ == kVideoCodecH264) {
- quality_scaler_.Init(QualityScaler::kLowH264QpThreshold,
- QualityScaler::kBadH264QpThreshold,
- codec_settings->startBitrate, codec_settings->width,
- codec_settings->height,
+ if (codecType_ == kVideoCodecVP8 || codecType_ == kVideoCodecH264) {
+ quality_scaler_.Init(codecType_, codec_settings->startBitrate,
+ codec_settings->width, codec_settings->height,
codec_settings->maxFramerate);
} else {
// When adding codec support to additional hardware codecs, also configure