| 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 // (internal) range: [0, 127]. And we cannot change QP_max in HW, so it is | 380 // (internal) range: [0, 127]. And we cannot change QP_max in HW, so it is |
| 381 // always = 127. Note that in SW, QP is that of the user-level range [0, | 381 // always = 127. Note that in SW, QP is that of the user-level range [0, |
| 382 // 63]. | 382 // 63]. |
| 383 const int kLowQpThreshold = 32; | 383 const int kLowQpThreshold = 32; |
| 384 const int kBadQpThreshold = 92; | 384 const int kBadQpThreshold = 92; |
| 385 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, | 385 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, |
| 386 codec_settings->startBitrate, | 386 codec_settings->startBitrate, |
| 387 codec_settings->width, codec_settings->height); | 387 codec_settings->width, codec_settings->height); |
| 388 } else if (codecType_ == kVideoCodecH264) { | 388 } else if (codecType_ == kVideoCodecH264) { |
| 389 // H264 QP is in the range [0, 51]. | 389 // H264 QP is in the range [0, 51]. |
| 390 const int kLowQpThreshold = 17; | 390 const int kLowQpThreshold = 21; |
| 391 const int kBadQpThreshold = 40; | 391 const int kBadQpThreshold = 36; |
| 392 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, | 392 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, |
| 393 codec_settings->startBitrate, | 393 codec_settings->startBitrate, |
| 394 codec_settings->width, codec_settings->height); | 394 codec_settings->width, codec_settings->height); |
| 395 } else { | 395 } else { |
| 396 // When adding codec support to additional hardware codecs, also configure | 396 // When adding codec support to additional hardware codecs, also configure |
| 397 // their QP thresholds for scaling. | 397 // their QP thresholds for scaling. |
| 398 RTC_NOTREACHED() << "Unsupported codec without configured QP thresholds."; | 398 RTC_NOTREACHED() << "Unsupported codec without configured QP thresholds."; |
| 399 scale_ = false; | 399 scale_ = false; |
| 400 } | 400 } |
| 401 quality_scaler_.SetMinResolution(kMinWidth, kMinHeight); | 401 quality_scaler_.SetMinResolution(kMinWidth, kMinHeight); |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 } | 1260 } |
| 1261 | 1261 |
| 1262 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1262 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
| 1263 webrtc::VideoEncoder* encoder) { | 1263 webrtc::VideoEncoder* encoder) { |
| 1264 ALOGD << "Destroy video encoder."; | 1264 ALOGD << "Destroy video encoder."; |
| 1265 delete encoder; | 1265 delete encoder; |
| 1266 } | 1266 } |
| 1267 | 1267 |
| 1268 } // namespace webrtc_jni | 1268 } // namespace webrtc_jni |
| 1269 | 1269 |
| OLD | NEW |