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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 370 |
371 ALOGD << "InitEncode request: " << init_width << " x " << init_height; | 371 ALOGD << "InitEncode request: " << init_width << " x " << init_height; |
372 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); | 372 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); |
373 | 373 |
374 if (scale_) { | 374 if (scale_) { |
375 if (codecType_ == kVideoCodecVP8) { | 375 if (codecType_ == kVideoCodecVP8) { |
376 // QP is obtained from VP8-bitstream for HW, so the QP corresponds to the | 376 // QP is obtained from VP8-bitstream for HW, so the QP corresponds to the |
377 // (internal) range: [0, 127]. And we cannot change QP_max in HW, so it is | 377 // (internal) range: [0, 127]. And we cannot change QP_max in HW, so it is |
378 // always = 127. Note that in SW, QP is that of the user-level range [0, | 378 // always = 127. Note that in SW, QP is that of the user-level range [0, |
379 // 63]. | 379 // 63]. |
380 const int kLowQpThreshold = 32; | 380 const int kLowQpThreshold = 29; |
381 const int kBadQpThreshold = 92; | 381 const int kBadQpThreshold = 90; |
382 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, | 382 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, |
383 codec_settings->startBitrate, | 383 codec_settings->startBitrate, |
384 codec_settings->width, codec_settings->height); | 384 codec_settings->width, codec_settings->height); |
385 } else if (codecType_ == kVideoCodecH264) { | 385 } else if (codecType_ == kVideoCodecH264) { |
386 // H264 QP is in the range [0, 51]. | 386 // H264 QP is in the range [0, 51]. |
387 const int kLowQpThreshold = 21; | 387 const int kLowQpThreshold = 21; |
388 const int kBadQpThreshold = 36; | 388 const int kBadQpThreshold = 33; |
389 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, | 389 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false, |
390 codec_settings->startBitrate, | 390 codec_settings->startBitrate, |
391 codec_settings->width, codec_settings->height); | 391 codec_settings->width, codec_settings->height); |
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 } |
398 quality_scaler_.SetMinResolution(kMinDimension, kMinDimension); | 398 quality_scaler_.SetMinResolution(kMinDimension, kMinDimension); |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 } | 1252 } |
1253 | 1253 |
1254 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1254 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
1255 webrtc::VideoEncoder* encoder) { | 1255 webrtc::VideoEncoder* encoder) { |
1256 ALOGD << "Destroy video encoder."; | 1256 ALOGD << "Destroy video encoder."; |
1257 delete encoder; | 1257 delete encoder; |
1258 } | 1258 } |
1259 | 1259 |
1260 } // namespace webrtc_jni | 1260 } // namespace webrtc_jni |
1261 | 1261 |
OLD | NEW |