Merge "vp9 denoiser: Add another noise level to denoising."
This commit is contained in:
@@ -323,7 +323,7 @@ void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
|
|||||||
struct buf_2d src = mb->plane[0].src;
|
struct buf_2d src = mb->plane[0].src;
|
||||||
int is_skin = 0;
|
int is_skin = 0;
|
||||||
|
|
||||||
if (bs <= BLOCK_16X16 && denoiser->denoising_level >= kDenMedium) {
|
if (bs <= BLOCK_16X16 && denoiser->denoising_level >= kDenLow) {
|
||||||
// Take center pixel in block to determine is_skin.
|
// Take center pixel in block to determine is_skin.
|
||||||
const int y_width_shift = (4 << b_width_log2_lookup[bs]) >> 1;
|
const int y_width_shift = (4 << b_width_log2_lookup[bs]) >> 1;
|
||||||
const int y_height_shift = (4 << b_height_log2_lookup[bs]) >> 1;
|
const int y_height_shift = (4 << b_height_log2_lookup[bs]) >> 1;
|
||||||
@@ -349,7 +349,7 @@ void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
|
|||||||
denoiser->increase_denoising = 0;
|
denoiser->increase_denoising = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (denoiser->denoising_level >= kDenMedium)
|
if (denoiser->denoising_level >= kDenLow)
|
||||||
decision = perform_motion_compensation(denoiser, mb, bs,
|
decision = perform_motion_compensation(denoiser, mb, bs,
|
||||||
denoiser->increase_denoising,
|
denoiser->increase_denoising,
|
||||||
mi_row, mi_col, ctx,
|
mi_row, mi_col, ctx,
|
||||||
@@ -524,6 +524,7 @@ int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
|
|||||||
#endif
|
#endif
|
||||||
denoiser->increase_denoising = 0;
|
denoiser->increase_denoising = 0;
|
||||||
denoiser->frame_buffer_initialized = 1;
|
denoiser->frame_buffer_initialized = 1;
|
||||||
|
denoiser->denoising_level = kDenLow;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,6 +27,7 @@ typedef enum vp9_denoiser_decision {
|
|||||||
} VP9_DENOISER_DECISION;
|
} VP9_DENOISER_DECISION;
|
||||||
|
|
||||||
typedef enum vp9_denoiser_level {
|
typedef enum vp9_denoiser_level {
|
||||||
|
kDenLowLow,
|
||||||
kDenLow,
|
kDenLow,
|
||||||
kDenMedium,
|
kDenMedium,
|
||||||
kDenHigh
|
kDenHigh
|
||||||
|
@@ -212,8 +212,10 @@ void vp9_update_noise_estimate(VP9_COMP *const cpi) {
|
|||||||
else
|
else
|
||||||
if (ne->value > ne->thresh)
|
if (ne->value > ne->thresh)
|
||||||
ne->level = kMedium;
|
ne->level = kMedium;
|
||||||
else
|
else if (ne->value > (ne->thresh >> 1))
|
||||||
ne->level = kLow;
|
ne->level = kLow;
|
||||||
|
else
|
||||||
|
ne->level = kLowLow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum noise_level {
|
typedef enum noise_level {
|
||||||
|
kLowLow,
|
||||||
kLow,
|
kLow,
|
||||||
kMedium,
|
kMedium,
|
||||||
kHigh
|
kHigh
|
||||||
|
Reference in New Issue
Block a user