Chromium Code Reviews| 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 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_DENOISER_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_DENOISER_H_ | 
| 12 #define WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_DENOISER_H_ | 12 #define WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_DENOISER_H_ | 
| 13 | 13 | 
| 14 #include <memory> | 14 #include <memory> | 
| 15 | 15 | 
| 16 #include "webrtc/modules/video_processing/util/denoiser_filter.h" | 16 #include "webrtc/modules/video_processing/util/denoiser_filter.h" | 
| 17 #include "webrtc/modules/video_processing/util/noise_estimation.h" | 17 #include "webrtc/modules/video_processing/util/noise_estimation.h" | 
| 18 #include "webrtc/modules/video_processing/util/skin_detection.h" | 18 #include "webrtc/modules/video_processing/util/skin_detection.h" | 
| 19 | 19 | 
| 20 namespace webrtc { | 20 namespace webrtc { | 
| 21 | 21 | 
| 22 class VideoDenoiser { | 22 class VideoDenoiser { | 
| 23 public: | 23 public: | 
| 24 explicit VideoDenoiser(bool runtime_cpu_detection); | 24 explicit VideoDenoiser(bool runtime_cpu_detection); | 
| 25 | |
| 25 void DenoiseFrame(const VideoFrame& frame, | 26 void DenoiseFrame(const VideoFrame& frame, | 
| 26 VideoFrame* denoised_frame, | 27 VideoFrame* denoised_frame, | 
| 27 VideoFrame* denoised_frame_track, | 28 VideoFrame* denoised_frame_prev, | 
| 28 int noise_level_prev); | 29 bool noise_estimation_enabled); | 
| 29 | 30 | 
| 30 private: | 31 private: | 
| 32 void DenoiserReset(const VideoFrame& frame, | |
| 33 VideoFrame* denoised_frame, | |
| 34 VideoFrame* denoised_frame_prev); | |
| 35 | |
| 36 int PositionCheck(int mb_row, int mb_col, int noise_level); | |
| 37 | |
| 38 void ReduceFalseDetection(const std::unique_ptr<uint8_t[]>& d_status, | |
| 39 std::unique_ptr<uint8_t[]>* d_status_red, | |
| 40 int noise_level); | |
| 41 | |
| 42 bool IsTrailingBlock(const std::unique_ptr<uint8_t[]>& d_status, | |
| 43 int mb_row, | |
| 44 int mb_col); | |
| 45 | |
| 46 void CopySrcOnMOB(const uint8_t* y_src, uint8_t* y_dst); | |
| 47 | |
| 31 int width_; | 48 int width_; | 
| 32 int height_; | 49 int height_; | 
| 50 int mb_rows_; | |
| 51 int mb_cols_; | |
| 52 int stride_y_; | |
| 53 int stride_u_; | |
| 54 int stride_v_; | |
| 33 CpuType cpu_type_; | 55 CpuType cpu_type_; | 
| 34 std::unique_ptr<DenoiseMetrics[]> metrics_; | |
| 35 std::unique_ptr<DenoiserFilter> filter_; | 56 std::unique_ptr<DenoiserFilter> filter_; | 
| 36 std::unique_ptr<NoiseEstimation> ne_; | 57 std::unique_ptr<NoiseEstimation> ne_; | 
| 37 std::unique_ptr<uint8_t[]> d_status_; | 58 std::unique_ptr<uint8_t[]> d_status_; | 
| 38 #if EXPERIMENTAL | 59 // Moving object detection (MOD) result. | 
| 
 
marpan
2016/04/12 23:10:19
no need to write "MOD" here? you don't reference i
 
jackychen_
2016/04/12 23:17:14
Fixed in patch 11.
 
 | |
| 39 std::unique_ptr<uint8_t[]> d_status_tmp1_; | 60 std::unique_ptr<uint8_t[]> mod_; | 
| 40 std::unique_ptr<uint8_t[]> d_status_tmp2_; | |
| 41 #endif | |
| 42 std::unique_ptr<uint8_t[]> x_density_; | 61 std::unique_ptr<uint8_t[]> x_density_; | 
| 43 std::unique_ptr<uint8_t[]> y_density_; | 62 std::unique_ptr<uint8_t[]> y_density_; | 
| 63 std::unique_ptr<DenoiserDecision[]> mb_filter_decision_; | |
| 44 }; | 64 }; | 
| 45 | 65 | 
| 46 } // namespace webrtc | 66 } // namespace webrtc | 
| 47 | 67 | 
| 48 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_DENOISER_H_ | 68 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_DENOISER_H_ | 
| OLD | NEW |