]> granicus.if.org Git - libvpx/commitdiff
vp9-rtc: Fix for scroll motion for rtc
authorMarco Paniconi <marpan@google.com>
Fri, 1 Mar 2019 19:18:36 +0000 (11:18 -0800)
committerMarco Paniconi <marpan@google.com>
Fri, 1 Mar 2019 19:20:38 +0000 (11:20 -0800)
Increase threshold to detect frames with high
num of motion blocks, and fix conditions to detect
horiz & vert scroll and avoid split below 16x16 blocks
in variance partition.

Reduces artifacts in horizonal scroll screenshare testing.

Change-Id: Icf5b87f69971d7331c660fc2727c9246c6cbf8b5

vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_ratectrl.c

index 9e71e7a1b07697c417373430b74074583feead91..72dbbff42b722b00d40f10c63e93d68a8915fa29 100644 (file)
@@ -1424,14 +1424,16 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
       x->sb_mvcol_part = mi->mv[0].as_mv.col;
       x->sb_mvrow_part = mi->mv[0].as_mv.row;
       if (cpi->oxcf.content == VP9E_CONTENT_SCREEN &&
-          cpi->svc.spatial_layer_id == 0 &&
+          cpi->svc.spatial_layer_id == cpi->svc.first_spatial_layer_to_encode &&
           cpi->svc.high_num_blocks_with_motion && !x->zero_temp_sad_source &&
           cm->width > 640 && cm->height > 480) {
-        // Disable split below 16x16 block size when scroll motion is detected.
+        // Disable split below 16x16 block size when scroll motion (horz or
+        // vert) is detected.
         // TODO(marpan/jianj): Improve this condition: issue is that search
         // range is hard-coded/limited in vp9_int_pro_motion_estimation() so
         // scroll motion may not be detected here.
-        if ((abs(x->sb_mvrow_part) >= 48 && abs(x->sb_mvcol_part) <= 8) ||
+        if (((abs(x->sb_mvrow_part) >= 48 && abs(x->sb_mvcol_part) <= 8) ||
+             (abs(x->sb_mvcol_part) >= 48 && abs(x->sb_mvrow_part) <= 8)) &&
             y_sad < 100000) {
           compute_minmax_variance = 0;
           thresholds[2] = INT64_MAX;
index 9540e218be933b33a8bc15e3cef0b3527ff8b222..152efa7e072aa206b597ce1de579eb341de2b0a0 100644 (file)
@@ -2932,7 +2932,7 @@ void vp9_scene_detection_onepass(VP9_COMP *cpi) {
         } else {
           rc->avg_source_sad[lagframe_idx] = avg_sad;
         }
-        if (num_zero_temp_sad < (num_samples >> 1))
+        if (num_zero_temp_sad < (3 * num_samples >> 2))
           rc->high_num_blocks_with_motion = 1;
       }
     }