Remove no longer needed FrameDroppingOn setting in QualityScalingTests.
Bug: none Change-Id: Id3868f947584616a7027a3985155a79c01e6dbb8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207422 Reviewed-by: Sergey Silkin <ssilkin@webrtc.org> Commit-Queue: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33269}
This commit is contained in:
parent
51746ce3fe
commit
453a125438
@ -29,25 +29,17 @@ constexpr size_t kTimeoutMs = 10000; // Some tests are expected to time out.
|
||||
|
||||
void SetEncoderSpecific(VideoEncoderConfig* encoder_config,
|
||||
VideoCodecType type,
|
||||
bool automatic_resize,
|
||||
bool frame_dropping) {
|
||||
bool automatic_resize) {
|
||||
if (type == kVideoCodecVP8) {
|
||||
VideoCodecVP8 vp8 = VideoEncoder::GetDefaultVp8Settings();
|
||||
vp8.automaticResizeOn = automatic_resize;
|
||||
vp8.frameDroppingOn = frame_dropping;
|
||||
encoder_config->encoder_specific_settings = new rtc::RefCountedObject<
|
||||
VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8);
|
||||
} else if (type == kVideoCodecVP9) {
|
||||
VideoCodecVP9 vp9 = VideoEncoder::GetDefaultVp9Settings();
|
||||
vp9.automaticResizeOn = automatic_resize;
|
||||
vp9.frameDroppingOn = frame_dropping;
|
||||
encoder_config->encoder_specific_settings = new rtc::RefCountedObject<
|
||||
VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9);
|
||||
} else if (type == kVideoCodecH264) {
|
||||
VideoCodecH264 h264 = VideoEncoder::GetDefaultH264Settings();
|
||||
h264.frameDroppingOn = frame_dropping;
|
||||
encoder_config->encoder_specific_settings = new rtc::RefCountedObject<
|
||||
VideoEncoderConfig::H264EncoderSpecificSettings>(h264);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
@ -59,7 +51,6 @@ class QualityScalingTest : public test::CallTest {
|
||||
const std::vector<bool>& streams_active,
|
||||
int start_bps,
|
||||
bool automatic_resize,
|
||||
bool frame_dropping,
|
||||
bool expect_adaptation);
|
||||
|
||||
const std::string kPrefix = "WebRTC-Video-QualityScaling/Enabled-";
|
||||
@ -71,7 +62,6 @@ void QualityScalingTest::RunTest(VideoEncoderFactory* encoder_factory,
|
||||
const std::vector<bool>& streams_active,
|
||||
int start_bps,
|
||||
bool automatic_resize,
|
||||
bool frame_dropping,
|
||||
bool expect_adaptation) {
|
||||
class ScalingObserver
|
||||
: public test::SendTest,
|
||||
@ -82,7 +72,6 @@ void QualityScalingTest::RunTest(VideoEncoderFactory* encoder_factory,
|
||||
const std::vector<bool>& streams_active,
|
||||
int start_bps,
|
||||
bool automatic_resize,
|
||||
bool frame_dropping,
|
||||
bool expect_adaptation)
|
||||
: SendTest(expect_adaptation ? kDefaultTimeoutMs : kTimeoutMs),
|
||||
encoder_factory_(encoder_factory),
|
||||
@ -90,7 +79,6 @@ void QualityScalingTest::RunTest(VideoEncoderFactory* encoder_factory,
|
||||
streams_active_(streams_active),
|
||||
start_bps_(start_bps),
|
||||
automatic_resize_(automatic_resize),
|
||||
frame_dropping_(frame_dropping),
|
||||
expect_adaptation_(expect_adaptation) {}
|
||||
|
||||
private:
|
||||
@ -134,8 +122,7 @@ void QualityScalingTest::RunTest(VideoEncoderFactory* encoder_factory,
|
||||
stream.scale_resolution_down_by = scale_factor;
|
||||
scale_factor *= 2.0;
|
||||
}
|
||||
SetEncoderSpecific(encoder_config, codec_type, automatic_resize_,
|
||||
frame_dropping_);
|
||||
SetEncoderSpecific(encoder_config, codec_type, automatic_resize_);
|
||||
}
|
||||
|
||||
void PerformTest() override {
|
||||
@ -148,183 +135,115 @@ void QualityScalingTest::RunTest(VideoEncoderFactory* encoder_factory,
|
||||
const std::vector<bool> streams_active_;
|
||||
const int start_bps_;
|
||||
const bool automatic_resize_;
|
||||
const bool frame_dropping_;
|
||||
const bool expect_adaptation_;
|
||||
} test(encoder_factory, payload_name, streams_active, start_bps,
|
||||
automatic_resize, frame_dropping, expect_adaptation);
|
||||
automatic_resize, expect_adaptation);
|
||||
|
||||
RunBaseTest(&test);
|
||||
}
|
||||
|
||||
TEST_F(QualityScalingTest, AdaptsDownForHighQp_Vp8) {
|
||||
// VP8 QP thresholds, low:1, high:1 -> high QP.
|
||||
// qp_low:1, qp_high:1 -> kHighQp
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "1,1,0,0,0,0" + kEnd);
|
||||
|
||||
// QualityScaler enabled.
|
||||
const bool kAutomaticResize = true;
|
||||
const bool kFrameDropping = true;
|
||||
const bool kExpectAdapt = true;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return VP8Encoder::Create(); });
|
||||
RunTest(&encoder_factory, "VP8", {true}, kHighStartBps, kAutomaticResize,
|
||||
kFrameDropping, kExpectAdapt);
|
||||
RunTest(&encoder_factory, "VP8", {true}, kHighStartBps,
|
||||
/*automatic_resize=*/true, /*expect_adaptation=*/true);
|
||||
}
|
||||
|
||||
TEST_F(QualityScalingTest, NoAdaptDownForHighQpWithResizeOff_Vp8) {
|
||||
// VP8 QP thresholds, low:1, high:1 -> high QP.
|
||||
// qp_low:1, qp_high:1 -> kHighQp
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "1,1,0,0,0,0" + kEnd);
|
||||
|
||||
// QualityScaler disabled.
|
||||
const bool kAutomaticResize = false;
|
||||
const bool kFrameDropping = true;
|
||||
const bool kExpectAdapt = false;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return VP8Encoder::Create(); });
|
||||
RunTest(&encoder_factory, "VP8", {true}, kHighStartBps, kAutomaticResize,
|
||||
kFrameDropping, kExpectAdapt);
|
||||
}
|
||||
|
||||
// TODO(bugs.webrtc.org/10388): Fix and re-enable.
|
||||
TEST_F(QualityScalingTest,
|
||||
DISABLED_NoAdaptDownForHighQpWithFrameDroppingOff_Vp8) {
|
||||
// VP8 QP thresholds, low:1, high:1 -> high QP.
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "1,1,0,0,0,0" + kEnd);
|
||||
|
||||
// QualityScaler disabled.
|
||||
const bool kAutomaticResize = true;
|
||||
const bool kFrameDropping = false;
|
||||
const bool kExpectAdapt = false;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return VP8Encoder::Create(); });
|
||||
RunTest(&encoder_factory, "VP8", {true}, kHighStartBps, kAutomaticResize,
|
||||
kFrameDropping, kExpectAdapt);
|
||||
RunTest(&encoder_factory, "VP8", {true}, kHighStartBps,
|
||||
/*automatic_resize=*/false, /*expect_adaptation=*/false);
|
||||
}
|
||||
|
||||
TEST_F(QualityScalingTest, NoAdaptDownForNormalQp_Vp8) {
|
||||
// VP8 QP thresholds, low:1, high:127 -> normal QP.
|
||||
// qp_low:1, qp_high:127 -> kNormalQp
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "1,127,0,0,0,0" + kEnd);
|
||||
|
||||
// QualityScaler enabled.
|
||||
const bool kAutomaticResize = true;
|
||||
const bool kFrameDropping = true;
|
||||
const bool kExpectAdapt = false;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return VP8Encoder::Create(); });
|
||||
RunTest(&encoder_factory, "VP8", {true}, kHighStartBps, kAutomaticResize,
|
||||
kFrameDropping, kExpectAdapt);
|
||||
RunTest(&encoder_factory, "VP8", {true}, kHighStartBps,
|
||||
/*automatic_resize=*/true, /*expect_adaptation=*/false);
|
||||
}
|
||||
|
||||
TEST_F(QualityScalingTest, AdaptsDownForLowStartBitrate) {
|
||||
// VP8 QP thresholds, low:1, high:127 -> normal QP.
|
||||
// qp_low:1, qp_high:127 -> kNormalQp
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "1,127,0,0,0,0" + kEnd);
|
||||
|
||||
// QualityScaler enabled.
|
||||
const bool kAutomaticResize = true;
|
||||
const bool kFrameDropping = true;
|
||||
const bool kExpectAdapt = true;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return VP8Encoder::Create(); });
|
||||
RunTest(&encoder_factory, "VP8", {true}, kLowStartBps, kAutomaticResize,
|
||||
kFrameDropping, kExpectAdapt);
|
||||
RunTest(&encoder_factory, "VP8", {true}, kLowStartBps,
|
||||
/*automatic_resize=*/true, /*expect_adaptation=*/true);
|
||||
}
|
||||
|
||||
TEST_F(QualityScalingTest, NoAdaptDownForLowStartBitrate_Simulcast) {
|
||||
// VP8 QP thresholds, low:1, high:127 -> normal QP.
|
||||
// qp_low:1, qp_high:127 -> kNormalQp
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "1,127,0,0,0,0" + kEnd);
|
||||
|
||||
// QualityScaler disabled.
|
||||
const bool kAutomaticResize = false;
|
||||
const bool kFrameDropping = true;
|
||||
const bool kExpectAdapt = false;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return VP8Encoder::Create(); });
|
||||
RunTest(&encoder_factory, "VP8", {true, true}, kLowStartBps, kAutomaticResize,
|
||||
kFrameDropping, kExpectAdapt);
|
||||
RunTest(&encoder_factory, "VP8", {true, true}, kLowStartBps,
|
||||
/*automatic_resize=*/false, /*expect_adaptation=*/false);
|
||||
}
|
||||
|
||||
TEST_F(QualityScalingTest,
|
||||
AdaptsDownForLowStartBitrate_SimulcastOneActiveHighRes) {
|
||||
// VP8 QP thresholds, low:1, high:127 -> normal QP.
|
||||
// qp_low:1, qp_high:127 -> kNormalQp
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "1,127,0,0,0,0" + kEnd);
|
||||
|
||||
// QualityScaler enabled.
|
||||
const bool kAutomaticResize = true;
|
||||
const bool kFrameDropping = true;
|
||||
const bool kExpectAdapt = true;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return VP8Encoder::Create(); });
|
||||
RunTest(&encoder_factory, "VP8", {false, false, true}, kLowStartBps,
|
||||
kAutomaticResize, kFrameDropping, kExpectAdapt);
|
||||
/*automatic_resize=*/true, /*expect_adaptation=*/true);
|
||||
}
|
||||
|
||||
TEST_F(QualityScalingTest,
|
||||
NoAdaptDownForLowStartBitrate_SimulcastOneActiveLowRes) {
|
||||
// VP8 QP thresholds, low:1, high:127 -> normal QP.
|
||||
// qp_low:1, qp_high:127 -> kNormalQp
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "1,127,0,0,0,0" + kEnd);
|
||||
|
||||
// QualityScaler enabled.
|
||||
const bool kAutomaticResize = true;
|
||||
const bool kFrameDropping = true;
|
||||
const bool kExpectAdapt = false;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return VP8Encoder::Create(); });
|
||||
RunTest(&encoder_factory, "VP8", {true, false, false}, kLowStartBps,
|
||||
kAutomaticResize, kFrameDropping, kExpectAdapt);
|
||||
/*automatic_resize=*/true, /*expect_adaptation=*/false);
|
||||
}
|
||||
|
||||
TEST_F(QualityScalingTest, NoAdaptDownForLowStartBitrateWithScalingOff) {
|
||||
// VP8 QP thresholds, low:1, high:127 -> normal QP.
|
||||
// qp_low:1, qp_high:127 -> kNormalQp
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "1,127,0,0,0,0" + kEnd);
|
||||
|
||||
// QualityScaler disabled.
|
||||
const bool kAutomaticResize = false;
|
||||
const bool kFrameDropping = true;
|
||||
const bool kExpectAdapt = false;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return VP8Encoder::Create(); });
|
||||
RunTest(&encoder_factory, "VP8", {true}, kLowStartBps, kAutomaticResize,
|
||||
kFrameDropping, kExpectAdapt);
|
||||
RunTest(&encoder_factory, "VP8", {true}, kLowStartBps,
|
||||
/*automatic_resize=*/false, /*expect_adaptation=*/false);
|
||||
}
|
||||
|
||||
TEST_F(QualityScalingTest, NoAdaptDownForHighQp_Vp9) {
|
||||
// VP9 QP thresholds, low:1, high:1 -> high QP.
|
||||
// qp_low:1, qp_high:1 -> kHighQp
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "0,0,1,1,0,0" + kEnd +
|
||||
"WebRTC-VP9QualityScaler/Disabled/");
|
||||
|
||||
// QualityScaler always disabled.
|
||||
const bool kAutomaticResize = true;
|
||||
const bool kFrameDropping = true;
|
||||
const bool kExpectAdapt = false;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return VP9Encoder::Create(); });
|
||||
RunTest(&encoder_factory, "VP9", {true}, kHighStartBps, kAutomaticResize,
|
||||
kFrameDropping, kExpectAdapt);
|
||||
RunTest(&encoder_factory, "VP9", {true}, kHighStartBps,
|
||||
/*automatic_resize=*/true, /*expect_adaptation=*/false);
|
||||
}
|
||||
|
||||
#if defined(WEBRTC_USE_H264)
|
||||
TEST_F(QualityScalingTest, AdaptsDownForHighQp_H264) {
|
||||
// H264 QP thresholds, low:1, high:1 -> high QP.
|
||||
// qp_low:1, qp_high:1 -> kHighQp
|
||||
test::ScopedFieldTrials field_trials(kPrefix + "0,0,0,0,1,1" + kEnd);
|
||||
|
||||
// QualityScaler always enabled.
|
||||
const bool kAutomaticResize = false;
|
||||
const bool kFrameDropping = false;
|
||||
const bool kExpectAdapt = true;
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[]() { return H264Encoder::Create(cricket::VideoCodec("H264")); });
|
||||
RunTest(&encoder_factory, "H264", {true}, kHighStartBps, kAutomaticResize,
|
||||
kFrameDropping, kExpectAdapt);
|
||||
RunTest(&encoder_factory, "H264", {true}, kHighStartBps,
|
||||
/*automatic_resize=*/true, /*expect_adaptation=*/true);
|
||||
}
|
||||
#endif // defined(WEBRTC_USE_H264)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user