diff --git a/api/video_codecs/BUILD.gn b/api/video_codecs/BUILD.gn index e5b34f81c4..6167c1fafa 100644 --- a/api/video_codecs/BUILD.gn +++ b/api/video_codecs/BUILD.gn @@ -52,7 +52,6 @@ rtc_library("video_codecs_api") { "sdp_video_format.h", "simulcast_stream.cc", "simulcast_stream.h", - "spatial_layer.cc", "spatial_layer.h", "video_codec.cc", "video_codec.h", diff --git a/api/video_codecs/simulcast_stream.cc b/api/video_codecs/simulcast_stream.cc index a867597376..4139a38e16 100644 --- a/api/video_codecs/simulcast_stream.cc +++ b/api/video_codecs/simulcast_stream.cc @@ -36,4 +36,14 @@ absl::optional SimulcastStream::GetScalabilityMode() const { return scalability_modes[numberOfTemporalLayers - 1]; } +bool SimulcastStream::operator==(const SimulcastStream& other) const { + return (width == other.width && height == other.height && + maxFramerate == other.maxFramerate && + numberOfTemporalLayers == other.numberOfTemporalLayers && + maxBitrate == other.maxBitrate && + targetBitrate == other.targetBitrate && + minBitrate == other.minBitrate && qpMax == other.qpMax && + active == other.active); +} + } // namespace webrtc diff --git a/api/video_codecs/simulcast_stream.h b/api/video_codecs/simulcast_stream.h index 6521536d56..78976b34a0 100644 --- a/api/video_codecs/simulcast_stream.h +++ b/api/video_codecs/simulcast_stream.h @@ -25,6 +25,11 @@ struct SimulcastStream { absl::optional GetScalabilityMode() const; void SetNumberOfTemporalLayers(unsigned char n); + bool operator==(const SimulcastStream& other) const; + bool operator!=(const SimulcastStream& other) const { + return !(*this == other); + } + int width = 0; int height = 0; float maxFramerate = 0; // fps. diff --git a/api/video_codecs/spatial_layer.cc b/api/video_codecs/spatial_layer.cc deleted file mode 100644 index 25ccdfeb48..0000000000 --- a/api/video_codecs/spatial_layer.cc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "api/video_codecs/spatial_layer.h" - -namespace webrtc { - -bool SpatialLayer::operator==(const SpatialLayer& other) const { - return (width == other.width && height == other.height && - maxFramerate == other.maxFramerate && - numberOfTemporalLayers == other.numberOfTemporalLayers && - maxBitrate == other.maxBitrate && - targetBitrate == other.targetBitrate && - minBitrate == other.minBitrate && qpMax == other.qpMax && - active == other.active); -} - -} // namespace webrtc diff --git a/api/video_codecs/spatial_layer.h b/api/video_codecs/spatial_layer.h index 5a1b425427..4003f0b1b7 100644 --- a/api/video_codecs/spatial_layer.h +++ b/api/video_codecs/spatial_layer.h @@ -11,22 +11,11 @@ #ifndef API_VIDEO_CODECS_SPATIAL_LAYER_H_ #define API_VIDEO_CODECS_SPATIAL_LAYER_H_ +#include "api/video_codecs/simulcast_stream.h" + namespace webrtc { -struct SpatialLayer { - bool operator==(const SpatialLayer& other) const; - bool operator!=(const SpatialLayer& other) const { return !(*this == other); } - - unsigned short width; // NOLINT(runtime/int) - unsigned short height; // NOLINT(runtime/int) - float maxFramerate; // fps. - unsigned char numberOfTemporalLayers; - unsigned int maxBitrate; // kilobits/sec. - unsigned int targetBitrate; // kilobits/sec. - unsigned int minBitrate; // kilobits/sec. - unsigned int qpMax; // minimum quality - bool active; // encoded and sent. -}; +typedef SimulcastStream SpatialLayer; } // namespace webrtc #endif // API_VIDEO_CODECS_SPATIAL_LAYER_H_ diff --git a/modules/video_coding/codecs/vp9/include/vp9_globals.h b/modules/video_coding/codecs/vp9/include/vp9_globals.h index 0614a3c83f..204cc60b58 100644 --- a/modules/video_coding/codecs/vp9/include/vp9_globals.h +++ b/modules/video_coding/codecs/vp9/include/vp9_globals.h @@ -30,8 +30,8 @@ const size_t kMaxVp9RefPics = 3; const size_t kMaxVp9FramesInGof = 0xFF; // 8 bits const size_t kMaxVp9NumberOfSpatialLayers = 8; -const size_t kMinVp9SpatialLayerLongSideLength = 240; -const size_t kMinVp9SpatialLayerShortSideLength = 135; +const int kMinVp9SpatialLayerLongSideLength = 240; +const int kMinVp9SpatialLayerShortSideLength = 135; enum TemporalStructureMode { kTemporalStructureMode1, // 1 temporal layer structure - i.e., IPPP... diff --git a/modules/video_coding/codecs/vp9/svc_config_unittest.cc b/modules/video_coding/codecs/vp9/svc_config_unittest.cc index 2515b1ce4b..ba3b22fc09 100644 --- a/modules/video_coding/codecs/vp9/svc_config_unittest.cc +++ b/modules/video_coding/codecs/vp9/svc_config_unittest.cc @@ -174,7 +174,7 @@ TEST(SvcConfig, AlwaysSendsAtLeastOneLayerPortrait) { TEST(SvcConfig, EnforcesMinimalRequiredParity) { const size_t max_num_spatial_layers = 3; - const size_t kOddSize = 1023; + const int kOddSize = 1023; std::vector spatial_layers = GetSvcConfig(kOddSize, kOddSize, 30,