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

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

Issue 1871853003: External VNR speed improvement and more. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: More clean-up. Created 4 years, 8 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/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
« no previous file with comments | « webrtc/modules/video_processing/util/denoiser_filter_sse2.cc ('k') | webrtc/modules/video_processing/util/noise_estimation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698