shithub: libvpx

Download patch

ref: ff32369804d6a29c6ede4300eacc62e63b691db2
parent: 79a194692fd449b4fd10a6235aa59f285b6656c3
author: Marco <[email protected]>
date: Wed Nov 11 05:09:40 EST 2015

vp9 denoiser: Add another noise level to denoising.

Change-Id: Idc755ab54e4f78bb7d75bc97634c451804edad99

--- a/vp9/encoder/vp9_denoiser.c
+++ b/vp9/encoder/vp9_denoiser.c
@@ -323,7 +323,7 @@
   struct buf_2d src = mb->plane[0].src;
   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.
     const int y_width_shift = (4 << b_width_log2_lookup[bs]) >> 1;
     const int y_height_shift = (4 << b_height_log2_lookup[bs]) >> 1;
@@ -349,7 +349,7 @@
     denoiser->increase_denoising = 0;
   }
 
-  if (denoiser->denoising_level >= kDenMedium)
+  if (denoiser->denoising_level >= kDenLow)
     decision = perform_motion_compensation(denoiser, mb, bs,
                                            denoiser->increase_denoising,
                                            mi_row, mi_col, ctx,
@@ -524,6 +524,7 @@
 #endif
   denoiser->increase_denoising = 0;
   denoiser->frame_buffer_initialized = 1;
+  denoiser->denoising_level = kDenLow;
   return 0;
 }
 
--- a/vp9/encoder/vp9_denoiser.h
+++ b/vp9/encoder/vp9_denoiser.h
@@ -27,6 +27,7 @@
 } VP9_DENOISER_DECISION;
 
 typedef enum vp9_denoiser_level {
+  kDenLowLow,
   kDenLow,
   kDenMedium,
   kDenHigh
--- a/vp9/encoder/vp9_noise_estimate.c
+++ b/vp9/encoder/vp9_noise_estimate.c
@@ -212,8 +212,10 @@
         else
           if (ne->value > ne->thresh)
             ne->level = kMedium;
-          else
+          else if (ne->value > (ne->thresh >> 1))
             ne->level = kLow;
+          else
+            ne->level = kLowLow;
       }
     }
   }
--- a/vp9/encoder/vp9_noise_estimate.h
+++ b/vp9/encoder/vp9_noise_estimate.h
@@ -24,6 +24,7 @@
 #endif
 
 typedef enum noise_level {
+  kLowLow,
   kLow,
   kMedium,
   kHigh