Make QualityScaler not downscale below QVGA.
Applies to all platforms, not only Android now, 160x90 video looks
awful and there's no real point to going below QVGA.
BUG=webrtc:5678
R=danilchap@webrtc.org
TBR=glaznev@webrtc.org
Review URL: https://codereview.webrtc.org/1867643003 .
Cr-Commit-Position: refs/heads/master@{#12362}
diff --git a/webrtc/api/java/jni/androidmediaencoder_jni.cc b/webrtc/api/java/jni/androidmediaencoder_jni.cc
index 593554e..d9d7a80 100644
--- a/webrtc/api/java/jni/androidmediaencoder_jni.cc
+++ b/webrtc/api/java/jni/androidmediaencoder_jni.cc
@@ -352,7 +352,6 @@
const webrtc::VideoCodec* codec_settings,
int32_t /* number_of_cores */,
size_t /* max_payload_size */) {
- const int kMinDimension = 180;
if (codec_settings == NULL) {
ALOGE << "NULL VideoCodec instance";
return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
@@ -396,10 +395,9 @@
RTC_NOTREACHED() << "Unsupported codec without configured QP thresholds.";
scale_ = false;
}
- quality_scaler_.SetMinResolution(kMinDimension, kMinDimension);
QualityScaler::Resolution res = quality_scaler_.GetScaledResolution();
- init_width = std::max(res.width, kMinDimension);
- init_height = std::max(res.height, kMinDimension);
+ init_width = res.width;
+ init_height = res.height;
ALOGD << "Scaled resolution: " << init_width << " x " << init_height;
}