Make QualityScaler more responsive to downgrades.
Permits going from HD to QVGA in 6 seconds instead of 10. Also adds windows for going up quickly in the beginning of a call (before any downscaling happens due to bad quality). BUG=webrtc:5678 R=glaznev@webrtc.org, stefan@webrtc.org Review URL: https://codereview.webrtc.org/1830593003 . Cr-Commit-Position: refs/heads/master@{#12219}
This commit is contained in:
@ -382,15 +382,17 @@ int32_t MediaCodecVideoEncoder::InitEncode(
|
||||
const int kLowQpThreshold = 32;
|
||||
const int kBadQpThreshold = 92;
|
||||
quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false,
|
||||
codec_settings->startBitrate,
|
||||
codec_settings->width, codec_settings->height);
|
||||
codec_settings->startBitrate, codec_settings->width,
|
||||
codec_settings->height,
|
||||
codec_settings->maxFramerate);
|
||||
} else if (codecType_ == kVideoCodecH264) {
|
||||
// H264 QP is in the range [0, 51].
|
||||
const int kLowQpThreshold = 21;
|
||||
const int kBadQpThreshold = 36;
|
||||
quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false,
|
||||
codec_settings->startBitrate,
|
||||
codec_settings->width, codec_settings->height);
|
||||
codec_settings->startBitrate, codec_settings->width,
|
||||
codec_settings->height,
|
||||
codec_settings->maxFramerate);
|
||||
} else {
|
||||
// When adding codec support to additional hardware codecs, also configure
|
||||
// their QP thresholds for scaling.
|
||||
@ -398,7 +400,6 @@ int32_t MediaCodecVideoEncoder::InitEncode(
|
||||
scale_ = false;
|
||||
}
|
||||
quality_scaler_.SetMinResolution(kMinDimension, kMinDimension);
|
||||
quality_scaler_.ReportFramerate(codec_settings->maxFramerate);
|
||||
QualityScaler::Resolution res = quality_scaler_.GetScaledResolution();
|
||||
init_width = std::max(res.width, kMinDimension);
|
||||
init_height = std::max(res.height, kMinDimension);
|
||||
|
||||
Reference in New Issue
Block a user