Index: webrtc/modules/video_coding/utility/quality_scaler.cc |
diff --git a/webrtc/modules/video_coding/utility/quality_scaler.cc b/webrtc/modules/video_coding/utility/quality_scaler.cc |
index c6e566973101e01f1ec868f8810e614d7a3480e7..1f2a7c387316593150623a9c2de30c4e59f8044f 100644 |
--- a/webrtc/modules/video_coding/utility/quality_scaler.cc |
+++ b/webrtc/modules/video_coding/utility/quality_scaler.cc |
@@ -20,16 +20,14 @@ static const int kFramedropPercentThreshold = 60; |
static const int kHdResolutionThreshold = 700 * 500; |
static const int kHdBitrateThresholdKbps = 500; |
+// Min width/height to downscale to, set to not go below QVGA, but with some |
+// margin to permit "almost-QVGA" resolutions. |
+static const int kMinDownscaleDimension = 160; |
danilchap
2016/04/14 09:27:36
May be put kMinDownscaleDimension into the Quality
pbos-webrtc
2016/04/14 12:13:16
I'll keep it this way for now, since we have more
|
+ |
const int QualityScaler::kDefaultLowQpDenominator = 3; |
-// Note that this is the same for width and height to permit 120x90 in both |
-// portrait and landscape mode. |
-const int QualityScaler::kDefaultMinDownscaleDimension = 90; |
QualityScaler::QualityScaler() |
- : low_qp_threshold_(-1), |
- framerate_down_(false), |
- min_width_(kDefaultMinDownscaleDimension), |
- min_height_(kDefaultMinDownscaleDimension) {} |
+ : low_qp_threshold_(-1), framerate_down_(false) {} |
void QualityScaler::Init(int low_qp_threshold, |
int high_qp_threshold, |
@@ -65,11 +63,6 @@ void QualityScaler::Init(int low_qp_threshold, |
target_framerate_ = -1; |
} |
-void QualityScaler::SetMinResolution(int min_width, int min_height) { |
- min_width_ = min_width; |
- min_height_ = min_height; |
-} |
- |
// Report framerate(fps) to estimate # of samples. |
void QualityScaler::ReportFramerate(int framerate) { |
framerate_ = framerate; |
@@ -158,8 +151,8 @@ void QualityScaler::UpdateTargetResolution(int frame_width, int frame_height) { |
res_.width = frame_width; |
res_.height = frame_height; |
for (int shift = downscale_shift_; |
- shift > 0 && (res_.width / 2 >= min_width_) && |
- (res_.height / 2 >= min_height_); |
+ shift > 0 && (res_.width / 2 >= kMinDownscaleDimension) && |
+ (res_.height / 2 >= kMinDownscaleDimension); |
--shift) { |
res_.width /= 2; |
res_.height /= 2; |