1 /* 2 * Copyright (c) 2012 The WebM 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 VPX_VP9_ENCODER_VP9_NOISE_ESTIMATE_H_ 12 #define VPX_VP9_ENCODER_VP9_NOISE_ESTIMATE_H_ 13 14 #include "vp9/encoder/vp9_block.h" 15 #include "vp9/encoder/vp9_skin_detection.h" 16 #include "vpx_scale/yv12config.h" 17 18 #if CONFIG_VP9_TEMPORAL_DENOISING 19 #include "vp9/encoder/vp9_denoiser.h" 20 #endif 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 typedef enum noise_level { kLowLow, kLow, kMedium, kHigh } NOISE_LEVEL; 27 28 typedef struct noise_estimate { 29 int enabled; 30 NOISE_LEVEL level; 31 int value; 32 int thresh; 33 int count; 34 int last_w; 35 int last_h; 36 int num_frames_estimate; 37 } NOISE_ESTIMATE; 38 39 struct VP9_COMP; 40 41 void vp9_noise_estimate_init(NOISE_ESTIMATE *const ne, int width, int height); 42 43 NOISE_LEVEL vp9_noise_estimate_extract_level(NOISE_ESTIMATE *const ne); 44 45 void vp9_update_noise_estimate(struct VP9_COMP *const cpi); 46 47 #ifdef __cplusplus 48 } // extern "C" 49 #endif 50 51 #endif // VPX_VP9_ENCODER_VP9_NOISE_ESTIMATE_H_ 52