Make VideoProcessor::Init/Release methods private and call from constructor/destructor.

TestConfig: Replace Print method with ToString and add test.

Bug: none
Change-Id: I9853cb16875199a51c5731d1cec326159751d001
Reviewed-on: https://webrtc-review.googlesource.com/14320
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20420}
This commit is contained in:
Åsa Persson
2017-10-24 16:03:39 +02:00
committed by Commit Bot
parent c22a3a6a7d
commit f0c44672df
8 changed files with 255 additions and 215 deletions

View File

@ -51,5 +51,81 @@ TEST(TestConfig, NumberOfTemporalLayers_Vp9) {
EXPECT_EQ(kNumTemporalLayers, config.NumberOfTemporalLayers());
}
TEST(TestConfig, TemporalLayersForFrame_OneLayer) {
TestConfig config;
webrtc::test::CodecSettings(kVideoCodecVP8, &config.codec_settings);
config.codec_settings.VP8()->numberOfTemporalLayers = 1;
EXPECT_EQ(0, config.TemporalLayerForFrame(0));
EXPECT_EQ(0, config.TemporalLayerForFrame(1));
EXPECT_EQ(0, config.TemporalLayerForFrame(2));
}
TEST(TestConfig, TemporalLayersForFrame_TwoLayers) {
TestConfig config;
webrtc::test::CodecSettings(kVideoCodecVP8, &config.codec_settings);
config.codec_settings.VP8()->numberOfTemporalLayers = 2;
EXPECT_EQ(0, config.TemporalLayerForFrame(0));
EXPECT_EQ(1, config.TemporalLayerForFrame(1));
EXPECT_EQ(0, config.TemporalLayerForFrame(2));
EXPECT_EQ(1, config.TemporalLayerForFrame(3));
}
TEST(TestConfig, TemporalLayersForFrame_ThreeLayers) {
TestConfig config;
webrtc::test::CodecSettings(kVideoCodecVP8, &config.codec_settings);
config.codec_settings.VP8()->numberOfTemporalLayers = 3;
EXPECT_EQ(0, config.TemporalLayerForFrame(0));
EXPECT_EQ(2, config.TemporalLayerForFrame(1));
EXPECT_EQ(1, config.TemporalLayerForFrame(2));
EXPECT_EQ(2, config.TemporalLayerForFrame(3));
EXPECT_EQ(0, config.TemporalLayerForFrame(4));
EXPECT_EQ(2, config.TemporalLayerForFrame(5));
EXPECT_EQ(1, config.TemporalLayerForFrame(6));
EXPECT_EQ(2, config.TemporalLayerForFrame(7));
}
TEST(TestConfig, ToString_Vp8) {
TestConfig config;
config.filename = "yuvfile";
config.use_single_core = true;
config.SetCodecSettings(kVideoCodecVP8, 2, true, // error_concealment_on,
false, // denoising_on,
false, // frame_dropper_on,
true, // spatial_resize_on,
false, // resilience_on,
320, 180);
config.codec_settings.startBitrate = 400;
config.codec_settings.maxBitrate = 500;
config.codec_settings.minBitrate = 70;
config.codec_settings.maxFramerate = 35;
config.codec_settings.qpMax = 66;
config.codec_settings.VP8()->complexity = kComplexityNormal;
config.codec_settings.VP8()->keyFrameInterval = 999;
EXPECT_EQ(
"Video config:"
"\n Filename : yuvfile"
"\n # CPU cores used : 1"
"\n Codec settings:"
"\n Codec type : VP8"
"\n Start bitrate : 400 kbps"
"\n Max bitrate : 500 kbps"
"\n Min bitrate : 70 kbps"
"\n Width : 320"
"\n Height : 180"
"\n Max frame rate : 35"
"\n QPmax : 66"
"\n Complexity : 0"
"\n Resilience : 0"
"\n # temporal layers : 2"
"\n Denoising : 0"
"\n Error concealment : 1"
"\n Automatic resize : 1"
"\n Frame dropping : 0"
"\n Key frame interval: 999\n",
config.ToString());
}
} // namespace test
} // namespace webrtc