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:

committed by
WebRTC LUCI CQ

parent
88af20356f
commit
4da317f0bb
@ -31,8 +31,7 @@ constexpr char kPayloadNameMultiplex[] = "Multiplex";
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
bool VideoCodecVP8::operator==(const VideoCodecVP8& other) const {
|
bool VideoCodecVP8::operator==(const VideoCodecVP8& other) const {
|
||||||
return (complexity == other.complexity &&
|
return (numberOfTemporalLayers == other.numberOfTemporalLayers &&
|
||||||
numberOfTemporalLayers == other.numberOfTemporalLayers &&
|
|
||||||
denoisingOn == other.denoisingOn &&
|
denoisingOn == other.denoisingOn &&
|
||||||
automaticResizeOn == other.automaticResizeOn &&
|
automaticResizeOn == other.automaticResizeOn &&
|
||||||
frameDroppingOn == other.frameDroppingOn &&
|
frameDroppingOn == other.frameDroppingOn &&
|
||||||
@ -40,8 +39,7 @@ bool VideoCodecVP8::operator==(const VideoCodecVP8& other) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool VideoCodecVP9::operator==(const VideoCodecVP9& other) const {
|
bool VideoCodecVP9::operator==(const VideoCodecVP9& other) const {
|
||||||
return (complexity == other.complexity &&
|
return (numberOfTemporalLayers == other.numberOfTemporalLayers &&
|
||||||
numberOfTemporalLayers == other.numberOfTemporalLayers &&
|
|
||||||
denoisingOn == other.denoisingOn &&
|
denoisingOn == other.denoisingOn &&
|
||||||
frameDroppingOn == other.frameDroppingOn &&
|
frameDroppingOn == other.frameDroppingOn &&
|
||||||
keyFrameInterval == other.keyFrameInterval &&
|
keyFrameInterval == other.keyFrameInterval &&
|
||||||
@ -74,7 +72,8 @@ VideoCodec::VideoCodec()
|
|||||||
expect_encode_from_texture(false),
|
expect_encode_from_texture(false),
|
||||||
timing_frame_thresholds({0, 0}),
|
timing_frame_thresholds({0, 0}),
|
||||||
legacy_conference_mode(false),
|
legacy_conference_mode(false),
|
||||||
codec_specific_() {}
|
codec_specific_(),
|
||||||
|
complexity_(VideoCodecComplexity::kComplexityNormal) {}
|
||||||
|
|
||||||
VideoCodecVP8* VideoCodec::VP8() {
|
VideoCodecVP8* VideoCodec::VP8() {
|
||||||
RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
|
RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
|
||||||
@ -140,17 +139,7 @@ VideoCodecType PayloadStringToCodecType(const std::string& name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoCodecComplexity VideoCodec::GetVideoEncoderComplexity() const {
|
VideoCodecComplexity VideoCodec::GetVideoEncoderComplexity() const {
|
||||||
if (complexity_.has_value()) {
|
return complexity_;
|
||||||
return complexity_.value();
|
|
||||||
}
|
|
||||||
switch (codecType) {
|
|
||||||
case kVideoCodecVP8:
|
|
||||||
return VP8().complexity;
|
|
||||||
case kVideoCodecVP9:
|
|
||||||
return VP9().complexity;
|
|
||||||
default:
|
|
||||||
return VideoCodecComplexity::kComplexityNormal;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoCodec::SetVideoEncoderComplexity(
|
void VideoCodec::SetVideoEncoderComplexity(
|
||||||
|
@ -43,7 +43,6 @@ struct VideoCodecVP8 {
|
|||||||
bool operator!=(const VideoCodecVP8& other) const {
|
bool operator!=(const VideoCodecVP8& other) const {
|
||||||
return !(*this == other);
|
return !(*this == other);
|
||||||
}
|
}
|
||||||
VideoCodecComplexity complexity;
|
|
||||||
unsigned char numberOfTemporalLayers;
|
unsigned char numberOfTemporalLayers;
|
||||||
bool denoisingOn;
|
bool denoisingOn;
|
||||||
bool automaticResizeOn;
|
bool automaticResizeOn;
|
||||||
@ -63,7 +62,6 @@ struct VideoCodecVP9 {
|
|||||||
bool operator!=(const VideoCodecVP9& other) const {
|
bool operator!=(const VideoCodecVP9& other) const {
|
||||||
return !(*this == other);
|
return !(*this == other);
|
||||||
}
|
}
|
||||||
VideoCodecComplexity complexity;
|
|
||||||
unsigned char numberOfTemporalLayers;
|
unsigned char numberOfTemporalLayers;
|
||||||
bool denoisingOn;
|
bool denoisingOn;
|
||||||
bool frameDroppingOn;
|
bool frameDroppingOn;
|
||||||
@ -181,7 +179,7 @@ class RTC_EXPORT VideoCodec {
|
|||||||
absl::optional<ScalabilityMode> scalability_mode_;
|
absl::optional<ScalabilityMode> scalability_mode_;
|
||||||
// 'complexity_' indicates the CPU capability of the client. It's used to
|
// '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).
|
// 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
|
// TODO(bugs.webrtc.org/6883): When unset, GetEnableFrameDrop checks the
|
||||||
// codec-specific settings.
|
// codec-specific settings.
|
||||||
absl::optional<bool> frame_drop_enabled_;
|
absl::optional<bool> frame_drop_enabled_;
|
||||||
|
@ -45,7 +45,6 @@ VideoCodecVP9 VideoEncoder::GetDefaultVp9Settings() {
|
|||||||
vp9_settings.numberOfSpatialLayers = 1;
|
vp9_settings.numberOfSpatialLayers = 1;
|
||||||
vp9_settings.flexibleMode = false;
|
vp9_settings.flexibleMode = false;
|
||||||
vp9_settings.interLayerPred = InterLayerPredMode::kOn;
|
vp9_settings.interLayerPred = InterLayerPredMode::kOn;
|
||||||
vp9_settings.complexity = VideoCodecComplexity::kComplexityNormal;
|
|
||||||
|
|
||||||
return vp9_settings;
|
return vp9_settings;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user