Move VideoCodecTest configuration classes to api/test.
These files are required when implementing tests based on the test fixture, and should be exposed as part of the test api. This CL also removes a usage of stringstream and fixes some chromium-style lint issues. Bug: webrtc:8982, webrtc:163 Change-Id: I132aea0da79a79587887f21897236fc9802b7574 Reviewed-on: https://webrtc-review.googlesource.com/74586 Commit-Queue: Kári Helgason <kthelgason@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org> Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23346}
This commit is contained in:
committed by
Commit Bot
parent
dac94538a8
commit
169005d8c1
@ -12,7 +12,6 @@
|
||||
|
||||
#include "api/test/create_videocodec_test_fixture.h"
|
||||
#include "media/base/mediaconstants.h"
|
||||
#include "modules/video_coding/codecs/test/test_config.h"
|
||||
#include "modules/video_coding/utility/vp8_header_parser.h"
|
||||
#include "modules/video_coding/utility/vp9_uncompressed_header_parser.h"
|
||||
#include "rtc_base/ptr_util.h"
|
||||
@ -22,6 +21,8 @@
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
||||
using VideoStatistics = VideoCodecTestStats::VideoStatistics;
|
||||
|
||||
namespace {
|
||||
// Codec settings.
|
||||
const int kCifWidth = 352;
|
||||
@ -33,7 +34,7 @@ const size_t kBitrateRdPerfKbps[] = {100, 200, 300, 400, 500, 600,
|
||||
1800, 2000, 2200, 2500};
|
||||
const size_t kNumFirstFramesToSkipAtRdPerfAnalysis = 60;
|
||||
|
||||
class QpFrameChecker : public TestConfig::EncodedFrameChecker {
|
||||
class QpFrameChecker : public VideoCodecTestFixture::EncodedFrameChecker {
|
||||
public:
|
||||
void CheckEncodedFrame(webrtc::VideoCodecType codec,
|
||||
const EncodedImage& encoded_frame) const override {
|
||||
@ -51,8 +52,8 @@ class QpFrameChecker : public TestConfig::EncodedFrameChecker {
|
||||
}
|
||||
};
|
||||
|
||||
TestConfig CreateTestConfig() {
|
||||
TestConfig config;
|
||||
VideoCodecTestFixture::Config CreateConfig() {
|
||||
VideoCodecTestFixture::Config config;
|
||||
config.filename = "foreman_cif";
|
||||
config.filepath = ResourcePath(config.filename, "yuv");
|
||||
config.num_frames = kNumFramesLong;
|
||||
@ -88,7 +89,7 @@ void PrintRdPerf(std::map<size_t, std::vector<VideoStatistics>> rd_stats) {
|
||||
|
||||
#if !defined(RTC_DISABLE_VP9)
|
||||
TEST(VideoCodecTestLibvpx, HighBitrateVP9) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
config.num_frames = kNumFramesShort;
|
||||
@ -108,7 +109,7 @@ TEST(VideoCodecTestLibvpx, HighBitrateVP9) {
|
||||
}
|
||||
|
||||
TEST(VideoCodecTestLibvpx, ChangeBitrateVP9) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = rtc::MakeUnique<QpFrameChecker>();
|
||||
@ -133,7 +134,7 @@ TEST(VideoCodecTestLibvpx, ChangeBitrateVP9) {
|
||||
}
|
||||
|
||||
TEST(VideoCodecTestLibvpx, ChangeFramerateVP9) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = rtc::MakeUnique<QpFrameChecker>();
|
||||
@ -160,7 +161,7 @@ TEST(VideoCodecTestLibvpx, ChangeFramerateVP9) {
|
||||
}
|
||||
|
||||
TEST(VideoCodecTestLibvpx, DenoiserOnVP9) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, true, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
config.num_frames = kNumFramesShort;
|
||||
@ -180,7 +181,7 @@ TEST(VideoCodecTestLibvpx, DenoiserOnVP9) {
|
||||
}
|
||||
|
||||
TEST(VideoCodecTestLibvpx, VeryLowBitrateVP9) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, true,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = rtc::MakeUnique<QpFrameChecker>();
|
||||
@ -204,7 +205,7 @@ TEST(VideoCodecTestLibvpx, VeryLowBitrateVP9) {
|
||||
#endif // !defined(RTC_DISABLE_VP9)
|
||||
|
||||
TEST(VideoCodecTestLibvpx, HighBitrateVP8) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 1, true, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
config.num_frames = kNumFramesShort;
|
||||
@ -242,7 +243,7 @@ TEST(VideoCodecTestLibvpx, HighBitrateVP8) {
|
||||
#define MAYBE_ChangeBitrateVP8 ChangeBitrateVP8
|
||||
#endif
|
||||
TEST(VideoCodecTestLibvpx, MAYBE_ChangeBitrateVP8) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 1, true, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = rtc::MakeUnique<QpFrameChecker>();
|
||||
@ -277,7 +278,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_ChangeBitrateVP8) {
|
||||
#define MAYBE_ChangeFramerateVP8 ChangeFramerateVP8
|
||||
#endif
|
||||
TEST(VideoCodecTestLibvpx, MAYBE_ChangeFramerateVP8) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 1, true, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = rtc::MakeUnique<QpFrameChecker>();
|
||||
@ -317,7 +318,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_ChangeFramerateVP8) {
|
||||
#define MAYBE_TemporalLayersVP8 TemporalLayersVP8
|
||||
#endif
|
||||
TEST(VideoCodecTestLibvpx, MAYBE_TemporalLayersVP8) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 3, true, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = rtc::MakeUnique<QpFrameChecker>();
|
||||
@ -353,7 +354,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_TemporalLayersVP8) {
|
||||
#define MAYBE_MultiresVP8 MultiresVP8
|
||||
#endif
|
||||
TEST(VideoCodecTestLibvpx, MAYBE_MultiresVP8) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.filename = "ConferenceMotion_1280_720_50";
|
||||
config.filepath = ResourcePath(config.filename, "yuv");
|
||||
config.num_frames = 100;
|
||||
@ -379,7 +380,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_MultiresVP8) {
|
||||
#define MAYBE_SimulcastVP8 SimulcastVP8
|
||||
#endif
|
||||
TEST(VideoCodecTestLibvpx, MAYBE_SimulcastVP8) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.filename = "ConferenceMotion_1280_720_50";
|
||||
config.filepath = ResourcePath(config.filename, "yuv");
|
||||
config.num_frames = 100;
|
||||
@ -406,7 +407,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_SimulcastVP8) {
|
||||
#define MAYBE_SvcVP9 SvcVP9
|
||||
#endif
|
||||
TEST(VideoCodecTestLibvpx, MAYBE_SvcVP9) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.filename = "ConferenceMotion_1280_720_50";
|
||||
config.filepath = ResourcePath(config.filename, "yuv");
|
||||
config.num_frames = 100;
|
||||
@ -427,7 +428,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_SvcVP9) {
|
||||
}
|
||||
|
||||
TEST(VideoCodecTestLibvpx, DISABLED_MultiresVP8RdPerf) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.filename = "FourPeople_1280x720_30";
|
||||
config.filepath = ResourcePath(config.filename, "yuv");
|
||||
config.num_frames = 300;
|
||||
@ -454,7 +455,7 @@ TEST(VideoCodecTestLibvpx, DISABLED_MultiresVP8RdPerf) {
|
||||
}
|
||||
|
||||
TEST(VideoCodecTestLibvpx, DISABLED_SvcVP9RdPerf) {
|
||||
auto config = CreateTestConfig();
|
||||
auto config = CreateConfig();
|
||||
config.filename = "FourPeople_1280x720_30";
|
||||
config.filepath = ResourcePath(config.filename, "yuv");
|
||||
config.num_frames = 300;
|
||||
|
||||
Reference in New Issue
Block a user