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