From 21b5ec1cc7ef83b49cd8ee9d2c69322e023e27ba Mon Sep 17 00:00:00 2001 From: Sergey Silkin Date: Wed, 27 Sep 2023 17:05:41 +0200 Subject: [PATCH] Add AV1 singlecast bitrate limits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: b/300060059 Change-Id: I07763632b9fec19dae9d676bb2488cd7d2191e76 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321660 Commit-Queue: Sergey Silkin Reviewed-by: Michael Horowitz Reviewed-by: Åsa Persson Cr-Commit-Position: refs/heads/main@{#40822} --- rtc_base/experiments/encoder_info_settings.cc | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/rtc_base/experiments/encoder_info_settings.cc b/rtc_base/experiments/encoder_info_settings.cc index 00974838ae..136201d261 100644 --- a/rtc_base/experiments/encoder_info_settings.cc +++ b/rtc_base/experiments/encoder_info_settings.cc @@ -38,9 +38,26 @@ constexpr float kDefaultMinBitratebps = 30000; std::vector EncoderInfoSettings::GetDefaultSinglecastBitrateLimits( VideoCodecType codec_type) { - // Specific limits for VP9. Determining specific limits for AV1 via - // field trial experiment is a work in progress. Other codecs use VP8 limits. + if (codec_type == kVideoCodecAV1) { + // AV1 singlecast max bitrate limits are higher than AV1 SVC max limits. + // This is because in singlecast we normally have just one receiver, BWE is + // known end-to-end and the encode target bitrate guarantees delivery of + // video. + // The min bitrate limits are not used in singlecast (used in SVC/simulcast + // to de-/activate spatial layers) and are set to zero. Send resolution in + // singlecast is assumed to be regulated by QP-based quality scaler. + return {{320 * 180, 0, 0, 256000}, + {480 * 270, 176000, 0, 384000}, + {640 * 360, 256000, 0, 512000}, + {960 * 540, 384000, 0, 1024000}, + {1280 * 720, 576000, 0, 1536000}}; + } + if (codec_type == kVideoCodecVP9) { + // VP9 singlecast bitrate limits are derived ~directly from VP9 SVC bitrate + // limits. The current max limits are unnecessarily too strict for + // singlecast, where BWE is known end-to-end, especially for low + // resolutions. return {{320 * 180, 0, 30000, 150000}, {480 * 270, 120000, 30000, 300000}, {640 * 360, 190000, 30000, 420000}, @@ -48,6 +65,7 @@ EncoderInfoSettings::GetDefaultSinglecastBitrateLimits( {1280 * 720, 480000, 30000, 1500000}}; } + // VP8 and other codecs. return {{320 * 180, 0, 30000, 300000}, {480 * 270, 200000, 30000, 500000}, {640 * 360, 300000, 30000, 800000},