Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1548)

Unified Diff: webrtc/modules/video_coding/utility/quality_scaler.cc

Issue 1867643003: Make QualityScaler not downscale below QVGA. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: update test Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c6a6ba2ea526c2a3a24969430be2dfe3c015d5a3 100644
--- a/webrtc/modules/video_coding/utility/quality_scaler.cc
+++ b/webrtc/modules/video_coding/utility/quality_scaler.cc
@@ -11,6 +11,7 @@
namespace webrtc {
+namespace {
static const int kMinFps = 5;
static const int kMeasureSecondsDownscale = 3;
// Threshold constant used until first downscale (to permit fast rampup).
@@ -19,17 +20,15 @@ static const int kMeasureSecondsUpscale = 5;
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, such as QCIF.
+static const int kMinDownscaleDimension = 140;
+} // namespace
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 +64,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 +152,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;
« no previous file with comments | « webrtc/modules/video_coding/utility/quality_scaler.h ('k') | webrtc/modules/video_coding/utility/quality_scaler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698