Add minimum_qp to VideoEncoder::EncoderInfo

The minimum QP field will be used to signal what the QP value will be
once the encoder reach its target video quality. This will be used
in the generalized QP convergence detection.

Bug: chromium:328598314
Change-Id: I82299cd921e3c091e651218d1e3f337875176567
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355701
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Markus Handell <handellm@google.com>
Cr-Commit-Position: refs/heads/main@{#42559}
This commit is contained in:
Johannes Kron 2024-06-26 19:22:19 +02:00 committed by WebRTC LUCI CQ
parent 2360208f7d
commit 216cce5f49
4 changed files with 18 additions and 0 deletions

View File

@ -259,6 +259,11 @@ class RTC_EXPORT VideoEncoder {
// Indicates whether or not QP value encoder writes into frame/slice/tile
// header can be interpreted as average frame/slice/tile QP.
absl::optional<bool> is_qp_trusted;
// The minimum QP that the encoder is expected to use with the current
// configuration. This may be used to determine if the encoder has reached
// its target video quality for static screenshare content.
absl::optional<int> minimum_qp;
};
struct RTC_EXPORT RateControlParameters {

View File

@ -59,6 +59,8 @@ namespace {
// Encoder configuration parameters
constexpr int kQpMin = 10;
constexpr int kAv1ScreenshareMinimumQindex =
40; // Min qindex corresponding to kQpMin.
constexpr int kUsageProfile = AOM_USAGE_REALTIME;
constexpr int kMinQindex = 145; // Min qindex threshold for QP scaling.
constexpr int kMaxQindex = 205; // Max qindex threshold for QP scaling.
@ -866,6 +868,8 @@ VideoEncoder::EncoderInfo LibaomAv1Encoder::GetEncoderInfo() const {
info.resolution_bitrate_limits =
encoder_info_override_.resolution_bitrate_limits();
}
info.minimum_qp = kAv1ScreenshareMinimumQindex;
return info;
}

View File

@ -68,6 +68,7 @@ constexpr char kVp8ForcePartitionResilience[] =
// bitstream range of [0, 127] and not the user-level range of [0,63].
constexpr int kLowVp8QpThreshold = 29;
constexpr int kHighVp8QpThreshold = 95;
constexpr int kVp8ScreenshareMinimumQp = 15;
constexpr int kTokenPartitions = VP8_ONE_TOKENPARTITION;
constexpr uint32_t kVp832ByteAlign = 32u;
@ -1348,6 +1349,10 @@ VideoEncoder::EncoderInfo LibvpxVp8Encoder::GetEncoderInfo() const {
}
}
}
if (codec_.mode == VideoCodecMode::kScreensharing) {
info.minimum_qp = kVp8ScreenshareMinimumQp;
}
}
return info;

View File

@ -1825,6 +1825,10 @@ VideoEncoder::EncoderInfo LibvpxVp9Encoder::GetEncoderInfo() const {
info.preferred_pixel_formats = {VideoFrameBuffer::Type::kI420,
VideoFrameBuffer::Type::kNV12};
}
if (codec_.mode == VideoCodecMode::kScreensharing) {
info.minimum_qp = variable_framerate_screenshare::kMinQP;
}
}
if (!encoder_info_override_.resolution_bitrate_limits().empty()) {
info.resolution_bitrate_limits =