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

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

Issue 1885893002: Remove QualityScaler framerate reduction. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase 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 5b2e94b88d53e85dd36c3b30da7c4b33a5c298a8..30a5776b2d05b6d92495e67dfb75743972809854 100644
--- a/webrtc/modules/video_coding/utility/quality_scaler.cc
+++ b/webrtc/modules/video_coding/utility/quality_scaler.cc
@@ -30,12 +30,10 @@ static const int kQvgaBitrateThresholdKbps = 250;
static const int kQvgaNumPixels = 400 * 300; // 320x240
} // namespace
-QualityScaler::QualityScaler()
- : low_qp_threshold_(-1), framerate_down_(false) {}
+QualityScaler::QualityScaler() : low_qp_threshold_(-1) {}
void QualityScaler::Init(int low_qp_threshold,
int high_qp_threshold,
- bool use_framerate_reduction,
int initial_bitrate_kbps,
int width,
int height,
@@ -43,7 +41,6 @@ void QualityScaler::Init(int low_qp_threshold,
ClearSamples();
low_qp_threshold_ = low_qp_threshold;
high_qp_threshold_ = high_qp_threshold;
- use_framerate_reduction_ = use_framerate_reduction;
downscale_shift_ = 0;
// Use a faster window for upscaling initially (but be more graceful later).
// This enables faster initial rampups without risking strong up-down
@@ -65,7 +62,6 @@ void QualityScaler::Init(int low_qp_threshold,
}
UpdateTargetResolution(init_width, init_height);
ReportFramerate(fps);
- target_framerate_ = -1;
}
// Report framerate(fps) to estimate # of samples.
@@ -94,34 +90,14 @@ void QualityScaler::OnEncodeFrame(const VideoFrame& frame) {
int avg_drop = 0;
int avg_qp = 0;
- // When encoder consistently overshoots, framerate reduction and spatial
- // resizing will be triggered to get a smoother video.
if ((framedrop_percent_.GetAverage(num_samples_downscale_, &avg_drop) &&
avg_drop >= kFramedropPercentThreshold) ||
(average_qp_downscale_.GetAverage(num_samples_downscale_, &avg_qp) &&
avg_qp > high_qp_threshold_)) {
- // Reducing frame rate before spatial resolution change.
- // Reduce frame rate only when it is above a certain number.
- // Only one reduction is allowed for now.
- // TODO(jackychen): Allow more than one framerate reduction.
- if (use_framerate_reduction_ && !framerate_down_ && framerate_ >= 20) {
- target_framerate_ = framerate_ / 2;
- framerate_down_ = true;
- // If frame rate has been updated, clear the buffer. We don't want
- // spatial resolution to change right after frame rate change.
- ClearSamples();
- } else {
- AdjustScale(false);
- }
+ AdjustScale(false);
} else if (average_qp_upscale_.GetAverage(num_samples_upscale_, &avg_qp) &&
avg_qp <= low_qp_threshold_) {
- if (use_framerate_reduction_ && framerate_down_) {
- target_framerate_ = -1;
- framerate_down_ = false;
- ClearSamples();
- } else {
- AdjustScale(true);
- }
+ AdjustScale(true);
}
UpdateTargetResolution(frame.width(), frame.height());
}
@@ -130,10 +106,6 @@ QualityScaler::Resolution QualityScaler::GetScaledResolution() const {
return res_;
}
-int QualityScaler::GetTargetFramerate() const {
- return target_framerate_;
-}
-
const VideoFrame& QualityScaler::GetScaledFrame(const VideoFrame& frame) {
Resolution res = GetScaledResolution();
if (res.width == frame.width())
« 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