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

Unified Diff: talk/app/webrtc/java/jni/androidmediaencoder_jni.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
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
diff --git a/talk/app/webrtc/java/jni/androidmediaencoder_jni.cc b/talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
index f6a3b650a6b8aaf481fa941e3bbb777a09dc84b6..a25a3cc0efe223428f1375d2843ffc343cfde7cd 100644
--- a/talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
+++ b/talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
@@ -306,11 +306,18 @@ int32_t MediaCodecVideoEncoder::InitEncode(
// always = 127. Note that in SW, QP is that of the user-level range [0,
// 63].
const int kMaxQp = 127;
- quality_scaler_.Init(kMaxQp / kLowQpThresholdDenominator, true);
+ // TODO(pbos): Investigate whether high-QP thresholds make sense for VP8.
+ // This effectively disables high QP as VP8 QP can't go above this
+ // threshold.
+ const int kDisabledBadQpThreshold = kMaxQp + 1;
+ quality_scaler_.Init(kMaxQp / kLowQpThresholdDenominator,
+ kDisabledBadQpThreshold, true);
} else if (codecType_ == kVideoCodecH264) {
// H264 QP is in the range [0, 51].
const int kMaxQp = 51;
- quality_scaler_.Init(kMaxQp / kLowQpThresholdDenominator, true);
+ const int kBadQpThreshold = 40;
+ quality_scaler_.Init(kMaxQp / kLowQpThresholdDenominator, kBadQpThreshold,
+ false);
} else {
// When adding codec support to additional hardware codecs, also configure
// their QP thresholds for scaling.
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698