Add AV1 encoder speed setting for screen share

There's an AV1 encoder speed setting 11 that is supposed to be used
for screen sharing content.

Bug: chromium:328598314
Change-Id: Id97898554a740eb1684d03c782c718c19f4c95e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342201
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41874}
This commit is contained in:
Johannes Kron 2024-03-07 15:41:34 +00:00 committed by WebRTC LUCI CQ
parent 9a9f6a8441
commit 17e358096e

View File

@ -374,7 +374,8 @@ bool LibaomAv1Encoder::SetEncoderControlParameters(int param_id,
return error_code == AOM_CODEC_OK;
}
// Only positive speeds, range for real-time coding currently is: 6 - 8.
// Only positive speeds, range for real-time coding currently is: 6 - 10.
// Speed 11 is used for screen sharing.
// Lower means slower/better quality, higher means fastest/lower quality.
int LibaomAv1Encoder::GetCpuSpeed(int width, int height) {
if (aux_config_) {
@ -386,6 +387,9 @@ int LibaomAv1Encoder::GetCpuSpeed(int width, int height) {
return 10;
} else {
if (encoder_settings_.mode == VideoCodecMode::kScreensharing) {
return 11;
}
// For smaller resolutions, use lower speed setting (get some coding gain at
// the cost of increased encoding complexity).
switch (encoder_settings_.GetVideoEncoderComplexity()) {