Commit 7589c162 authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media/gpu/vaapi/VP9Encoder: Ease max QP limitation for Software BRC.

Bug: 1060775
Test: appr.tc/?vsbr=500&vsc=vp9 on rammus
Test: video_encode_accelerator_tests --codec=vp9 on rammus
Change-Id: I45ef96aec373b05383680c54245fc0d0000b7579
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359816
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799484}
parent d7b52b67
......@@ -26,10 +26,14 @@ constexpr int kCPBWindowSizeMs = 500;
// Quantization parameter. They are vp9 ac/dc indices and their ranges are
// 0-255. Based on WebRTC's defaults.
constexpr int kMinQP = 4;
// TODO(crbug.com/1060775): Relax this max quantization parameter upper bound
// so that our encoder and bitrate controller can select a higher value in the
// case a requested bitrate is small.
constexpr int kMaxQP = 112;
// The upper limitation of the quantization parameter for the software rate
// controller. This is larger than |kMaxQP| because a driver might ignore the
// specified maximum quantization parameter when the driver determines the
// value, but it doesn't ignore the quantization parameter by the software rate
// controller.
constexpr int kMaxQPForSoftwareRateCtrl = 224;
// This stands for 31 as a real ac value (see rfc 8.6.1 table
// ac_qlookup[3][256]). Note: This needs to be revisited once we have 10&12 bit
// encoder support.
......@@ -220,6 +224,8 @@ bool VP9Encoder::Initialize(const VideoEncodeAccelerator::Config& config,
temporal_layers_ =
std::make_unique<VP9TemporalLayers>(num_temporal_layers);
}
current_params_.scaling_settings.max_qp = kMaxQPForSoftwareRateCtrl;
// |rate_ctrl_| might be injected for tests.
if (!rate_ctrl_) {
rate_ctrl_ = VP9RateControl::Create(CreateRateControlConfig(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment