From 6adf2243b564b1b3e7abba6c4f3aa144edf3ddb6 Mon Sep 17 00:00:00 2001 From: Ilya Nikolaevskiy Date: Fri, 26 Jan 2024 15:01:51 +0100 Subject: [PATCH] Compute scaling factors for not-explicitly configured layers in VP9 encoder The division by 2 has been accidentally removed in https://webrtc-review.googlesource.com/c/src/+/76921 The code and comment are out of sync now. Bug: None Change-Id: If43a40461878ffe58dd9ed0ab8a6244ad79c4f6b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336283 Reviewed-by: Sergey Silkin Auto-Submit: Ilya Nikolaevskiy Commit-Queue: Sergey Silkin Cr-Commit-Position: refs/heads/main@{#41627} --- modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc b/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc index e26169fd3d..b73fd100cf 100644 --- a/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc +++ b/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc @@ -836,6 +836,8 @@ int LibvpxVp9Encoder::InitAndSetControlSettings(const VideoCodec* inst) { // 1:2 scaling in each dimension. svc_params_.scaling_factor_num[i] = scaling_factor_num; svc_params_.scaling_factor_den[i] = 256; + if (inst->mode != VideoCodecMode::kScreensharing) + scaling_factor_num /= 2; } }