Refactor encoder-complexity param in VideoCodec w/backward compatibility

Move complexity parameter to the main VideoCodec class to enable
additional video codecs to use the parameter without creating a new
codec-specific structure.

Bug: webrtc:13694
Change-Id: Icb7cf640b178875d799f39ade8b5084e3222bb1c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251921
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Michael Horowitz <mhoro@google.com>
Cr-Commit-Position: refs/heads/main@{#36040}
This commit is contained in:
“Michael
2022-02-19 16:48:50 -06:00
committed by WebRTC LUCI CQ
parent 1f6e4308ab
commit 3147e29c4e
7 changed files with 40 additions and 11 deletions

View File

@ -591,7 +591,7 @@ int LibvpxVp8Encoder::InitEncode(const VideoCodec* inst,
}
// Allow the user to set the complexity for the base stream.
switch (inst->VP8().complexity) {
switch (inst->GetVideoEncoderComplexity()) {
case VideoCodecComplexity::kComplexityHigh:
cpu_speed_[0] = -5;
break;

View File

@ -76,7 +76,8 @@ class TestVp8Impl : public VideoCodecUnitTest {
webrtc::test::CodecSettings(kVideoCodecVP8, codec_settings);
codec_settings->width = kWidth;
codec_settings->height = kHeight;
codec_settings->VP8()->complexity = VideoCodecComplexity::kComplexityNormal;
codec_settings->SetVideoEncoderComplexity(
VideoCodecComplexity::kComplexityNormal);
}
void EncodeAndWaitForFrame(const VideoFrame& input_frame,