Index: webrtc/modules/video_processing/util/noise_estimation.h |
diff --git a/webrtc/modules/video_processing/util/noise_estimation.h b/webrtc/modules/video_processing/util/noise_estimation.h |
index ca5cc2324fbf4b17294f2b53fb6381256aca80b4..24d44ca4ad15902660c769da54ed3df30468520b 100644 |
--- a/webrtc/modules/video_processing/util/noise_estimation.h |
+++ b/webrtc/modules/video_processing/util/noise_estimation.h |
@@ -18,7 +18,6 @@ |
namespace webrtc { |
-#define EXPERIMENTAL 0 |
#define DISPLAY 0 |
const int kNoiseThreshold = 200; |
@@ -28,11 +27,18 @@ const int kAverageLumaMin = 20; |
const int kAverageLumaMax = 220; |
const int kBlockSelectionVarMax = kNoiseThreshold << 1; |
+// TODO(jackychen): To test different sampling strategy. |
+// Collect noise data every NOISE_SUBSAMPLE_INTERVAL blocks. |
+#define NOISE_SUBSAMPLE_INTERVAL 41 |
+ |
class NoiseEstimation { |
public: |
void Init(int width, int height, CpuType cpu_type); |
+ // Collect noise data from one qualified block. |
void GetNoise(int mb_index, uint32_t var, uint32_t luma); |
+ // Reset the counter for consecutive low-var blocks. |
void ResetConsecLowVar(int mb_index); |
+ // Update noise level for current frame. |
void UpdateNoiseLevel(); |
// 0: low noise, 1: high noise |
uint8_t GetNoiseLevel(); |
@@ -42,13 +48,13 @@ class NoiseEstimation { |
int height_; |
int mb_rows_; |
int mb_cols_; |
+ int num_noisy_block_; |
+ int num_static_block_; |
CpuType cpu_type_; |
uint32_t noise_var_; |
double noise_var_accum_; |
- int num_noisy_block_; |
- int num_static_block_; |
double percent_static_block_; |
- rtc::scoped_ptr<uint32_t[]> consec_low_var_; |
+ std::unique_ptr<uint32_t[]> consec_low_var_; |
}; |
} // namespace webrtc |