]> granicus.if.org Git - libvpx/commitdiff
vp8: Add check on noise_sensitivity/denoiser on.
authorMarco <marpan@google.com>
Sat, 16 Aug 2014 13:08:31 +0000 (06:08 -0700)
committerMarco <marpan@google.com>
Sat, 16 Aug 2014 13:14:21 +0000 (06:14 -0700)
Change-Id: Ic53b2fb69e6eee600ea222e4d06424a1bbca496c

vp8/encoder/onyx_if.c

index 93f88250768bcfcc36f541b4b68deba22349b626..d29dd39971cea3cb391ee644c978829582d97e2b 100644 (file)
@@ -615,19 +615,21 @@ static void cyclic_background_refresh(VP8_COMP *cpi, int Q, int lf_adjustment)
         cpi->cyclic_refresh_mode_index = i;
 
 #if CONFIG_TEMPORAL_DENOISING
-        if (cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive &&
-            Q < (int)cpi->denoiser.denoise_pars.qp_thresh) {
-          // Under aggressive denoising mode, use segmentation to turn off loop
-          // filter below some qp thresh. The loop filter is turned off for all
-          // blocks that have been encoded as ZEROMV LAST x frames in a row,
-          // where x is set by cpi->denoiser.denoise_pars.consec_zerolast.
-          // This is to avoid "dot" artifacts that can occur from repeated
-          // loop filtering on noisy input source.
-          cpi->cyclic_refresh_q = Q;
-          lf_adjustment = -MAX_LOOP_FILTER;
-          for (i = 0; i < mbs_in_frame; ++i) {
-            seg_map[i] = (cpi->consec_zero_last[i] >
-                          cpi->denoiser.denoise_pars.consec_zerolast) ? 1 : 0;
+        if (cpi->oxcf.noise_sensitivity > 0) {
+          if (cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive &&
+              Q < (int)cpi->denoiser.denoise_pars.qp_thresh) {
+            // Under aggressive denoising, use segmentation to turn off loop
+            // filter below some qp thresh. The filter is turned off for all
+            // blocks that have been encoded as ZEROMV LAST x frames in a row,
+            // where x is set by cpi->denoiser.denoise_pars.consec_zerolast.
+            // This is to avoid "dot" artifacts that can occur from repeated
+            // loop filtering on noisy input source.
+            cpi->cyclic_refresh_q = Q;
+            lf_adjustment = -MAX_LOOP_FILTER;
+            for (i = 0; i < mbs_in_frame; ++i) {
+              seg_map[i] = (cpi->consec_zero_last[i] >
+                            cpi->denoiser.denoise_pars.consec_zerolast) ? 1 : 0;
+            }
           }
         }
 #endif