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

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

Issue 1364253002: Implement a high-QP threshold for Android H.264. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 5 years, 3 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 f7d4651511297ae986f235297c7bc1af746ebd99..ec7715230ed46d17b36906d629608fc30e4da0e9 100644
--- a/webrtc/modules/video_coding/utility/quality_scaler.cc
+++ b/webrtc/modules/video_coding/utility/quality_scaler.cc
@@ -29,9 +29,12 @@ QualityScaler::QualityScaler()
min_height_(kDefaultMinDownscaleDimension) {
}
-void QualityScaler::Init(int low_qp_threshold, bool use_framerate_reduction) {
+void QualityScaler::Init(int low_qp_threshold,
+ int high_qp_threshold,
+ bool use_framerate_reduction) {
ClearSamples();
low_qp_threshold_ = low_qp_threshold;
+ high_qp_threshold_ = high_qp_threshold;
use_framerate_reduction_ = use_framerate_reduction;
target_framerate_ = -1;
}
@@ -70,8 +73,10 @@ void QualityScaler::OnEncodeFrame(const VideoFrame& frame) {
// When encoder consistently overshoots, framerate reduction and spatial
// resizing will be triggered to get a smoother video.
- if (framedrop_percent_.GetAverage(num_samples_, &avg_drop) &&
- avg_drop >= kFramedropPercentThreshold) {
+ if ((framedrop_percent_.GetAverage(num_samples_, &avg_drop) &&
+ avg_drop >= kFramedropPercentThreshold) ||
+ (average_qp_.GetAverage(num_samples_, &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.

Powered by Google App Engine
This is Rietveld 408576698