blob: 03b30d91c7f74087547a3f223ee12e61bcf289db [file] [log] [blame]
jackychen8f9902a2015-11-26 02:59:48 -08001/*
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
kwiberge065fcf2016-03-02 01:01:11 -080014#include <memory>
15
jackychen8f9902a2015-11-26 02:59:48 -080016#include "webrtc/modules/video_processing/util/denoiser_filter.h"
jackychenfa0befe2016-04-01 07:46:58 -070017#include "webrtc/modules/video_processing/util/noise_estimation.h"
jackychen8f9902a2015-11-26 02:59:48 -080018#include "webrtc/modules/video_processing/util/skin_detection.h"
19
20namespace webrtc {
21
22class VideoDenoiser {
23 public:
jackychen67e94fb2016-01-11 21:34:07 -080024 explicit VideoDenoiser(bool runtime_cpu_detection);
jackychenfa0befe2016-04-01 07:46:58 -070025 void DenoiseFrame(const VideoFrame& frame,
26 VideoFrame* denoised_frame,
27 VideoFrame* denoised_frame_track,
28 int noise_level_prev);
jackychen8f9902a2015-11-26 02:59:48 -080029
30 private:
jackychen8f9902a2015-11-26 02:59:48 -080031 int width_;
32 int height_;
jackychenfa0befe2016-04-01 07:46:58 -070033 CpuType cpu_type_;
kwiberge065fcf2016-03-02 01:01:11 -080034 std::unique_ptr<DenoiseMetrics[]> metrics_;
35 std::unique_ptr<DenoiserFilter> filter_;
jackychenfa0befe2016-04-01 07:46:58 -070036 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_;
jackychen8f9902a2015-11-26 02:59:48 -080044};
45
46} // namespace webrtc
47
48#endif // WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_DENOISER_H_