Merge "vp9-noise estimate: Move level setting to a function."
This commit is contained in:
commit
6202ce5ada
@ -82,6 +82,21 @@ static void copy_frame(YV12_BUFFER_CONFIG * const dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NOISE_LEVEL vp9_noise_estimate_extract_level(NOISE_ESTIMATE *const ne) {
|
||||||
|
int noise_level = kLowLow;
|
||||||
|
if (ne->value > (ne->thresh << 1)) {
|
||||||
|
noise_level = kHigh;
|
||||||
|
} else {
|
||||||
|
if (ne->value > ne->thresh)
|
||||||
|
noise_level = kMedium;
|
||||||
|
else if (ne->value > (ne->thresh >> 1))
|
||||||
|
noise_level = kLow;
|
||||||
|
else
|
||||||
|
noise_level = kLowLow;
|
||||||
|
}
|
||||||
|
return noise_level;
|
||||||
|
}
|
||||||
|
|
||||||
void vp9_update_noise_estimate(VP9_COMP *const cpi) {
|
void vp9_update_noise_estimate(VP9_COMP *const cpi) {
|
||||||
const VP9_COMMON *const cm = &cpi->common;
|
const VP9_COMMON *const cm = &cpi->common;
|
||||||
CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
|
CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
|
||||||
@ -220,16 +235,7 @@ void vp9_update_noise_estimate(VP9_COMP *const cpi) {
|
|||||||
// Reset counter and check noise level condition.
|
// Reset counter and check noise level condition.
|
||||||
ne->num_frames_estimate = 30;
|
ne->num_frames_estimate = 30;
|
||||||
ne->count = 0;
|
ne->count = 0;
|
||||||
if (ne->value > (ne->thresh << 1)) {
|
ne->level = vp9_noise_estimate_extract_level(ne);
|
||||||
ne->level = kHigh;
|
|
||||||
} else {
|
|
||||||
if (ne->value > ne->thresh)
|
|
||||||
ne->level = kMedium;
|
|
||||||
else if (ne->value > (ne->thresh >> 1))
|
|
||||||
ne->level = kLow;
|
|
||||||
else
|
|
||||||
ne->level = kLowLow;
|
|
||||||
}
|
|
||||||
#if CONFIG_VP9_TEMPORAL_DENOISING
|
#if CONFIG_VP9_TEMPORAL_DENOISING
|
||||||
if (cpi->oxcf.noise_sensitivity > 0)
|
if (cpi->oxcf.noise_sensitivity > 0)
|
||||||
vp9_denoiser_set_noise_level(&cpi->denoiser, ne->level);
|
vp9_denoiser_set_noise_level(&cpi->denoiser, ne->level);
|
||||||
|
@ -47,6 +47,8 @@ void vp9_noise_estimate_init(NOISE_ESTIMATE *const ne,
|
|||||||
int width,
|
int width,
|
||||||
int height);
|
int height);
|
||||||
|
|
||||||
|
NOISE_LEVEL vp9_noise_estimate_extract_level(NOISE_ESTIMATE *const ne);
|
||||||
|
|
||||||
void vp9_update_noise_estimate(struct VP9_COMP *const cpi);
|
void vp9_update_noise_estimate(struct VP9_COMP *const cpi);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user