Revert "Updated analysis in videoprocessor."

This reverts commit 1880c7162bd3637c433f9421c798808cd6eacaf7.

Reason for revert: breaks internal tests

Original change's description:
> Updated analysis in videoprocessor.
> 
> - Run analysis after all frames are processed. Before part of it was
> done at bitrate change points;
> - Analysis is done for whole stream as well as for each rate update
> interval;
> - Changed units from number of frames to time units for some metrics
> and thresholds. E.g. 'num frames to hit tagret bitrate' is changed to
> 'time to reach target bitrate, sec';
> - Changed data type of FrameStatistic::max_nalu_length (renamed to
> max_nalu_size_bytes) from rtc::Optional to size_t. There it no need to
> use such advanced data type in such low level data structure.
> 
> Bug: webrtc:8524
> Change-Id: Ic9f6eab5b15ee12a80324b1f9c101de1bf3c702f
> Reviewed-on: https://webrtc-review.googlesource.com/31901
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21653}

TBR=brandtr@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,ssilkin@webrtc.org

Change-Id: Id0b7d387bbba02e71637b229aeed6f6cf012af46
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8524
Reviewed-on: https://webrtc-review.googlesource.com/40220
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21656}
This commit is contained in:
Sergey Silkin
2018-01-17 13:15:57 +00:00
committed by Commit Bot
parent 53d877c0f8
commit 18bc3e19c4
20 changed files with 916 additions and 741 deletions

View File

@ -19,25 +19,25 @@ namespace webrtc {
namespace test {
namespace {
const size_t kNumTemporalLayers = 2;
const int kNumTemporalLayers = 2;
} // namespace
TEST(TestConfig, NumberOfCoresWithUseSingleCore) {
TestConfig config;
config.use_single_core = true;
EXPECT_EQ(1u, config.NumberOfCores());
EXPECT_EQ(1, config.NumberOfCores());
}
TEST(TestConfig, NumberOfCoresWithoutUseSingleCore) {
TestConfig config;
config.use_single_core = false;
EXPECT_GE(config.NumberOfCores(), 1u);
EXPECT_GE(config.NumberOfCores(), 1);
}
TEST(TestConfig, NumberOfTemporalLayersIsOne) {
TestConfig config;
webrtc::test::CodecSettings(kVideoCodecH264, &config.codec_settings);
EXPECT_EQ(1u, config.NumberOfTemporalLayers());
EXPECT_EQ(1, config.NumberOfTemporalLayers());
}
TEST(TestConfig, NumberOfTemporalLayers_Vp8) {
@ -58,33 +58,33 @@ TEST(TestConfig, TemporalLayersForFrame_OneLayer) {
TestConfig config;
webrtc::test::CodecSettings(kVideoCodecVP8, &config.codec_settings);
config.codec_settings.VP8()->numberOfTemporalLayers = 1;
EXPECT_EQ(0u, config.TemporalLayerForFrame(0));
EXPECT_EQ(0u, config.TemporalLayerForFrame(1));
EXPECT_EQ(0u, config.TemporalLayerForFrame(2));
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(0u, config.TemporalLayerForFrame(0));
EXPECT_EQ(1u, config.TemporalLayerForFrame(1));
EXPECT_EQ(0u, config.TemporalLayerForFrame(2));
EXPECT_EQ(1u, config.TemporalLayerForFrame(3));
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(0u, config.TemporalLayerForFrame(0));
EXPECT_EQ(2u, config.TemporalLayerForFrame(1));
EXPECT_EQ(1u, config.TemporalLayerForFrame(2));
EXPECT_EQ(2u, config.TemporalLayerForFrame(3));
EXPECT_EQ(0u, config.TemporalLayerForFrame(4));
EXPECT_EQ(2u, config.TemporalLayerForFrame(5));
EXPECT_EQ(1u, config.TemporalLayerForFrame(6));
EXPECT_EQ(2u, config.TemporalLayerForFrame(7));
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, ForcedKeyFrameIntervalOff) {
@ -126,27 +126,26 @@ TEST(TestConfig, ToString_Vp8) {
config.codec_settings.VP8()->keyFrameInterval = 999;
EXPECT_EQ(
"\n Filename : yuvfile"
"\n # CPU cores used : 1"
"\n Filename : yuvfile"
"\n # CPU cores used : 1"
"\n General:"
"\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 # simulcast streams : 0"
"\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 VP8 specific: "
"\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",
"\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());
}