| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 ALOGD << "InitEncode request: " << init_width << " x " << init_height; | 369 ALOGD << "InitEncode request: " << init_width << " x " << init_height; |
| 370 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); | 370 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); |
| 371 | 371 |
| 372 if (scale_) { | 372 if (scale_) { |
| 373 if (codecType_ == kVideoCodecVP8) { | 373 if (codecType_ == kVideoCodecVP8) { |
| 374 // QP is obtained from VP8-bitstream for HW, so the QP corresponds to the | 374 // QP is obtained from VP8-bitstream for HW, so the QP corresponds to the |
| 375 // (internal) range: [0, 127]. And we cannot change QP_max in HW, so it is | 375 // (internal) range: [0, 127]. And we cannot change QP_max in HW, so it is |
| 376 // always = 127. Note that in SW, QP is that of the user-level range [0, | 376 // always = 127. Note that in SW, QP is that of the user-level range [0, |
| 377 // 63]. | 377 // 63]. |
| 378 const int kLowQpThreshold = 29; | 378 const int kLowQpThreshold = 29; |
| 379 const int kBadQpThreshold = 90; | 379 const int kBadQpThreshold = 100; |
| 380 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, | 380 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, |
| 381 codec_settings->startBitrate, codec_settings->width, | 381 codec_settings->startBitrate, codec_settings->width, |
| 382 codec_settings->height, | 382 codec_settings->height, |
| 383 codec_settings->maxFramerate); | 383 codec_settings->maxFramerate); |
| 384 } else if (codecType_ == kVideoCodecH264) { | 384 } else if (codecType_ == kVideoCodecH264) { |
| 385 // H264 QP is in the range [0, 51]. | 385 // H264 QP is in the range [0, 51]. |
| 386 const int kLowQpThreshold = 21; | 386 const int kLowQpThreshold = 24; |
| 387 const int kBadQpThreshold = 33; | 387 const int kBadQpThreshold = 39; |
| 388 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, | 388 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, |
| 389 codec_settings->startBitrate, codec_settings->width, | 389 codec_settings->startBitrate, codec_settings->width, |
| 390 codec_settings->height, | 390 codec_settings->height, |
| 391 codec_settings->maxFramerate); | 391 codec_settings->maxFramerate); |
| 392 } else { | 392 } else { |
| 393 // When adding codec support to additional hardware codecs, also configure | 393 // When adding codec support to additional hardware codecs, also configure |
| 394 // their QP thresholds for scaling. | 394 // their QP thresholds for scaling. |
| 395 RTC_NOTREACHED() << "Unsupported codec without configured QP thresholds."; | 395 RTC_NOTREACHED() << "Unsupported codec without configured QP thresholds."; |
| 396 scale_ = false; | 396 scale_ = false; |
| 397 } | 397 } |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 return supported_codecs_; | 1250 return supported_codecs_; |
| 1251 } | 1251 } |
| 1252 | 1252 |
| 1253 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1253 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
| 1254 webrtc::VideoEncoder* encoder) { | 1254 webrtc::VideoEncoder* encoder) { |
| 1255 ALOGD << "Destroy video encoder."; | 1255 ALOGD << "Destroy video encoder."; |
| 1256 delete encoder; | 1256 delete encoder; |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 } // namespace webrtc_jni | 1259 } // namespace webrtc_jni |
| OLD | NEW |