VP9 noise estimate: no noise estimate if frame size change.
Change-Id: I521f7b53c143d562a88fe7de330aa3f0ef09f414
This commit is contained in:
@@ -29,6 +29,8 @@ void vp9_noise_estimate_init(NOISE_ESTIMATE *const ne,
|
|||||||
ne->value = 0;
|
ne->value = 0;
|
||||||
ne->count = 0;
|
ne->count = 0;
|
||||||
ne->thresh = 90;
|
ne->thresh = 90;
|
||||||
|
ne->last_w = 0;
|
||||||
|
ne->last_h = 0;
|
||||||
if (width * height >= 1920 * 1080) {
|
if (width * height >= 1920 * 1080) {
|
||||||
ne->thresh = 200;
|
ne->thresh = 200;
|
||||||
} else if (width * height >= 1280 * 720) {
|
} else if (width * height >= 1280 * 720) {
|
||||||
@@ -100,11 +102,17 @@ void vp9_update_noise_estimate(VP9_COMP *const cpi) {
|
|||||||
ne->enabled = enable_noise_estimation(cpi);
|
ne->enabled = enable_noise_estimation(cpi);
|
||||||
if (!ne->enabled ||
|
if (!ne->enabled ||
|
||||||
cm->current_video_frame % frame_period != 0 ||
|
cm->current_video_frame % frame_period != 0 ||
|
||||||
last_source == NULL) {
|
last_source == NULL ||
|
||||||
|
ne->last_w != cm->width ||
|
||||||
|
ne->last_h != cm->height) {
|
||||||
#if CONFIG_VP9_TEMPORAL_DENOISING
|
#if CONFIG_VP9_TEMPORAL_DENOISING
|
||||||
if (cpi->oxcf.noise_sensitivity > 0)
|
if (cpi->oxcf.noise_sensitivity > 0)
|
||||||
copy_frame(&cpi->denoiser.last_source, cpi->Source);
|
copy_frame(&cpi->denoiser.last_source, cpi->Source);
|
||||||
#endif
|
#endif
|
||||||
|
if (last_source != NULL) {
|
||||||
|
ne->last_w = cm->width;
|
||||||
|
ne->last_h = cm->height;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
int num_samples = 0;
|
int num_samples = 0;
|
||||||
@@ -185,6 +193,8 @@ void vp9_update_noise_estimate(VP9_COMP *const cpi) {
|
|||||||
src_u += (src_uvstride << 2) - (cm->mi_cols << 2);
|
src_u += (src_uvstride << 2) - (cm->mi_cols << 2);
|
||||||
src_v += (src_uvstride << 2) - (cm->mi_cols << 2);
|
src_v += (src_uvstride << 2) - (cm->mi_cols << 2);
|
||||||
}
|
}
|
||||||
|
ne->last_w = cm->width;
|
||||||
|
ne->last_h = cm->height;
|
||||||
// Update noise estimate if we have at a minimum number of block samples,
|
// Update noise estimate if we have at a minimum number of block samples,
|
||||||
// and avg_est > 0 (avg_est == 0 can happen if the application inputs
|
// and avg_est > 0 (avg_est == 0 can happen if the application inputs
|
||||||
// duplicate frames).
|
// duplicate frames).
|
||||||
|
@@ -35,6 +35,8 @@ typedef struct noise_estimate {
|
|||||||
int value;
|
int value;
|
||||||
int thresh;
|
int thresh;
|
||||||
int count;
|
int count;
|
||||||
|
int last_w;
|
||||||
|
int last_h;
|
||||||
} NOISE_ESTIMATE;
|
} NOISE_ESTIMATE;
|
||||||
|
|
||||||
struct VP9_COMP;
|
struct VP9_COMP;
|
||||||
|
Reference in New Issue
Block a user