Enable H.264 HW decoder soft rest.
Also tune up scale thresholds a little. BUG=b/27674326 R=wzh@webrtc.org Review URL: https://codereview.webrtc.org/1879213002 . Cr-Commit-Position: refs/heads/master@{#12337}
This commit is contained in:
@ -532,10 +532,9 @@ int32_t MediaCodecVideoDecoder::Decode(
|
||||
codec_.width = inputImage._encodedWidth;
|
||||
codec_.height = inputImage._encodedHeight;
|
||||
int32_t ret;
|
||||
if (use_surface_ && codecType_ == kVideoCodecVP8) {
|
||||
// Soft codec reset - only for VP8 and surface decoding.
|
||||
// TODO(glaznev): try to use similar approach for H.264
|
||||
// and buffer decoding.
|
||||
if (use_surface_ &&
|
||||
(codecType_ == kVideoCodecVP8 || codecType_ == kVideoCodecH264)) {
|
||||
// Soft codec reset - only for surface decoding.
|
||||
ret = codec_thread_->Invoke<int32_t>(Bind(
|
||||
&MediaCodecVideoDecoder::ResetDecodeOnCodecThread, this));
|
||||
} else {
|
||||
|
||||
@ -377,15 +377,15 @@ 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 kLowQpThreshold = 32;
|
||||
const int kBadQpThreshold = 92;
|
||||
const int kLowQpThreshold = 29;
|
||||
const int kBadQpThreshold = 90;
|
||||
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 kLowQpThreshold = 21;
|
||||
const int kBadQpThreshold = 36;
|
||||
const int kBadQpThreshold = 33;
|
||||
quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false,
|
||||
codec_settings->startBitrate,
|
||||
codec_settings->width, codec_settings->height);
|
||||
|
||||
Reference in New Issue
Block a user