Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: webrtc/modules/video_processing/noise_estimation.h

Issue 1822333003: External denoiser based on noise estimation and moving object detection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_processing/noise_estimation.h
diff --git a/webrtc/modules/video_processing/noise_estimation.h b/webrtc/modules/video_processing/noise_estimation.h
new file mode 100644
index 0000000000000000000000000000000000000000..435373c0af03128ac5465fa4dfc145289444bbce
--- /dev/null
+++ b/webrtc/modules/video_processing/noise_estimation.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_MODULES_VIDEO_PROCESSING_NOISE_ESTIMATION_H_
+#define WEBRTC_MODULES_VIDEO_PROCESSING_NOISE_ESTIMATION_H_
+
+#include <climits>
+
+#include "webrtc/base/scoped_ptr.h"
+#include "webrtc/modules/include/module_common_types.h"
+#include "webrtc/modules/video_processing/include/video_processing_defines.h"
+
+namespace webrtc {
+
+#define DISPLAY 0
+
+const int kNoiseThreshold = 120;
+// Disable the threshold for now.
+const int kNoiseThresholdHigh = INT_MAX;
+
+class NoiseEstimation {
+ public:
+ void SetResolution(int width, int height);
+ void GetNoise(int mb_index, uint32_t var, uint32_t luma);
+ void ResetConsecLowVar(int mb_index);
+ // 0: low, 1: medium, 2: high
+ // However, since kNoiseThresholdHigh is disabled for now,
+ // there are only 2 levels: low and high.
+ uint8_t GetNoiseLevel();
+
+ private:
+ int width_;
+ int height_;
+ uint32_t noise_var_;
+ double noise_var_accum_;
+ int num_noisy_block_;
+ int num_stationary_block_;
+ double percent_non_montion_block_;
+ rtc::scoped_ptr<uint32_t[]> consec_low_var_;
+};
+
+} // namespace webrtc
+
+#endif // WEBRTC_MODULES_VIDEO_PROCESSING_NOISE_ESTIMATION_H_

Powered by Google App Engine
This is Rietveld 408576698