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_ |