From b081042eec8f3ab5e080db59d22d52bd5c0d8bdc Mon Sep 17 00:00:00 2001 From: anurag Date: Tue, 10 Jan 2023 15:15:10 -0800 Subject: [PATCH] Remove dimension check in SimulcastUtility::ValidSimulcastParameters We found that the legacy assumption for H264 which assumed that simulcast streams would use 2x width ratios in unnecessary as the encoder has since been fixed to handle multiple ratios. H264 encoder still works even if this assumption is invalid Bug: None Change-Id: I9caacf78d26c8215b94858a2d8674ec4cd64e96e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/286940 Reviewed-by: Mirta Dvornicic Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/main@{#39072} --- AUTHORS | 1 + .../video_coding/utility/simulcast_utility.cc | 17 +++-------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/AUTHORS b/AUTHORS index f79b6adc32..5ec8b46310 100644 --- a/AUTHORS +++ b/AUTHORS @@ -143,6 +143,7 @@ ARM Holdings <*@arm.com> BroadSoft Inc. <*@broadsoft.com> Canonical Ltd <*@canonical.com> CoSMo Software Consulting, Pte Ltd <*@cosmosoftware.io> +Discord Inc. <*@discordapp.com> Facebook Inc. <*@fb.com> Google Inc. <*@google.com> Highfive, Inc. <*@highfive.com> diff --git a/modules/video_coding/utility/simulcast_utility.cc b/modules/video_coding/utility/simulcast_utility.cc index a407483edd..65061ed32a 100644 --- a/modules/video_coding/utility/simulcast_utility.cc +++ b/modules/video_coding/utility/simulcast_utility.cc @@ -49,20 +49,9 @@ bool SimulcastUtility::ValidSimulcastParameters(const VideoCodec& codec, return false; } } - if (codec.codecType == webrtc::kVideoCodecVP8) { - for (int i = 1; i < num_streams; ++i) { - if (codec.simulcastStream[i].width < codec.simulcastStream[i - 1].width) { - return false; - } - } - } else { - // TODO(mirtad): H264 encoder implementation still assumes the default - // resolution downscaling is used. - for (int i = 1; i < num_streams; ++i) { - if (codec.simulcastStream[i].width != - codec.simulcastStream[i - 1].width * 2) { - return false; - } + for (int i = 1; i < num_streams; ++i) { + if (codec.simulcastStream[i].width < codec.simulcastStream[i - 1].width) { + return false; } }