jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_DENOISER_H_ |
| 12 | #define WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_DENOISER_H_ |
| 13 | |
kwiberg | e065fcf | 2016-03-02 01:01:11 -0800 | [diff] [blame] | 14 | #include <memory> |
| 15 | |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 16 | #include "webrtc/modules/video_processing/util/denoiser_filter.h" |
jackychen | fa0befe | 2016-04-01 07:46:58 -0700 | [diff] [blame^] | 17 | #include "webrtc/modules/video_processing/util/noise_estimation.h" |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 18 | #include "webrtc/modules/video_processing/util/skin_detection.h" |
| 19 | |
| 20 | namespace webrtc { |
| 21 | |
| 22 | class VideoDenoiser { |
| 23 | public: |
jackychen | 67e94fb | 2016-01-11 21:34:07 -0800 | [diff] [blame] | 24 | explicit VideoDenoiser(bool runtime_cpu_detection); |
jackychen | fa0befe | 2016-04-01 07:46:58 -0700 | [diff] [blame^] | 25 | void DenoiseFrame(const VideoFrame& frame, |
| 26 | VideoFrame* denoised_frame, |
| 27 | VideoFrame* denoised_frame_track, |
| 28 | int noise_level_prev); |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 29 | |
| 30 | private: |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 31 | int width_; |
| 32 | int height_; |
jackychen | fa0befe | 2016-04-01 07:46:58 -0700 | [diff] [blame^] | 33 | CpuType cpu_type_; |
kwiberg | e065fcf | 2016-03-02 01:01:11 -0800 | [diff] [blame] | 34 | std::unique_ptr<DenoiseMetrics[]> metrics_; |
| 35 | std::unique_ptr<DenoiserFilter> filter_; |
jackychen | fa0befe | 2016-04-01 07:46:58 -0700 | [diff] [blame^] | 36 | std::unique_ptr<NoiseEstimation> ne_; |
| 37 | std::unique_ptr<uint8_t[]> d_status_; |
| 38 | #if EXPERIMENTAL |
| 39 | std::unique_ptr<uint8_t[]> d_status_tmp1_; |
| 40 | std::unique_ptr<uint8_t[]> d_status_tmp2_; |
| 41 | #endif |
| 42 | std::unique_ptr<uint8_t[]> x_density_; |
| 43 | std::unique_ptr<uint8_t[]> y_density_; |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | } // namespace webrtc |
| 47 | |
| 48 | #endif // WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_DENOISER_H_ |