| Index: webrtc/api/java/jni/androidmediaencoder_jni.cc
|
| diff --git a/webrtc/api/java/jni/androidmediaencoder_jni.cc b/webrtc/api/java/jni/androidmediaencoder_jni.cc
|
| index ddfa85affaea178ac9a5a5e52d30cc315deba8ab..e4c4d65e6970d6340ebab6216a412928dd4a4120 100644
|
| --- a/webrtc/api/java/jni/androidmediaencoder_jni.cc
|
| +++ b/webrtc/api/java/jni/androidmediaencoder_jni.cc
|
| @@ -355,7 +355,6 @@ int32_t MediaCodecVideoEncoder::InitEncode(
|
| size_t /* max_payload_size */) {
|
| const int kMinWidth = 320;
|
| const int kMinHeight = 180;
|
| - const int kLowQpThresholdDenominator = 3;
|
| if (codec_settings == NULL) {
|
| ALOGE << "NULL VideoCodec instance";
|
| return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
|
| @@ -376,16 +375,18 @@ int32_t MediaCodecVideoEncoder::InitEncode(
|
| // (internal) range: [0, 127]. And we cannot change QP_max in HW, so it is
|
| // always = 127. Note that in SW, QP is that of the user-level range [0,
|
| // 63].
|
| - const int kMaxQp = 127;
|
| - const int kBadQpThreshold = 95;
|
| - quality_scaler_.Init(
|
| - kMaxQp / kLowQpThresholdDenominator, kBadQpThreshold, false);
|
| + const int kLowQpThreshold = 32;
|
| + const int kBadQpThreshold = 92;
|
| + quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false,
|
| + codec_settings->startBitrate,
|
| + codec_settings->width, codec_settings->height);
|
| } else if (codecType_ == kVideoCodecH264) {
|
| // H264 QP is in the range [0, 51].
|
| - const int kMaxQp = 51;
|
| + const int kLowQpThreshold = 17;
|
| const int kBadQpThreshold = 40;
|
| - quality_scaler_.Init(
|
| - kMaxQp / kLowQpThresholdDenominator, kBadQpThreshold, false);
|
| + quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false,
|
| + codec_settings->startBitrate,
|
| + codec_settings->width, codec_settings->height);
|
| } else {
|
| // When adding codec support to additional hardware codecs, also configure
|
| // their QP thresholds for scaling.
|
|
|