From 37f7d6c4e1d3bfc37f2bfdf783deef37e1be237d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85sa=20Persson?= Date: Tue, 24 May 2022 16:04:43 +0200 Subject: [PATCH] Update VP9Encoder::SupportsScalabilityMode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Indicate that the scalability mode is supported if the scalability config exists. Bug: webrtc:13960 Change-Id: I6f42da6c9bbff1322ec5c3e3a68c7e031606da86 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262981 Reviewed-by: Sergey Silkin Commit-Queue: Åsa Persson Cr-Commit-Position: refs/heads/main@{#36989} --- modules/video_coding/codecs/vp9/vp9.cc | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/modules/video_coding/codecs/vp9/vp9.cc b/modules/video_coding/codecs/vp9/vp9.cc index 8c0de92687..42d6987285 100644 --- a/modules/video_coding/codecs/vp9/vp9.cc +++ b/modules/video_coding/codecs/vp9/vp9.cc @@ -18,26 +18,13 @@ #include "api/video_codecs/vp9_profile.h" #include "modules/video_coding/codecs/vp9/libvpx_vp9_decoder.h" #include "modules/video_coding/codecs/vp9/libvpx_vp9_encoder.h" +#include "modules/video_coding/svc/create_scalability_structure.h" #include "rtc_base/checks.h" #include "vpx/vp8cx.h" #include "vpx/vp8dx.h" #include "vpx/vpx_codec.h" namespace webrtc { -namespace { -constexpr ScalabilityMode kSupportedScalabilityModes[] = { - ScalabilityMode::kL1T2, ScalabilityMode::kL1T3, - ScalabilityMode::kL2T1, ScalabilityMode::kL2T2, - ScalabilityMode::kL2T3, ScalabilityMode::kL3T1, - ScalabilityMode::kL3T2, ScalabilityMode::kL3T3, - ScalabilityMode::kL1T2h, ScalabilityMode::kL1T3h, - ScalabilityMode::kL2T1h, ScalabilityMode::kL2T2h, - ScalabilityMode::kL2T3h, ScalabilityMode::kL3T1h, - ScalabilityMode::kL3T2h, ScalabilityMode::kL3T3h, - ScalabilityMode::kL2T2_KEY, ScalabilityMode::kL2T3_KEY, - ScalabilityMode::kL3T1_KEY, ScalabilityMode::kL3T2_KEY, - ScalabilityMode::kL3T3_KEY}; -} // namespace std::vector SupportedVP9Codecs() { #ifdef RTC_ENABLE_VP9 @@ -102,12 +89,7 @@ std::unique_ptr VP9Encoder::Create( } bool VP9Encoder::SupportsScalabilityMode(ScalabilityMode scalability_mode) { - for (const auto& entry : kSupportedScalabilityModes) { - if (entry == scalability_mode) { - return true; - } - } - return false; + return ScalabilityStructureConfig(scalability_mode).has_value(); } std::unique_ptr VP9Decoder::Create() {