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

Unified Diff: webrtc/api/android/jni/androidmediaencoder_jni.cc

Issue 2309743002: Move the QP scaling thresholds to the relevant encoders (Closed)
Patch Set: Created 4 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/api/android/jni/androidmediaencoder_jni.cc
diff --git a/webrtc/api/android/jni/androidmediaencoder_jni.cc b/webrtc/api/android/jni/androidmediaencoder_jni.cc
index 8d0d3b54bd512557401dcf652b94d62d930388f4..47dc07ee01b95f9e74628412917fe178bcd3a974 100644
--- a/webrtc/api/android/jni/androidmediaencoder_jni.cc
+++ b/webrtc/api/android/jni/androidmediaencoder_jni.cc
@@ -86,6 +86,12 @@ namespace {
// Maximum time limit between incoming frames before requesting a key frame.
const size_t kFrameDiffThresholdMs = 1100;
const int kMinKeyFrameInterval = 2;
+
+const int kLowVp8QpThreshold = 29;
+const int kHighVp8QpThreshold = 95;
+
+const int kLowH264QpThreshold = 24;
+const int kHighH264QpThreshold = 37;
} // namespace
// MediaCodecVideoEncoder is a webrtc::VideoEncoder implementation that uses
@@ -397,12 +403,12 @@ int32_t MediaCodecVideoEncoder::InitEncode(
if (scale_) {
if (codecType_ == kVideoCodecVP8) {
quality_scaler_.Init(
- QualityScaler::kLowVp8QpThreshold, QualityScaler::kBadVp8QpThreshold,
+ kLowVp8QpThreshold, kHighVp8QpThreshold,
codec_settings->startBitrate, codec_settings->width,
codec_settings->height, codec_settings->maxFramerate);
} else if (codecType_ == kVideoCodecH264) {
- quality_scaler_.Init(QualityScaler::kLowH264QpThreshold,
- QualityScaler::kBadH264QpThreshold,
+ quality_scaler_.Init(kLowH264QpThreshold,
+ kHighH264QpThreshold,
codec_settings->startBitrate, codec_settings->width,
codec_settings->height,
codec_settings->maxFramerate);

Powered by Google App Engine
This is Rietveld 408576698