Add initial bitrate and frame resolution parameters to quality scaler.

- Scale down to VGA immediately if call starts with HD resolution
and bitrate below 500 kbps.
- Adjust QP threshold for HW VP8 encoder to scale down faster.

BUG=b/26504665
R=mflodman@webrtc.org, pbos@webrtc.org, sprang@google.com, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1672173002 .

Cr-Commit-Position: refs/heads/master@{#11692}
This commit is contained in:
Alex Glaznev
2016-02-19 15:24:06 -08:00
parent 0013dcc0c1
commit a9d0892946
5 changed files with 68 additions and 18 deletions

View File

@ -600,8 +600,10 @@ int VP8EncoderImpl::InitEncode(const VideoCodec* inst,
// Disable both high-QP limits and framedropping. Both are handled by libvpx
// internally.
const int kDisabledBadQpThreshold = 64;
// TODO(glaznev/sprang): consider passing codec initial bitrate to quality
// scaler to avoid starting with HD for low initial bitrates.
quality_scaler_.Init(codec_.qpMax / QualityScaler::kDefaultLowQpDenominator,
kDisabledBadQpThreshold, false);
kDisabledBadQpThreshold, false, 0, 0, 0);
quality_scaler_.ReportFramerate(codec_.maxFramerate);
// Only apply scaling to improve for single-layer streams. The scaling metrics