RateControlSettings: add option to set max QP for libvpx vp8.

Bug: none
Change-Id: Ia662068fe179faebc1df0aaa7f37b6e989b6525f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135569
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27888}
This commit is contained in:
Åsa Persson
2019-05-08 14:44:12 +02:00
committed by Commit Bot
parent ea5cbb5d1a
commit d7dd49ff3d
4 changed files with 30 additions and 1 deletions

View File

@ -560,6 +560,10 @@ int LibvpxVp8Encoder::InitEncode(const VideoCodec* inst,
if (inst->qpMax >= vpx_configs_[0].rc_min_quantizer) {
qp_max_ = inst->qpMax;
}
if (rate_control_settings_.LibvpxVp8QpMax()) {
qp_max_ = std::max(rate_control_settings_.LibvpxVp8QpMax().value(),
static_cast<int>(vpx_configs_[0].rc_min_quantizer));
}
vpx_configs_[0].rc_max_quantizer = qp_max_;
vpx_configs_[0].rc_undershoot_pct = 100;
vpx_configs_[0].rc_overshoot_pct = 15;