From: Angie Chiang Date: Thu, 7 Feb 2019 02:21:07 +0000 (-0800) Subject: Check the new mv diff in discount_newmv_test() X-Git-Tag: v1.8.1~241 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e12d19bbfbf4cc5a7ddce394b40f3ba00a4ec15;p=libvpx Check the new mv diff in discount_newmv_test() Change-Id: I38c5d4de93bebfd3f46bcc01716a0cc4a76af950 --- diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 87b7f1a7d..a9c2c32d0 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -2555,8 +2555,15 @@ static int discount_newmv_test(const VP9_COMP *cpi, int this_mode, tpl_frame .mv_mode_arr[gf_rf_idx][tpl_mi_row * tpl_frame.stride + tpl_mi_col]; if (mv_mode == NEW_MV_MODE) { - // TODO(angiebird): Compare this_mv with the motion field. - return 1; + int_mv tpl_new_mv = *get_pyramid_mv(&tpl_frame, gf_rf_idx, cpi->tpl_bsize, + tpl_mi_row, tpl_mi_col); + int row_diff = abs(tpl_new_mv.as_mv.row - this_mv.as_mv.row); + int col_diff = abs(tpl_new_mv.as_mv.col - this_mv.as_mv.col); + if (VPXMAX(row_diff, col_diff) <= 8) { + return 1; + } else { + return 0; + } } else { return 0; }