Line data Source code
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_UTIL_DENOISER_FILTER_H_
12 : #define WEBRTC_MODULES_VIDEO_PROCESSING_UTIL_DENOISER_FILTER_H_
13 :
14 : #include <climits>
15 : #include <memory>
16 :
17 : #include "webrtc/modules/include/module_common_types.h"
18 :
19 : namespace webrtc {
20 :
21 : extern const int kMotionMagnitudeThreshold;
22 : extern const int kSumDiffThreshold;
23 : extern const int kSumDiffThresholdHigh;
24 :
25 : enum DenoiserDecision { COPY_BLOCK, FILTER_BLOCK };
26 : enum CpuType { CPU_NEON, CPU_NOT_NEON };
27 :
28 0 : class DenoiserFilter {
29 : public:
30 : static std::unique_ptr<DenoiserFilter> Create(bool runtime_cpu_detection,
31 : CpuType* cpu_type);
32 :
33 0 : virtual ~DenoiserFilter() {}
34 :
35 : virtual void CopyMem16x16(const uint8_t* src,
36 : int src_stride,
37 : uint8_t* dst,
38 : int dst_stride) = 0;
39 : virtual uint32_t Variance16x8(const uint8_t* a,
40 : int a_stride,
41 : const uint8_t* b,
42 : int b_stride,
43 : unsigned int* sse) = 0;
44 : virtual DenoiserDecision MbDenoise(const uint8_t* mc_running_avg_y,
45 : int mc_avg_y_stride,
46 : uint8_t* running_avg_y,
47 : int avg_y_stride,
48 : const uint8_t* sig,
49 : int sig_stride,
50 : uint8_t motion_magnitude,
51 : int increase_denoising) = 0;
52 : };
53 :
54 : } // namespace webrtc
55 :
56 : #endif // WEBRTC_MODULES_VIDEO_PROCESSING_UTIL_DENOISER_FILTER_H_
|