ref: 1e12d19bbfbf4cc5a7ddce394b40f3ba00a4ec15
parent: e3fae047856e622ffd04330f935cbdebdd625aa5
author: Angie Chiang <[email protected]>
date: Wed Feb 6 13:21:07 EST 2019
Check the new mv diff in discount_newmv_test() Change-Id: I38c5d4de93bebfd3f46bcc01716a0cc4a76af950
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2555,8 +2555,15 @@
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;
}