Tune QP-based quality thresholds.
Increases measure time for downscale back to 5 seconds, this is required to not over-react on hand-waving or quick device rotations. Also increase max thresholds for QP a bit to not overreact when quality still looks somewhat OK. Min thresholds for H264 seemed very low and are increased to be sure that we can go back up again. The window is still quite big with the increased max QP. Also changes libvpx thresholds to use the same thresholds as the encoder, they were excessively low before and wouldn't adapt on bad QPs at all before (but rely on >60% framedropping based on bitrates to go down). BUG=webrtc:5678 R=stefan@webrtc.org TBR=glaznev@webrtc.org Review URL: https://codereview.webrtc.org/1894083002 . Cr-Commit-Position: refs/heads/master@{#12403}
This commit is contained in:
parent
5265fedffe
commit
2c8a2964fd
@ -376,15 +376,15 @@ int32_t MediaCodecVideoEncoder::InitEncode(
|
||||
// always = 127. Note that in SW, QP is that of the user-level range [0,
|
||||
// 63].
|
||||
const int kLowQpThreshold = 29;
|
||||
const int kBadQpThreshold = 90;
|
||||
const int kBadQpThreshold = 100;
|
||||
quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false,
|
||||
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 = 33;
|
||||
const int kLowQpThreshold = 24;
|
||||
const int kBadQpThreshold = 39;
|
||||
quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, false,
|
||||
codec_settings->startBitrate, codec_settings->width,
|
||||
codec_settings->height,
|
||||
|
||||
@ -604,8 +604,8 @@ int VP8EncoderImpl::InitEncode(const VideoCodec* inst,
|
||||
// quality is good, but also low enough to not cause a flip-flop behavior
|
||||
// (e.g. going up in resolution shouldn't give so bad quality that we should
|
||||
// go back down).
|
||||
const int kLowQpThreshold = 23;
|
||||
const int kDisabledBadQpThreshold = 128;
|
||||
const int kLowQpThreshold = 29;
|
||||
const int kDisabledBadQpThreshold = 100;
|
||||
// TODO(glaznev/sprang): consider passing codec initial bitrate to quality
|
||||
// scaler to avoid starting with HD for low initial bitrates.
|
||||
quality_scaler_.Init(kLowQpThreshold, kDisabledBadQpThreshold, false, 0, 0, 0,
|
||||
|
||||
@ -13,10 +13,10 @@ namespace webrtc {
|
||||
|
||||
namespace {
|
||||
static const int kMinFps = 5;
|
||||
static const int kMeasureSecondsDownscale = 3;
|
||||
// Threshold constant used until first downscale (to permit fast rampup).
|
||||
static const int kMeasureSecondsFastUpscale = 2;
|
||||
static const int kMeasureSecondsUpscale = 5;
|
||||
static const int kMeasureSecondsDownscale = 5;
|
||||
static const int kFramedropPercentThreshold = 60;
|
||||
static const int kHdResolutionThreshold = 700 * 500;
|
||||
static const int kHdBitrateThresholdKbps = 500;
|
||||
|
||||
@ -29,9 +29,9 @@ static const int kDisabledBadQpThreshold = 64;
|
||||
static const int kLowInitialBitrateKbps = 300;
|
||||
// These values need to be in sync with corresponding constants
|
||||
// in quality_scaler.cc
|
||||
static const int kMeasureSecondsDownscale = 3;
|
||||
static const int kMeasureSecondsFastUpscale = 2;
|
||||
static const int kMeasureSecondsUpscale = 5;
|
||||
static const int kMeasureSecondsDownscale = 5;
|
||||
static const int kMinDownscaleDimension = 140;
|
||||
} // namespace
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user