rtc: Fix to block artifacts in screen scrolling

For nonrd_pickmode: add condition to disallow
blk_skip for intra modes. This removes the artifact
in issue below.

Stats changed for screen
For speed 10: mostly small/neutral but positive gain:
avg/ovr/ssim, IC% speedup
-0.152/-0.412/-0.230, 0.219

Bug: aomedia:3435

Change-Id: I0957c2b2906e57b1da7c73174acd48d6fc59c180
diff --git a/av1/encoder/nonrd_opt.c b/av1/encoder/nonrd_opt.c
index eae8b4d..5783ee6 100644
--- a/av1/encoder/nonrd_opt.c
+++ b/av1/encoder/nonrd_opt.c
@@ -732,6 +732,7 @@
       RDCOST(x->rdmult, ref_cost_intra + intra_cost_penalty, 0);
   int perform_intra_pred = rt_sf->check_intra_pred_nonrd;
   int force_intra_check = 0;
+  int allow_blk_skip = 1;
   // For spatial enhancement layer: turn off intra prediction if the
   // previous spatial layer as golden ref is not chosen as best reference.
   // only do this for temporal enhancement layer and on non-key frames.
@@ -828,6 +829,14 @@
   }
   pd->dst = *orig_dst;
 
+  // TODO(marpan): This is to remove bad artifact observed under screen.
+  // For now avoid use of the blk_skip feature (set in block_yrd),
+  // unless it's spatially flat or stationary block.
+  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
+      x->source_variance > 0 &&
+      x->content_state_sb.source_sad_nonrd != kZeroSad)
+    allow_blk_skip = 0;
+
   for (int midx = 0; midx < RTC_INTRA_MODES; ++midx) {
     const PREDICTION_MODE this_mode = intra_mode_list[midx];
     const THR_MODES mode_index = mode_idx[INTRA_FRAME][mode_offset(this_mode)];
@@ -918,7 +927,7 @@
       best_pickmode->best_ref_frame = INTRA_FRAME;
       best_pickmode->best_second_ref_frame = NONE;
       best_pickmode->best_mode_skip_txfm = this_rdc.skip_txfm;
-      if (!this_rdc.skip_txfm) {
+      if (allow_blk_skip && !this_rdc.skip_txfm) {
         memcpy(ctx->blk_skip, x->txfm_search_info.blk_skip,
                sizeof(x->txfm_search_info.blk_skip[0]) * ctx->num_4x4_blk);
       }