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 "webrtc/common_video/libyuv/include/scaler.h" | 11 #include "webrtc/common_video/libyuv/include/scaler.h" |
12 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 12 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
13 #include "webrtc/modules/video_processing/video_denoiser.h" | 13 #include "webrtc/modules/video_processing/video_denoiser.h" |
14 | 14 |
| 15 namespace webrtc { |
| 16 |
15 #if DISPLAY // Rectangle diagnostics | 17 #if DISPLAY // Rectangle diagnostics |
16 static void CopyMem8x8(const uint8_t* src, | 18 static void CopyMem8x8(const uint8_t* src, |
17 int src_stride, | 19 int src_stride, |
18 uint8_t* dst, | 20 uint8_t* dst, |
19 int dst_stride) { | 21 int dst_stride) { |
20 for (int i = 0; i < 8; i++) { | 22 for (int i = 0; i < 8; i++) { |
21 memcpy(dst, src, 8); | 23 memcpy(dst, src, 8); |
22 src += src_stride; | 24 src += src_stride; |
23 dst += dst_stride; | 25 dst += dst_stride; |
24 } | 26 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 CopyMem8x8(mb_src_v, stride_v_, mb_dst_v, stride_v_); | 61 CopyMem8x8(mb_src_v, stride_v_, mb_dst_v, stride_v_); |
60 } else { | 62 } else { |
61 CopyMem8x8(mb_src_u, stride_u_, mb_dst_u, stride_u_); | 63 CopyMem8x8(mb_src_u, stride_u_, mb_dst_u, stride_u_); |
62 CopyMem8x8(mb_src_v, stride_v_, mb_dst_v, stride_v_); | 64 CopyMem8x8(mb_src_v, stride_v_, mb_dst_v, stride_v_); |
63 } | 65 } |
64 } | 66 } |
65 } | 67 } |
66 } | 68 } |
67 #endif | 69 #endif |
68 | 70 |
69 namespace webrtc { | |
70 | |
71 VideoDenoiser::VideoDenoiser(bool runtime_cpu_detection) | 71 VideoDenoiser::VideoDenoiser(bool runtime_cpu_detection) |
72 : width_(0), | 72 : width_(0), |
73 height_(0), | 73 height_(0), |
74 filter_(DenoiserFilter::Create(runtime_cpu_detection, &cpu_type_)), | 74 filter_(DenoiserFilter::Create(runtime_cpu_detection, &cpu_type_)), |
75 ne_(new NoiseEstimation()) {} | 75 ne_(new NoiseEstimation()) {} |
76 | 76 |
77 void VideoDenoiser::DenoiserReset(const VideoFrame& frame, | 77 void VideoDenoiser::DenoiserReset(const VideoFrame& frame, |
78 VideoFrame* denoised_frame, | 78 VideoFrame* denoised_frame, |
79 VideoFrame* denoised_frame_prev) { | 79 VideoFrame* denoised_frame_prev) { |
80 width_ = frame.width(); | 80 width_ = frame.width(); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 denoised_frame->set_render_time_ms(frame.render_time_ms()); | 319 denoised_frame->set_render_time_ms(frame.render_time_ms()); |
320 | 320 |
321 #if DISPLAY // Rectangle diagnostics | 321 #if DISPLAY // Rectangle diagnostics |
322 // Show rectangular region | 322 // Show rectangular region |
323 ShowRect(filter_, moving_edge_, moving_object_, x_density_, y_density_, u_src, | 323 ShowRect(filter_, moving_edge_, moving_object_, x_density_, y_density_, u_src, |
324 v_src, u_dst, v_dst, mb_rows_, mb_cols_, stride_u_, stride_v_); | 324 v_src, u_dst, v_dst, mb_rows_, mb_cols_, stride_u_, stride_v_); |
325 #endif | 325 #endif |
326 } | 326 } |
327 | 327 |
328 } // namespace webrtc | 328 } // namespace webrtc |
OLD | NEW |