Reduce default max QP for AV1 from 56 to 52

Before this CL VP8 and AV1 used the same max QP=56. Tests show that at this QP AV1 delivers a worse PSNR than VP8. We want AV1 min quality to be not worse than VP8. This CL reduces the default max QP for AV1 to 52. With this value libaom AV1 encoder delivers PSNR close to libvpx VP8 at QP 56.

Bug: webrtc:351644568, b/369540380
Change-Id: I2e27ddab562f9c9710b11dc09076b03d7b308bb0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374041
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43751}
This commit is contained in:
Sergey Silkin 2025-01-10 11:26:41 +01:00 committed by WebRTC LUCI CQ
parent da1c9e08ac
commit a65c453f9e
5 changed files with 6 additions and 3 deletions

View File

@ -137,6 +137,7 @@ const int kDefaultVideoMaxFramerate = 60;
// Max encode quantizer for VP8/9 and AV1 encoders assuming libvpx/libaom API
// range [0, 63]
const int kDefaultVideoMaxQpVpx = 56;
const int kDefaultVideoMaxQpAv1 = 52;
// Max encode quantizer for H264/5 assuming the bitstream range [0, 51].
const int kDefaultVideoMaxQpH26x = 51;

View File

@ -158,6 +158,7 @@ extern const char kAv1FmtpTier[];
extern const int kDefaultVideoMaxFramerate;
extern const int kDefaultVideoMaxQpVpx;
extern const int kDefaultVideoMaxQpAv1;
extern const int kDefaultVideoMaxQpH26x;
extern const size_t kConferenceMaxNumSpatialLayers;

View File

@ -442,7 +442,7 @@ class TestVideoEncoderFactoryWrapper final {
} else {
RTC_LOG(LS_WARNING) << "Failed to configure svc bitrates for av1.";
}
video_codec.qpMax = cricket::kDefaultVideoMaxQpVpx;
video_codec.qpMax = cricket::kDefaultVideoMaxQpAv1;
break;
case kVideoCodecH265:
// TODO(bugs.webrtc.org/13485)

View File

@ -1122,7 +1122,7 @@ class Encoder : public EncodedImageCallback {
vc.qpMax = cricket::kDefaultVideoMaxQpVpx;
break;
case kVideoCodecAV1:
vc.qpMax = cricket::kDefaultVideoMaxQpVpx;
vc.qpMax = cricket::kDefaultVideoMaxQpAv1;
break;
case kVideoCodecH264:
*(vc.H264()) = VideoEncoder::GetDefaultH264Settings();

View File

@ -106,9 +106,10 @@ int GetDefaultMaxQp(webrtc::VideoCodecType codec_type) {
return kDefaultVideoMaxQpH26x;
case webrtc::kVideoCodecVP8:
case webrtc::kVideoCodecVP9:
case webrtc::kVideoCodecAV1:
case webrtc::kVideoCodecGeneric:
return kDefaultVideoMaxQpVpx;
case webrtc::kVideoCodecAV1:
return kDefaultVideoMaxQpAv1;
}
}