Chromium Code Reviews| Index: webrtc/modules/video_processing/test/denoiser_test.cc |
| diff --git a/webrtc/modules/video_processing/test/denoiser_test.cc b/webrtc/modules/video_processing/test/denoiser_test.cc |
| index e6a7fa62d0d17fb114a979cbf49d55bc206ab90f..291b6d234e96f99e4e2ee897eed5877797c7af94 100644 |
| --- a/webrtc/modules/video_processing/test/denoiser_test.cc |
| +++ b/webrtc/modules/video_processing/test/denoiser_test.cc |
| @@ -12,15 +12,15 @@ |
| #include <memory> |
| -#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
| -#include "webrtc/modules/video_processing/include/video_processing.h" |
| -#include "webrtc/modules/video_processing/test/video_processing_unittest.h" |
| +#include "webrtc/common_video/include/video_frame_buffer.h" |
| #include "webrtc/modules/video_processing/video_denoiser.h" |
| +#include "webrtc/test/gtest.h" |
| #include "webrtc/test/frame_utils.h" |
| +#include "webrtc/test/testsupport/fileutils.h" |
| namespace webrtc { |
| -TEST_F(VideoProcessingTest, CopyMem) { |
| +TEST(VideoDenoiserTest, CopyMem) { |
| std::unique_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false, nullptr)); |
| std::unique_ptr<DenoiserFilter> df_sse_neon( |
| DenoiserFilter::Create(true, nullptr)); |
| @@ -40,7 +40,7 @@ TEST_F(VideoProcessingTest, CopyMem) { |
| EXPECT_EQ(0, memcmp(src, dst, 16 * 16)); |
| } |
| -TEST_F(VideoProcessingTest, Variance) { |
| +TEST(VideoDenoiserTest, Variance) { |
| std::unique_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false, nullptr)); |
| std::unique_ptr<DenoiserFilter> df_sse_neon( |
| DenoiserFilter::Create(true, nullptr)); |
| @@ -64,7 +64,7 @@ TEST_F(VideoProcessingTest, Variance) { |
| EXPECT_EQ(var, df_sse_neon->Variance16x8(src, 16, dst, 16, &sse)); |
| } |
| -TEST_F(VideoProcessingTest, MbDenoise) { |
| +TEST(VideoDenoiserTest, MbDenoise) { |
| std::unique_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false, nullptr)); |
| std::unique_ptr<DenoiserFilter> df_sse_neon( |
| DenoiserFilter::Create(true, nullptr)); |
| @@ -125,9 +125,16 @@ TEST_F(VideoProcessingTest, MbDenoise) { |
| EXPECT_EQ(COPY_BLOCK, decision); |
| } |
| -// TODO(nisse): Refactor to not use test fixture. Can use some static |
| -// helper method to open the input file. |
| -TEST_F(VideoProcessingTest, Denoiser) { |
| +TEST(VideoDenoiserTest, Denoiser) { |
| + const int kWidth = 352; |
| + const int kHeight = 288; |
| + |
| + const std::string video_file = |
| + webrtc::test::ResourcePath("foreman_cif", "yuv"); |
| + FILE* source_file = fopen(video_file.c_str(), "rb"); |
| + ASSERT_TRUE(source_file != NULL) |
|
stefan-webrtc
2016/11/02 13:22:23
nullptr
|
| + << "Cannot open source file: " << video_file; |
| + |
| // Used in swap buffer. |
| int denoised_frame_toggle = 0; |
| // Create pure C denoiser. |
| @@ -141,7 +148,7 @@ TEST_F(VideoProcessingTest, Denoiser) { |
| for (;;) { |
| rtc::scoped_refptr<VideoFrameBuffer> video_frame_buffer( |
| - test::ReadI420Buffer(width_, height_, source_file_)); |
| + test::ReadI420Buffer(kWidth, kHeight, source_file)); |
| if (!video_frame_buffer) |
| break; |
| @@ -169,7 +176,7 @@ TEST_F(VideoProcessingTest, Denoiser) { |
| // Denoising results should be the same for C and SSE/NEON denoiser. |
| ASSERT_TRUE(test::FrameBufsEqual(*p_denoised_c, *p_denoised_sse_neon)); |
| } |
| - ASSERT_NE(0, feof(source_file_)) << "Error reading source file"; |
| + ASSERT_NE(0, feof(source_file)) << "Error reading source file"; |
| } |
| } // namespace webrtc |