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

Side by Side Diff: webrtc/api/java/jni/androidmediaencoder_jni.cc

Issue 1879213002: Enable H.264 HW decoder soft rest. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/java/jni/androidmediadecoder_jni.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/api/java/jni/androidmediadecoder_jni.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698