vp9: Temporal denoising: avoid denoising for speed <= 5.
authorMarco <marpan@google.com>
Wed, 5 Apr 2017 23:38:33 +0000 (16:38 -0700)
committerMarco <marpan@google.com>
Wed, 5 Apr 2017 23:43:39 +0000 (16:43 -0700)
Temporal denoiser runs in non-rd pickmode, so it is only used
for speed >= 5. Regression exists for speed 5, due to use of
reference_partition (which use non-rd pickmode for partitioning).
Avoid denoising for now at speed 5.

Change-Id: I74a74d2e1404d7cfd33dcf4ec06dd2e503256cf0

vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_pickmode.c

index 1a4512f..d914243 100644 (file)
@@ -535,7 +535,7 @@ static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q,
         threshold_base = (7 * threshold_base) >> 3;
     }
 #if CONFIG_VP9_TEMPORAL_DENOISING
-    if (cpi->oxcf.noise_sensitivity > 0 &&
+    if (cpi->oxcf.noise_sensitivity > 0 && cpi->oxcf.speed > 5 &&
         cpi->denoiser.denoising_level >= kDenLow)
       threshold_base = vp9_scale_part_thresh(
           threshold_base, cpi->denoiser.denoising_level, content_state);
index 9361e97..e3c718d 100644 (file)
@@ -354,7 +354,7 @@ static void model_rd_for_sb_y_large(VP9_COMP *cpi, BLOCK_SIZE bsize,
   *sse_y = sse;
 
 #if CONFIG_VP9_TEMPORAL_DENOISING
-  if (cpi->oxcf.noise_sensitivity > 0)
+  if (cpi->oxcf.noise_sensitivity > 0 && cpi->oxcf.speed > 5)
     ac_thr = vp9_scale_acskip_thresh(ac_thr, cpi->denoiser.denoising_level,
                                      (abs(sum) >> (bw + bh)));
   else
@@ -1974,7 +1974,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
 
 #if CONFIG_VP9_TEMPORAL_DENOISING
     if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc_pickmode &&
-        cpi->denoiser.denoising_level > kDenLowLow) {
+        cpi->denoiser.denoising_level > kDenLowLow && cpi->oxcf.speed > 5) {
       vp9_denoiser_update_frame_stats(mi, sse_y, this_mode, ctx);
       // Keep track of zero_last cost.
       if (ref_frame == LAST_FRAME && frame_mv[this_mode][ref_frame].as_int == 0)
@@ -2178,7 +2178,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
 #if CONFIG_VP9_TEMPORAL_DENOISING
   if (cpi->oxcf.noise_sensitivity > 0 && cpi->resize_pending == 0 &&
       denoise_svc_pickmode && cpi->denoiser.denoising_level > kDenLowLow &&
-      cpi->denoiser.reset == 0) {
+      cpi->denoiser.reset == 0 && cpi->oxcf.speed > 5) {
     VP9_DENOISER_DECISION decision = COPY_BLOCK;
     vp9_pickmode_ctx_den_update(&ctx_den, zero_last_cost_orig, ref_frame_cost,
                                 frame_mv, reuse_inter_pred, best_tx_size,