| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <string.h> | 11 #include <string.h> |
| 12 | 12 |
| 13 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 13 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
| 14 #include "webrtc/modules/video_processing/include/video_processing.h" | 14 #include "webrtc/modules/video_processing/include/video_processing.h" |
| 15 #include "webrtc/modules/video_processing/test/video_processing_unittest.h" | 15 #include "webrtc/modules/video_processing/test/video_processing_unittest.h" |
| 16 #include "webrtc/modules/video_processing/video_denoiser.h" | 16 #include "webrtc/modules/video_processing/video_denoiser.h" |
| 17 #include "webrtc/test/frame_utils.h" |
| 17 | 18 |
| 18 namespace webrtc { | 19 namespace webrtc { |
| 19 | 20 |
| 20 TEST_F(VideoProcessingTest, CopyMem) { | 21 TEST_F(VideoProcessingTest, CopyMem) { |
| 21 rtc::scoped_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false)); | 22 rtc::scoped_ptr<DenoiserFilter> df_c(DenoiserFilter::Create(false)); |
| 22 rtc::scoped_ptr<DenoiserFilter> df_sse_neon(DenoiserFilter::Create(true)); | 23 rtc::scoped_ptr<DenoiserFilter> df_sse_neon(DenoiserFilter::Create(true)); |
| 23 uint8_t src[16 * 16], dst[16 * 16]; | 24 uint8_t src[16 * 16], dst[16 * 16]; |
| 24 for (int i = 0; i < 16; ++i) { | 25 for (int i = 0; i < 16; ++i) { |
| 25 for (int j = 0; j < 16; ++j) { | 26 for (int j = 0; j < 16; ++j) { |
| 26 src[i * 16 + j] = i * 16 + j; | 27 src[i * 16 + j] = i * 16 + j; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 while (fread(video_buffer.get(), 1, frame_length_, source_file_) == | 142 while (fread(video_buffer.get(), 1, frame_length_, source_file_) == |
| 142 frame_length_) { | 143 frame_length_) { |
| 143 // Using ConvertToI420 to add stride to the image. | 144 // Using ConvertToI420 to add stride to the image. |
| 144 EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, height_, | 145 EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, height_, |
| 145 0, kVideoRotation_0, &video_frame_)); | 146 0, kVideoRotation_0, &video_frame_)); |
| 146 | 147 |
| 147 denoiser_c.DenoiseFrame(video_frame_, &denoised_frame_c); | 148 denoiser_c.DenoiseFrame(video_frame_, &denoised_frame_c); |
| 148 denoiser_sse_neon.DenoiseFrame(video_frame_, &denoised_frame_sse_neon); | 149 denoiser_sse_neon.DenoiseFrame(video_frame_, &denoised_frame_sse_neon); |
| 149 | 150 |
| 150 // Denoising results should be the same for C and SSE/NEON denoiser. | 151 // Denoising results should be the same for C and SSE/NEON denoiser. |
| 151 ASSERT_EQ(true, denoised_frame_c.EqualsFrame(denoised_frame_sse_neon)); | 152 ASSERT_TRUE(test::FramesEqual(denoised_frame_c, denoised_frame_sse_neon)); |
| 152 } | 153 } |
| 153 ASSERT_NE(0, feof(source_file_)) << "Error reading source file"; | 154 ASSERT_NE(0, feof(source_file_)) << "Error reading source file"; |
| 154 } | 155 } |
| 155 | 156 |
| 156 } // namespace webrtc | 157 } // namespace webrtc |
| OLD | NEW |