summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_pickmode.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index 558210c60..ac9816263 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -2029,16 +2029,24 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
if (!(cpi->ref_frame_flags & flag_list[ref_frame])) continue;
- // 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 &&
- cpi->compute_source_sad_onepass && cpi->sf.use_source_sad &&
- ((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;
+ // For screen content. If zero_temp_sad source is computed: skip
+ // non-zero motion check for stationary blocks. If the superblock is
+ // non-stationary then for flat blocks skip the zero last check (keep golden
+ // as it may be inter-layer reference). Otherwise (if zero_temp_sad_source
+ // is not computed) skip non-zero motion check for flat blocks.
+ // TODO(marpan): Compute zero_temp_sad_source per coding block.
+ if (cpi->oxcf.content == VP9E_CONTENT_SCREEN) {
+ if (cpi->compute_source_sad_onepass && cpi->sf.use_source_sad) {
+ if ((frame_mv[this_mode][ref_frame].as_int != 0 &&
+ x->zero_temp_sad_source) ||
+ (frame_mv[this_mode][ref_frame].as_int == 0 &&
+ x->source_variance == 0 && ref_frame == LAST_FRAME &&
+ !x->zero_temp_sad_source))
+ continue;
+ } else if (frame_mv[this_mode][ref_frame].as_int != 0 &&
+ x->source_variance == 0) {
+ continue;
+ }
}
if (!(cpi->sf.inter_mode_mask[bsize] & (1 << this_mode))) continue;