ref: 8256c8b297c8b7c7ee4de24edff82ed67d6ef207
parent: 71032fde7932852e2ed9e42c3bfb3f403e94ae68
author: Marco Paniconi <marpan@google.com>
date: Wed Mar 6 15:28:26 EST 2019
vp9-rtc: Improve mode check on flat blocks in screen mode For nonrd-pickmode in screen content mode: modify logic for inter and intra mode check for spatially flat blocks. Condition skip of non-zero/zero inter mode based on zero_temp_sad_source, and force intra/DC check regardless. Reduces artifacts in scrolling motion. Change-Id: Iee75cd19d03296afeb649c5bce628806103769ae
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -2029,9 +2029,13 @@
if (!(cpi->ref_frame_flags & flag_list[ref_frame])) continue;
- if (sf->short_circuit_flat_blocks && x->source_variance == 0 &&
- (frame_mv[this_mode][ref_frame].as_int != 0 ||
- (cpi->oxcf.content == VP9E_CONTENT_SCREEN && !svc->spatial_layer_id &&
+ // For screen content on flat blocks: skip non-zero motion check for
+ // stationary blocks, only skip zero motion check for non-stationary blocks.
+ if (cpi->oxcf.content == VP9E_CONTENT_SCREEN &&
+ sf->short_circuit_flat_blocks && x->source_variance == 0 &&
+ ((frame_mv[this_mode][ref_frame].as_int != 0 &&
+ x->zero_temp_sad_source) ||
+ (frame_mv[this_mode][ref_frame].as_int == 0 &&
!x->zero_temp_sad_source))) {
continue;
}
@@ -2411,8 +2415,7 @@
// Perform intra prediction search, if the best SAD is above a certain
// threshold.
if (best_rdc.rdcost == INT64_MAX ||
- (cpi->oxcf.content == VP9E_CONTENT_SCREEN && x->source_variance == 0 &&
- !x->zero_temp_sad_source) ||
+ (cpi->oxcf.content == VP9E_CONTENT_SCREEN && x->source_variance == 0) ||
(scene_change_detected && perform_intra_pred) ||
((!force_skip_low_temp_var || bsize < BLOCK_32X32 ||
x->content_state_sb == kVeryHighSad) &&