]> granicus.if.org Git - libvpx/commitdiff
vp9-rtc: Modify skip golden mode check for 1 layer
authorMarco Paniconi <marpan@google.com>
Wed, 27 Feb 2019 17:28:43 +0000 (09:28 -0800)
committerMarco Paniconi <marpan@google.com>
Wed, 27 Feb 2019 19:49:46 +0000 (11:49 -0800)
For real-time CBR mode: golden reference mode testing is
skipped under certain conditons based on sse of zero-last mode.
This was done for svc mode. Here we add similar condition
for non-svc/1 layer encoding.

Reduces flashing block artifacts that can occur in background
areas with noise.

Change-Id: I93f71ea9507af8c9153fc6c0ba7dcc7a0fa8810d

vp9/encoder/vp9_pickmode.c

index 8cd1e6e31c67c98456eb0dbcc5dc1a1d10c78b91..554f605b483006d73cb0decb4562c0f3493338a6 100644 (file)
@@ -1699,6 +1699,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
   int svc_mv_row = 0;
   int no_scaling = 0;
   unsigned int thresh_svc_skip_golden = 500;
+  unsigned int thresh_skip_golden = (bsize >= BLOCK_32X32) ? 5000 : 1000;
   int scene_change_detected =
       cpi->rc.high_source_sad ||
       (cpi->use_svc && cpi->svc.high_source_sad_superframe);
@@ -2018,10 +2019,11 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
       if (segfeature_active(seg, mi->segment_id, SEG_LVL_REF_FRAME)) continue;
     }
 
-    // For SVC, skip the golden (spatial) reference search if sse of zeromv_last
-    // is below threshold.
-    if (cpi->use_svc && ref_frame == GOLDEN_FRAME &&
-        sse_zeromv_normalized < thresh_svc_skip_golden)
+    // For CBR mode: skip the golden reference search if sse of zeromv_last is
+    // below threshold.
+    if (ref_frame == GOLDEN_FRAME && cpi->oxcf.rc_mode == VPX_CBR &&
+        ((cpi->use_svc && sse_zeromv_normalized < thresh_svc_skip_golden) ||
+         (!cpi->use_svc && sse_zeromv_normalized < thresh_skip_golden)))
       continue;
 
     if (!(cpi->ref_frame_flags & flag_list[ref_frame])) continue;
@@ -2240,7 +2242,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
                           &var_y, &sse_y);
       }
       // Save normalized sse (between current and last frame) for (0, 0) motion.
-      if (cpi->use_svc && ref_frame == LAST_FRAME &&
+      if (ref_frame == LAST_FRAME &&
           frame_mv[this_mode][ref_frame].as_int == 0) {
         sse_zeromv_normalized =
             sse_y >> (b_width_log2_lookup[bsize] + b_height_log2_lookup[bsize]);