Remove complexity parameter from video codec specific structs.

Now only using the complexity from the main VideoCodec settings.

Bug: webrtc:13694
Change-Id: I5a29df0fac0c0686bf5ea0b677f8946d23ef9888
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262762
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36912}
This commit is contained in:
Erik Språng
2022-05-17 13:51:01 +02:00
committed by WebRTC LUCI CQ
parent 88af20356f
commit 4da317f0bb
3 changed files with 6 additions and 20 deletions

View File

@ -31,8 +31,7 @@ constexpr char kPayloadNameMultiplex[] = "Multiplex";
} // namespace
bool VideoCodecVP8::operator==(const VideoCodecVP8& other) const {
return (complexity == other.complexity &&
numberOfTemporalLayers == other.numberOfTemporalLayers &&
return (numberOfTemporalLayers == other.numberOfTemporalLayers &&
denoisingOn == other.denoisingOn &&
automaticResizeOn == other.automaticResizeOn &&
frameDroppingOn == other.frameDroppingOn &&
@ -40,8 +39,7 @@ bool VideoCodecVP8::operator==(const VideoCodecVP8& other) const {
}
bool VideoCodecVP9::operator==(const VideoCodecVP9& other) const {
return (complexity == other.complexity &&
numberOfTemporalLayers == other.numberOfTemporalLayers &&
return (numberOfTemporalLayers == other.numberOfTemporalLayers &&
denoisingOn == other.denoisingOn &&
frameDroppingOn == other.frameDroppingOn &&
keyFrameInterval == other.keyFrameInterval &&
@ -74,7 +72,8 @@ VideoCodec::VideoCodec()
expect_encode_from_texture(false),
timing_frame_thresholds({0, 0}),
legacy_conference_mode(false),
codec_specific_() {}
codec_specific_(),
complexity_(VideoCodecComplexity::kComplexityNormal) {}
VideoCodecVP8* VideoCodec::VP8() {
RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
@ -140,17 +139,7 @@ VideoCodecType PayloadStringToCodecType(const std::string& name) {
}
VideoCodecComplexity VideoCodec::GetVideoEncoderComplexity() const {
if (complexity_.has_value()) {
return complexity_.value();
}
switch (codecType) {
case kVideoCodecVP8:
return VP8().complexity;
case kVideoCodecVP9:
return VP9().complexity;
default:
return VideoCodecComplexity::kComplexityNormal;
}
return complexity_;
}
void VideoCodec::SetVideoEncoderComplexity(

View File

@ -43,7 +43,6 @@ struct VideoCodecVP8 {
bool operator!=(const VideoCodecVP8& other) const {
return !(*this == other);
}
VideoCodecComplexity complexity;
unsigned char numberOfTemporalLayers;
bool denoisingOn;
bool automaticResizeOn;
@ -63,7 +62,6 @@ struct VideoCodecVP9 {
bool operator!=(const VideoCodecVP9& other) const {
return !(*this == other);
}
VideoCodecComplexity complexity;
unsigned char numberOfTemporalLayers;
bool denoisingOn;
bool frameDroppingOn;
@ -181,7 +179,7 @@ class RTC_EXPORT VideoCodec {
absl::optional<ScalabilityMode> scalability_mode_;
// 'complexity_' indicates the CPU capability of the client. It's used to
// determine encoder CPU complexity (e.g., cpu_used for VP8, VP9. and AV1).
absl::optional<VideoCodecComplexity> complexity_;
VideoCodecComplexity complexity_;
// TODO(bugs.webrtc.org/6883): When unset, GetEnableFrameDrop checks the
// codec-specific settings.
absl::optional<bool> frame_drop_enabled_;

View File

@ -45,7 +45,6 @@ VideoCodecVP9 VideoEncoder::GetDefaultVp9Settings() {
vp9_settings.numberOfSpatialLayers = 1;
vp9_settings.flexibleMode = false;
vp9_settings.interLayerPred = InterLayerPredMode::kOn;
vp9_settings.complexity = VideoCodecComplexity::kComplexityNormal;
return vp9_settings;
}