Revert of Enable video processing unittest to take video clips as param. (patchset #1 id:1 of https://codereview.webrtc.org/1907353004/ )
Reason for revert: Candidate culprit CL for breaking the gtest initialization on DrMemory. Original issue's description: > Enable video processing unittest to take video clips as param. > > This change enables video processing unittest (including all tests under > it, e.g. denoiser test) to use a set of video clips as param, which is > important if we want to do a regression test on the visual quality > offline. > > BUG= > > Committed: https://crrev.com/6d94e5224a3d3b1a6d66a428dbe75af7106e8d60 > Cr-Commit-Position: refs/heads/master@{#12485} TBR=marpan@webrtc.org,jackychen@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= Review URL: https://codereview.webrtc.org/1915973002 Cr-Commit-Position: refs/heads/master@{#12490}
This commit is contained in:
parent
e0a78456e5
commit
f55f58d45d
@ -21,7 +21,7 @@ namespace webrtc {
|
|||||||
#else
|
#else
|
||||||
#define MAYBE_BrightnessDetection BrightnessDetection
|
#define MAYBE_BrightnessDetection BrightnessDetection
|
||||||
#endif
|
#endif
|
||||||
TEST_P(VideoProcessingTest, MAYBE_BrightnessDetection) {
|
TEST_F(VideoProcessingTest, MAYBE_BrightnessDetection) {
|
||||||
uint32_t frameNum = 0;
|
uint32_t frameNum = 0;
|
||||||
int32_t brightnessWarning = 0;
|
int32_t brightnessWarning = 0;
|
||||||
uint32_t warningCount = 0;
|
uint32_t warningCount = 0;
|
||||||
|
|||||||
@ -18,9 +18,9 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
TEST_P(VideoProcessingTest, DISABLED_ContentAnalysis) {
|
TEST_F(VideoProcessingTest, DISABLED_ContentAnalysis) {
|
||||||
#else
|
#else
|
||||||
TEST_P(VideoProcessingTest, ContentAnalysis) {
|
TEST_F(VideoProcessingTest, ContentAnalysis) {
|
||||||
#endif
|
#endif
|
||||||
VPMContentAnalysis ca__c(false);
|
VPMContentAnalysis ca__c(false);
|
||||||
VPMContentAnalysis ca__sse(true);
|
VPMContentAnalysis ca__sse(true);
|
||||||
|
|||||||
@ -22,9 +22,9 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
TEST_P(VideoProcessingTest, DISABLED_Deflickering) {
|
TEST_F(VideoProcessingTest, DISABLED_Deflickering) {
|
||||||
#else
|
#else
|
||||||
TEST_P(VideoProcessingTest, Deflickering) {
|
TEST_F(VideoProcessingTest, Deflickering) {
|
||||||
#endif
|
#endif
|
||||||
enum { NumRuns = 30 };
|
enum { NumRuns = 30 };
|
||||||
uint32_t frameNum = 0;
|
uint32_t frameNum = 0;
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
TEST_P(VideoProcessingTest, CopyMem) {
|
TEST_F(VideoProcessingTest, CopyMem) {
|
||||||
std::unique_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false, nullptr));
|
std::unique_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false, nullptr));
|
||||||
std::unique_ptr<DenoiserFilter> df_sse_neon(
|
std::unique_ptr<DenoiserFilter> df_sse_neon(
|
||||||
DenoiserFilter::Create(true, nullptr));
|
DenoiserFilter::Create(true, nullptr));
|
||||||
@ -40,7 +40,7 @@ TEST_P(VideoProcessingTest, CopyMem) {
|
|||||||
EXPECT_EQ(0, memcmp(src, dst, 16 * 16));
|
EXPECT_EQ(0, memcmp(src, dst, 16 * 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(VideoProcessingTest, Variance) {
|
TEST_F(VideoProcessingTest, Variance) {
|
||||||
std::unique_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false, nullptr));
|
std::unique_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false, nullptr));
|
||||||
std::unique_ptr<DenoiserFilter> df_sse_neon(
|
std::unique_ptr<DenoiserFilter> df_sse_neon(
|
||||||
DenoiserFilter::Create(true, nullptr));
|
DenoiserFilter::Create(true, nullptr));
|
||||||
@ -64,7 +64,7 @@ TEST_P(VideoProcessingTest, Variance) {
|
|||||||
EXPECT_EQ(var, df_sse_neon->Variance16x8(src, 16, dst, 16, &sse));
|
EXPECT_EQ(var, df_sse_neon->Variance16x8(src, 16, dst, 16, &sse));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(VideoProcessingTest, MbDenoise) {
|
TEST_F(VideoProcessingTest, MbDenoise) {
|
||||||
std::unique_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false, nullptr));
|
std::unique_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false, nullptr));
|
||||||
std::unique_ptr<DenoiserFilter> df_sse_neon(
|
std::unique_ptr<DenoiserFilter> df_sse_neon(
|
||||||
DenoiserFilter::Create(true, nullptr));
|
DenoiserFilter::Create(true, nullptr));
|
||||||
@ -125,7 +125,7 @@ TEST_P(VideoProcessingTest, MbDenoise) {
|
|||||||
EXPECT_EQ(COPY_BLOCK, decision);
|
EXPECT_EQ(COPY_BLOCK, decision);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(VideoProcessingTest, Denoiser) {
|
TEST_F(VideoProcessingTest, Denoiser) {
|
||||||
// Used in swap buffer.
|
// Used in swap buffer.
|
||||||
int denoised_frame_toggle = 0;
|
int denoised_frame_toggle = 0;
|
||||||
// Create pure C denoiser.
|
// Create pure C denoiser.
|
||||||
|
|||||||
@ -59,10 +59,9 @@ static void WriteProcessedFrameForVisualInspection(const VideoFrame& source,
|
|||||||
VideoProcessingTest::VideoProcessingTest()
|
VideoProcessingTest::VideoProcessingTest()
|
||||||
: vp_(NULL),
|
: vp_(NULL),
|
||||||
source_file_(NULL),
|
source_file_(NULL),
|
||||||
vtt_(GetParam()),
|
width_(352),
|
||||||
width_(vtt_.width),
|
|
||||||
half_width_((width_ + 1) / 2),
|
half_width_((width_ + 1) / 2),
|
||||||
height_(vtt_.height),
|
height_(288),
|
||||||
size_y_(width_ * height_),
|
size_y_(width_ * height_),
|
||||||
size_uv_(half_width_ * ((height_ + 1) / 2)),
|
size_uv_(half_width_ * ((height_ + 1) / 2)),
|
||||||
frame_length_(CalcBufferSize(kI420, width_, height_)) {}
|
frame_length_(CalcBufferSize(kI420, width_, height_)) {}
|
||||||
@ -70,15 +69,18 @@ VideoProcessingTest::VideoProcessingTest()
|
|||||||
void VideoProcessingTest::SetUp() {
|
void VideoProcessingTest::SetUp() {
|
||||||
vp_ = VideoProcessing::Create();
|
vp_ = VideoProcessing::Create();
|
||||||
ASSERT_TRUE(vp_ != NULL);
|
ASSERT_TRUE(vp_ != NULL);
|
||||||
|
|
||||||
video_frame_.CreateEmptyFrame(width_, height_, width_,
|
video_frame_.CreateEmptyFrame(width_, height_, width_,
|
||||||
half_width_, half_width_);
|
half_width_, half_width_);
|
||||||
// Clear video frame so DrMemory/Valgrind will allow reads of the buffer.
|
// Clear video frame so DrMemory/Valgrind will allow reads of the buffer.
|
||||||
memset(video_frame_.buffer(kYPlane), 0, video_frame_.allocated_size(kYPlane));
|
memset(video_frame_.buffer(kYPlane), 0, video_frame_.allocated_size(kYPlane));
|
||||||
memset(video_frame_.buffer(kUPlane), 0, video_frame_.allocated_size(kUPlane));
|
memset(video_frame_.buffer(kUPlane), 0, video_frame_.allocated_size(kUPlane));
|
||||||
memset(video_frame_.buffer(kVPlane), 0, video_frame_.allocated_size(kVPlane));
|
memset(video_frame_.buffer(kVPlane), 0, video_frame_.allocated_size(kVPlane));
|
||||||
source_file_ = fopen(vtt_.file_name.c_str(), "rb");
|
const std::string video_file =
|
||||||
|
webrtc::test::ResourcePath("foreman_cif", "yuv");
|
||||||
|
source_file_ = fopen(video_file.c_str(), "rb");
|
||||||
ASSERT_TRUE(source_file_ != NULL)
|
ASSERT_TRUE(source_file_ != NULL)
|
||||||
<< "Cannot read source file: " + vtt_.file_name + "\n";
|
<< "Cannot read source file: " + video_file + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoProcessingTest::TearDown() {
|
void VideoProcessingTest::TearDown() {
|
||||||
@ -91,9 +93,9 @@ void VideoProcessingTest::TearDown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
TEST_P(VideoProcessingTest, DISABLED_HandleNullBuffer) {
|
TEST_F(VideoProcessingTest, DISABLED_HandleNullBuffer) {
|
||||||
#else
|
#else
|
||||||
TEST_P(VideoProcessingTest, HandleNullBuffer) {
|
TEST_F(VideoProcessingTest, HandleNullBuffer) {
|
||||||
#endif
|
#endif
|
||||||
// TODO(mikhal/stefan): Do we need this one?
|
// TODO(mikhal/stefan): Do we need this one?
|
||||||
VideoProcessing::FrameStats stats;
|
VideoProcessing::FrameStats stats;
|
||||||
@ -109,9 +111,9 @@ TEST_P(VideoProcessingTest, HandleNullBuffer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
TEST_P(VideoProcessingTest, DISABLED_HandleBadStats) {
|
TEST_F(VideoProcessingTest, DISABLED_HandleBadStats) {
|
||||||
#else
|
#else
|
||||||
TEST_P(VideoProcessingTest, HandleBadStats) {
|
TEST_F(VideoProcessingTest, HandleBadStats) {
|
||||||
#endif
|
#endif
|
||||||
VideoProcessing::FrameStats stats;
|
VideoProcessing::FrameStats stats;
|
||||||
vp_->ClearFrameStats(&stats);
|
vp_->ClearFrameStats(&stats);
|
||||||
@ -127,9 +129,9 @@ TEST_P(VideoProcessingTest, HandleBadStats) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
TEST_P(VideoProcessingTest, DISABLED_IdenticalResultsAfterReset) {
|
TEST_F(VideoProcessingTest, DISABLED_IdenticalResultsAfterReset) {
|
||||||
#else
|
#else
|
||||||
TEST_P(VideoProcessingTest, IdenticalResultsAfterReset) {
|
TEST_F(VideoProcessingTest, IdenticalResultsAfterReset) {
|
||||||
#endif
|
#endif
|
||||||
VideoFrame video_frame2;
|
VideoFrame video_frame2;
|
||||||
VideoProcessing::FrameStats stats;
|
VideoProcessing::FrameStats stats;
|
||||||
@ -164,9 +166,9 @@ TEST_P(VideoProcessingTest, IdenticalResultsAfterReset) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
TEST_P(VideoProcessingTest, DISABLED_FrameStats) {
|
TEST_F(VideoProcessingTest, DISABLED_FrameStats) {
|
||||||
#else
|
#else
|
||||||
TEST_P(VideoProcessingTest, FrameStats) {
|
TEST_F(VideoProcessingTest, FrameStats) {
|
||||||
#endif
|
#endif
|
||||||
VideoProcessing::FrameStats stats;
|
VideoProcessing::FrameStats stats;
|
||||||
vp_->ClearFrameStats(&stats);
|
vp_->ClearFrameStats(&stats);
|
||||||
@ -193,9 +195,9 @@ TEST_P(VideoProcessingTest, FrameStats) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
TEST_P(VideoProcessingTest, DISABLED_PreprocessorLogic) {
|
TEST_F(VideoProcessingTest, DISABLED_PreprocessorLogic) {
|
||||||
#else
|
#else
|
||||||
TEST_P(VideoProcessingTest, PreprocessorLogic) {
|
TEST_F(VideoProcessingTest, PreprocessorLogic) {
|
||||||
#endif
|
#endif
|
||||||
// Disable temporal sampling (frame dropping).
|
// Disable temporal sampling (frame dropping).
|
||||||
vp_->EnableTemporalDecimation(false);
|
vp_->EnableTemporalDecimation(false);
|
||||||
@ -216,9 +218,9 @@ TEST_P(VideoProcessingTest, PreprocessorLogic) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
TEST_P(VideoProcessingTest, DISABLED_Resampler) {
|
TEST_F(VideoProcessingTest, DISABLED_Resampler) {
|
||||||
#else
|
#else
|
||||||
TEST_P(VideoProcessingTest, Resampler) {
|
TEST_F(VideoProcessingTest, Resampler) {
|
||||||
#endif
|
#endif
|
||||||
enum { NumRuns = 1 };
|
enum { NumRuns = 1 };
|
||||||
|
|
||||||
@ -305,12 +307,6 @@ TEST_P(VideoProcessingTest, Resampler) {
|
|||||||
printf("Min run time = %d us / frame\n\n", static_cast<int>(min_runtime));
|
printf("Min run time = %d us / frame\n\n", static_cast<int>(min_runtime));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ForemanCif,
|
|
||||||
VideoProcessingTest,
|
|
||||||
::testing::Values(VideoToTest(
|
|
||||||
{webrtc::test::ResourcePath("foreman_cif", "yuv"),
|
|
||||||
352, 288})));
|
|
||||||
|
|
||||||
void PreprocessFrameAndVerify(const VideoFrame& source,
|
void PreprocessFrameAndVerify(const VideoFrame& source,
|
||||||
int target_width,
|
int target_width,
|
||||||
int target_height,
|
int target_height,
|
||||||
|
|||||||
@ -20,27 +20,26 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
typedef struct {
|
class VideoProcessingTest : public ::testing::Test {
|
||||||
std::string file_name;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
} VideoToTest;
|
|
||||||
|
|
||||||
class VideoProcessingTest : public ::testing::TestWithParam<VideoToTest> {
|
|
||||||
protected:
|
protected:
|
||||||
VideoProcessingTest();
|
VideoProcessingTest();
|
||||||
virtual void SetUp();
|
virtual void SetUp();
|
||||||
virtual void TearDown();
|
virtual void TearDown();
|
||||||
|
static void SetUpTestCase() {
|
||||||
|
Trace::CreateTrace();
|
||||||
|
std::string trace_file = webrtc::test::OutputPath() + "VPMTrace.txt";
|
||||||
|
ASSERT_EQ(0, Trace::SetTraceFile(trace_file.c_str()));
|
||||||
|
}
|
||||||
|
static void TearDownTestCase() { Trace::ReturnTrace(); }
|
||||||
VideoProcessing* vp_;
|
VideoProcessing* vp_;
|
||||||
FILE* source_file_;
|
FILE* source_file_;
|
||||||
VideoFrame video_frame_;
|
VideoFrame video_frame_;
|
||||||
VideoToTest vtt_;
|
const int width_;
|
||||||
int width_;
|
const int half_width_;
|
||||||
int half_width_;
|
const int height_;
|
||||||
int height_;
|
const int size_y_;
|
||||||
int size_y_;
|
const int size_uv_;
|
||||||
int size_uv_;
|
const size_t frame_length_;
|
||||||
size_t frame_length_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user