Lines Matching full:mv
39 const MV *mv) { in get_buf_from_mv() argument
40 return &buf->buf[mv->row * buf->stride + mv->col]; in get_buf_from_mv()
43 void av1_set_mv_search_range(MvLimits *mv_limits, const MV *mv) { in av1_set_mv_search_range() argument
44 int col_min = (mv->col >> 3) - MAX_FULL_PEL_VAL + (mv->col & 7 ? 1 : 0); in av1_set_mv_search_range()
45 int row_min = (mv->row >> 3) - MAX_FULL_PEL_VAL + (mv->row & 7 ? 1 : 0); in av1_set_mv_search_range()
46 int col_max = (mv->col >> 3) + MAX_FULL_PEL_VAL; in av1_set_mv_search_range()
47 int row_max = (mv->row >> 3) + MAX_FULL_PEL_VAL; in av1_set_mv_search_range()
54 // Get intersection of UMV window and valid MV window to reduce # of checks in av1_set_mv_search_range()
64 const MV *ref_mv) { in set_subpel_mv_search_range()
88 static INLINE int mv_cost(const MV *mv, const int *joint_cost, in mv_cost() argument
90 return joint_cost[av1_get_mv_joint(mv)] + comp_cost[0][mv->row] + in mv_cost()
91 comp_cost[1][mv->col]; in mv_cost()
94 int av1_mv_bit_cost(const MV *mv, const MV *ref, const int *mvjcost, in av1_mv_bit_cost() argument
96 const MV diff = { mv->row - ref->row, mv->col - ref->col }; in av1_mv_bit_cost()
101 static int mv_err_cost(const MV *mv, const MV *ref, const int *mvjcost, in mv_err_cost() argument
104 const MV diff = { mv->row - ref->row, mv->col - ref->col }; in mv_err_cost()
113 static int mvsad_err_cost(const MACROBLOCK *x, const MV *mv, const MV *ref, in mvsad_err_cost() argument
115 const MV diff = { (mv->row - ref->row) * 8, (mv->col - ref->col) * 8 }; in mvsad_err_cost()
124 cfg->ss[0].mv.col = cfg->ss[0].mv.row = 0; in av1_init_dsmotion_compensation()
129 const MV ss_mvs[] = { { -len, 0 }, { len, 0 }, { 0, -len }, { 0, len } }; in av1_init_dsmotion_compensation()
133 ss->mv = ss_mvs[i]; in av1_init_dsmotion_compensation()
134 ss->offset = ss->mv.row * stride + ss->mv.col; in av1_init_dsmotion_compensation()
145 cfg->ss[0].mv.col = cfg->ss[0].mv.row = 0; in av1_init3smotion_compensation()
150 const MV ss_mvs[8] = { { -len, 0 }, { len, 0 }, { 0, -len }, in av1_init3smotion_compensation()
156 ss->mv = ss_mvs[i]; in av1_init3smotion_compensation()
157 ss->offset = ss->mv.row * stride + ss->mv.col; in av1_init3smotion_compensation()
186 MV this_mv = { r, c }; \
216 MV this_mv = { r, c }; \
311 MV *bestmv = &x->best_mv.as_mv; \
333 const MACROBLOCKD *xd, const MV *bestmv, const MV *ref_mv, in setup_center_error()
396 const MV *ref_mv, int allow_hp, int error_per_bit, in av1_find_best_sub_pixel_tree_pruned_evenmore()
469 const MV *ref_mv, int allow_hp, int error_per_bit, in av1_find_best_sub_pixel_tree_pruned_more()
538 const MV *ref_mv, int allow_hp, int error_per_bit, in av1_find_best_sub_pixel_tree_pruned()
628 static const MV search_step_table[12] = {
637 int mi_row, int mi_col, const MV *const mv, in upsampled_pref_error() argument
652 xd, cm, mi_row, mi_col, mv, pred8, second_pred, w, h, subpel_x_q3, in upsampled_pref_error()
657 xd, cm, mi_row, mi_col, mv, pred8, second_pred, w, h, subpel_x_q3, in upsampled_pref_error()
661 aom_highbd_upsampled_pred(xd, cm, mi_row, mi_col, mv, pred8, w, h, in upsampled_pref_error()
670 aom_comp_mask_upsampled_pred(xd, cm, mi_row, mi_col, mv, pred, in upsampled_pref_error()
675 aom_comp_avg_upsampled_pred(xd, cm, mi_row, mi_col, mv, pred, in upsampled_pref_error()
680 aom_upsampled_pred(xd, cm, mi_row, mi_col, mv, pred, w, h, subpel_x_q3, in upsampled_pref_error()
691 const MV *bestmv, const MV *ref_mv, int error_per_bit, in upsampled_setup_center_error()
726 const MV *ref_mv, int allow_hp, int error_per_bit, in av1_find_best_sub_pixel_tree()
739 MV *bestmv = &x->best_mv.as_mv; in av1_find_best_sub_pixel_tree()
749 const MV *search_step = search_step_table; in av1_find_best_sub_pixel_tree()
792 MV this_mv = { tr, tc }; in av1_find_best_sub_pixel_tree()
828 MV this_mv = { tr, tc }; in av1_find_best_sub_pixel_tree()
892 const MV *this_mv) { in av1_compute_motion_cost()
912 // Refine MV in a small range
920 const MV neighbors[8] = { { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 }, in av1_refine_warped_mv()
923 int16_t br = mbmi->mv[0].as_mv.row; in av1_refine_warped_mv()
924 int16_t bc = mbmi->mv[0].as_mv.col; in av1_refine_warped_mv()
925 int16_t *tr = &mbmi->mv[0].as_mv.row; in av1_refine_warped_mv()
926 int16_t *tc = &mbmi->mv[0].as_mv.col; in av1_refine_warped_mv()
940 &mbmi->mv[0].as_mv); in av1_refine_warped_mv()
942 // MV search in av1_refine_warped_mv()
954 MV this_mv = { *tr, *tc }; in av1_refine_warped_mv()
1001 static INLINE int is_mv_in(const MvLimits *mv_limits, const MV *mv) { in is_mv_in() argument
1002 return (mv->col >= mv_limits->col_min) && (mv->col <= mv_limits->col_max) && in is_mv_in()
1003 (mv->row >= mv_limits->row_min) && (mv->row <= mv_limits->row_max); in is_mv_in()
1024 const MV *const ref_mv, int sadpb, in calc_int_cost_list()
1026 const MV *best_mv, int *cost_list) { in calc_int_cost_list()
1027 static const MV neighbors[4] = { { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 } }; in calc_int_cost_list()
1030 const MV fcenter_mv = { ref_mv->row >> 3, ref_mv->col >> 3 }; in calc_int_cost_list()
1035 const MV this_mv = { br, bc }; in calc_int_cost_list()
1043 const MV neighbor_mv = { br + neighbors[i].row, bc + neighbors[i].col }; in calc_int_cost_list()
1052 const MV neighbor_mv = { br + neighbors[i].row, bc + neighbors[i].col }; in calc_int_cost_list()
1067 const MV *const ref_mv, int sadpb, in calc_int_sad_list()
1069 const MV *best_mv, int *cost_list, in calc_int_sad_list()
1071 static const MV neighbors[4] = { { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 } }; in calc_int_sad_list()
1074 const MV fcenter_mv = { ref_mv->row >> 3, ref_mv->col >> 3 }; in calc_int_sad_list()
1083 const MV this_mv = { br + neighbors[i].row, bc + neighbors[i].col }; in calc_int_sad_list()
1090 const MV this_mv = { br + neighbors[i].row, bc + neighbors[i].col }; in calc_int_sad_list()
1102 const MV this_mv = { br + neighbors[i].row, bc + neighbors[i].col }; in calc_int_sad_list()
1117 MACROBLOCK *x, MV *start_mv, int search_param, int sad_per_bit, in pattern_search()
1119 int use_mvcost, const MV *center_mv, in pattern_search()
1121 const MV candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES]) { in pattern_search()
1134 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in pattern_search()
1137 // adjust ref_mv to make sure it is within MV range in pattern_search()
1162 const MV this_mv = { br + candidates[t][i].row, in pattern_search()
1171 const MV this_mv = { br + candidates[t][i].row, in pattern_search()
1205 const MV this_mv = { br + candidates[s][i].row, in pattern_search()
1214 const MV this_mv = { br + candidates[s][i].row, in pattern_search()
1242 const MV this_mv = { in pattern_search()
1253 const MV this_mv = { in pattern_search()
1279 const MV this_mv = { br + candidates[s][i].row, in pattern_search()
1288 const MV this_mv = { br + candidates[s][i].row, in pattern_search()
1316 const MV this_mv = { in pattern_search()
1327 const MV this_mv = { in pattern_search()
1358 const MV best_int_mv = { br, bc }; in pattern_search()
1372 int av1_get_mvpred_var(const MACROBLOCK *x, const MV *best_mv, in av1_get_mvpred_var()
1373 const MV *center_mv, const aom_variance_fn_ptr_t *vfp, in av1_get_mvpred_var()
1378 const MV mv = { best_mv->row * 8, best_mv->col * 8 }; in av1_get_mvpred_var() local
1383 (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmv_vec_cost, in av1_get_mvpred_var()
1388 int av1_get_mvpred_av_var(const MACROBLOCK *x, const MV *best_mv, in av1_get_mvpred_av_var()
1389 const MV *center_mv, const uint8_t *second_pred, in av1_get_mvpred_av_var()
1394 const MV mv = { best_mv->row * 8, best_mv->col * 8 }; in av1_get_mvpred_av_var() local
1399 (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmv_vec_cost, in av1_get_mvpred_av_var()
1404 int av1_get_mvpred_mask_var(const MACROBLOCK *x, const MV *best_mv, in av1_get_mvpred_mask_var()
1405 const MV *center_mv, const uint8_t *second_pred, in av1_get_mvpred_mask_var()
1412 const MV mv = { best_mv->row * 8, best_mv->col * 8 }; in av1_get_mvpred_mask_var() local
1418 (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmv_vec_cost, in av1_get_mvpred_mask_var()
1423 int av1_hex_search(MACROBLOCK *x, MV *start_mv, int search_param, in av1_hex_search()
1426 const MV *center_mv) { in av1_hex_search()
1433 static const MV hex_candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES] = { in av1_hex_search()
1459 static int bigdia_search(MACROBLOCK *x, MV *start_mv, int search_param, in bigdia_search()
1462 const MV *center_mv) { in bigdia_search()
1470 static const MV in bigdia_search()
1500 static int square_search(MACROBLOCK *x, MV *start_mv, int search_param, in square_search()
1503 const MV *center_mv) { in square_search()
1510 static const MV in square_search()
1541 static int fast_hex_search(MACROBLOCK *x, MV *ref_mv, int search_param, in fast_hex_search()
1545 int use_mvcost, const MV *center_mv) { in fast_hex_search()
1551 static int fast_dia_search(MACROBLOCK *x, MV *ref_mv, int search_param, in fast_dia_search()
1554 const MV *center_mv) { in fast_dia_search()
1564 static int exhuastive_mesh_search(MACROBLOCK *x, MV *ref_mv, MV *best_mv, in exhuastive_mesh_search()
1567 const MV *center_mv) { in exhuastive_mesh_search()
1571 MV fcenter_mv = { center_mv->row, center_mv->col }; in exhuastive_mesh_search()
1595 const MV mv = { fcenter_mv.row + r, fcenter_mv.col + c }; in exhuastive_mesh_search() local
1597 fn_ptr->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &mv), in exhuastive_mesh_search()
1600 sad += mvsad_err_cost(x, &mv, ref_mv, sad_per_bit); in exhuastive_mesh_search()
1604 *best_mv = mv; in exhuastive_mesh_search()
1613 const MV mv = { fcenter_mv.row + r, fcenter_mv.col + c + i }; in exhuastive_mesh_search() local
1614 addrs[i] = get_buf_from_mv(in_what, &mv); in exhuastive_mesh_search()
1620 const MV mv = { fcenter_mv.row + r, fcenter_mv.col + c + i }; in exhuastive_mesh_search() local
1622 sads[i] + mvsad_err_cost(x, &mv, ref_mv, sad_per_bit); in exhuastive_mesh_search()
1626 *best_mv = mv; in exhuastive_mesh_search()
1632 const MV mv = { fcenter_mv.row + r, fcenter_mv.col + c + i }; in exhuastive_mesh_search() local
1635 get_buf_from_mv(in_what, &mv), in_what->stride); in exhuastive_mesh_search()
1637 sad += mvsad_err_cost(x, &mv, ref_mv, sad_per_bit); in exhuastive_mesh_search()
1641 *best_mv = mv; in exhuastive_mesh_search()
1654 MV *ref_mv, MV *best_mv, int search_param, in av1_diamond_search_sad_c()
1657 const MV *center_mv) { in av1_diamond_search_sad_c()
1682 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in av1_diamond_search_sad_c()
1706 all_in &= ((best_mv->row + ss[i].mv.row) > x->mv_limits.row_min); in av1_diamond_search_sad_c()
1707 all_in &= ((best_mv->row + ss[i + 1].mv.row) < x->mv_limits.row_max); in av1_diamond_search_sad_c()
1708 all_in &= ((best_mv->col + ss[i + 2].mv.col) > x->mv_limits.col_min); in av1_diamond_search_sad_c()
1709 all_in &= ((best_mv->col + ss[i + 3].mv.col) < x->mv_limits.col_max); in av1_diamond_search_sad_c()
1728 const MV this_mv = { best_mv->row + ss[i].mv.row, in av1_diamond_search_sad_c()
1729 best_mv->col + ss[i].mv.col }; in av1_diamond_search_sad_c()
1742 const MV this_mv = { best_mv->row + ss[i].mv.row, in av1_diamond_search_sad_c()
1743 best_mv->col + ss[i].mv.col }; in av1_diamond_search_sad_c()
1763 best_mv->row += ss[best_site].mv.row; in av1_diamond_search_sad_c()
1764 best_mv->col += ss[best_site].mv.col; in av1_diamond_search_sad_c()
1769 const MV this_mv = { best_mv->row + ss[best_site].mv.row, in av1_diamond_search_sad_c()
1770 best_mv->col + ss[best_site].mv.col }; in av1_diamond_search_sad_c()
1779 best_mv->row += ss[best_site].mv.row; in av1_diamond_search_sad_c()
1780 best_mv->col += ss[best_site].mv.col; in av1_diamond_search_sad_c()
1800 MV *mvp_full, int step_param, int sadpb, in full_pixel_diamond()
1803 const MV *ref_mv, const search_site_config *cfg) { in full_pixel_diamond()
1804 MV temp_mv; in full_pixel_diamond()
1841 MV best_mv = x->best_mv.as_mv; in full_pixel_diamond()
1865 const MV *centre_mv_full, int sadpb, in full_pixel_exhaustive()
1868 const MV *ref_mv, MV *dst_mv) { in full_pixel_exhaustive()
1870 MV temp_mv = { centre_mv_full->row, centre_mv_full->col }; in full_pixel_exhaustive()
1871 MV f_ref_mv = { ref_mv->row >> 3, ref_mv->col >> 3 }; in full_pixel_exhaustive()
1922 int av1_refining_search_sad(MACROBLOCK *x, MV *ref_mv, int error_per_bit, in av1_refining_search_sad()
1925 const MV *center_mv) { in av1_refining_search_sad()
1927 const MV neighbors[4] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 } }; in av1_refining_search_sad()
1930 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in av1_refining_search_sad()
1954 const MV mv = { ref_mv->row + neighbors[j].row, in av1_refining_search_sad() local
1956 sads[j] += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit); in av1_refining_search_sad()
1965 const MV mv = { ref_mv->row + neighbors[j].row, in av1_refining_search_sad() local
1968 if (is_mv_in(&x->mv_limits, &mv)) { in av1_refining_search_sad()
1971 get_buf_from_mv(in_what, &mv), in_what->stride); in av1_refining_search_sad()
1973 sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit); in av1_refining_search_sad()
2001 int invert_mask, const MV *center_mv, in av1_refining_search_8p_c()
2016 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in av1_refining_search_8p_c()
2017 MV *best_mv = &x->best_mv.as_mv; in av1_refining_search_8p_c()
2049 const MV mv = { best_mv->row + neighbors[j].coord.row, in av1_refining_search_8p_c() local
2053 if (is_mv_in(&x->mv_limits, &mv)) { in av1_refining_search_8p_c()
2057 get_buf_from_mv(in_what, &mv), in_what->stride, in av1_refining_search_8p_c()
2061 get_buf_from_mv(in_what, &mv), in_what->stride, in av1_refining_search_8p_c()
2065 sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit); in av1_refining_search_8p_c()
2165 static const MV search_pos[4] = {
2174 int mi_col, const MV *ref_mv) { in av1_int_pro_motion_estimation()
2190 MV *tmp_mv = &xd->mi[0]->mv[0].as_mv; in av1_int_pro_motion_estimation()
2192 MV this_mv; in av1_int_pro_motion_estimation()
2311 MV *mvp_full, int step_param, int method, in av1_full_pixel_search()
2313 int *cost_list, const MV *ref_mv, int var_max, int rd, in av1_full_pixel_search()
2366 MV tmp_mv_ex; in av1_full_pixel_search()
2396 MV tmp_mv_ex; in av1_full_pixel_search()
2421 MV best_hash_mv; in av1_full_pixel_search()
2448 const MV dv = { 8 * (ref_block_hash.y - y_pos), in av1_full_pixel_search()
2454 MV hash_mv; in av1_full_pixel_search()
2512 MV this_mv = { r, c }; \
2530 const int32_t *mask, const MV *bestmv, const MV *ref_mv, int error_per_bit, in setup_obmc_center_error()
2543 const MV *const mv, const int32_t *mask, const aom_variance_fn_ptr_t *vfp, in upsampled_obmc_pref_error() argument
2552 aom_highbd_upsampled_pred(xd, cm, mi_row, mi_col, mv, pred8, w, h, in upsampled_obmc_pref_error()
2557 aom_upsampled_pred(xd, cm, mi_row, mi_col, mv, pred, w, h, subpel_x_q3, in upsampled_obmc_pref_error()
2567 const int32_t *mask, const MV *bestmv, const MV *ref_mv, int error_per_bit, in upsampled_setup_obmc_center_error()
2582 MV *bestmv, const MV *ref_mv, int allow_hp, int error_per_bit, in av1_find_best_obmc_sub_pixel_tree_up()
2606 const MV *search_step = search_step_table; in av1_find_best_obmc_sub_pixel_tree_up()
2646 MV this_mv = { tr, tc }; in av1_find_best_obmc_sub_pixel_tree_up()
2677 MV this_mv = { tr, tc }; in av1_find_best_obmc_sub_pixel_tree_up()
2742 const int32_t *mask, const MV *best_mv, in get_obmc_mvpred_var()
2743 const MV *center_mv, in get_obmc_mvpred_var()
2748 const MV mv = { best_mv->row * 8, best_mv->col * 8 }; in get_obmc_mvpred_var() local
2753 (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmv_vec_cost, in get_obmc_mvpred_var()
2759 const int32_t *mask, MV *ref_mv, in obmc_refining_search_sad()
2762 const MV *center_mv, int is_second) { in obmc_refining_search_sad()
2763 const MV neighbors[4] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 } }; in obmc_refining_search_sad()
2766 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in obmc_refining_search_sad()
2776 const MV mv = { ref_mv->row + neighbors[j].row, in obmc_refining_search_sad() local
2778 if (is_mv_in(&x->mv_limits, &mv)) { in obmc_refining_search_sad()
2779 unsigned int sad = fn_ptr->osdf(get_buf_from_mv(in_what, &mv), in obmc_refining_search_sad()
2782 sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit); in obmc_refining_search_sad()
2804 MV *ref_mv, MV *best_mv, int search_param, in obmc_diamond_search_sad()
2807 const MV *center_mv, int is_second) { in obmc_diamond_search_sad()
2816 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in obmc_diamond_search_sad()
2838 const MV mv = { best_mv->row + ss[i].mv.row, in obmc_diamond_search_sad() local
2839 best_mv->col + ss[i].mv.col }; in obmc_diamond_search_sad()
2840 if (is_mv_in(&x->mv_limits, &mv)) { in obmc_diamond_search_sad()
2844 sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit); in obmc_diamond_search_sad()
2856 best_mv->row += ss[best_site].mv.row; in obmc_diamond_search_sad()
2857 best_mv->col += ss[best_site].mv.col; in obmc_diamond_search_sad()
2862 const MV this_mv = { best_mv->row + ss[best_site].mv.row, in obmc_diamond_search_sad()
2863 best_mv->col + ss[best_site].mv.col }; in obmc_diamond_search_sad()
2871 best_mv->row += ss[best_site].mv.row; in obmc_diamond_search_sad()
2872 best_mv->col += ss[best_site].mv.col; in obmc_diamond_search_sad()
2889 MV *mvp_full, int step_param, int sadpb, in obmc_full_pixel_diamond()
2892 const MV *ref_mv, MV *dst_mv, int is_second, in obmc_full_pixel_diamond()
2897 MV temp_mv; in obmc_full_pixel_diamond()
2937 MV best_mv = *dst_mv; in obmc_full_pixel_diamond()
2951 int av1_obmc_full_pixel_search(const AV1_COMP *cpi, MACROBLOCK *x, MV *mvp_full, in av1_obmc_full_pixel_search()
2955 const MV *ref_mv, MV *dst_mv, int is_second, in av1_obmc_full_pixel_search()
2978 // vector unit test, which return extreme motion vectors allowed by the MV
3011 // Return the maximum MV.
3014 const MV *ref_mv, int allow_hp, int error_per_bit, in av1_return_max_sub_pixel_mv()
3035 // In the sub-pel motion search, if hp is not used, then the last bit of mv in av1_return_max_sub_pixel_mv()
3040 // Return the minimum MV.
3043 const MV *ref_mv, int allow_hp, int error_per_bit, in av1_return_min_sub_pixel_mv()
3064 // In the sub-pel motion search, if hp is not used, then the last bit of mv in av1_return_min_sub_pixel_mv()
3072 MV ref_mv_full, int num_planes, in av1_simple_motion_search()
3095 MV ref_mv = { 0, 0 }; in av1_simple_motion_search()
3135 x->errorperbit, &cpi->fn_ptr[bsize], cpi->sf.mv.subpel_force_stop, in av1_simple_motion_search()
3136 cpi->sf.mv.subpel_iters_per_step, cond_cost_list(cpi, cost_list), in av1_simple_motion_search()
3142 x->errorperbit, &cpi->fn_ptr[bsize], cpi->sf.mv.subpel_force_stop, in av1_simple_motion_search()
3143 cpi->sf.mv.subpel_iters_per_step, cond_cost_list(cpi, cost_list), in av1_simple_motion_search()
3154 mbmi->mv[0].as_mv = x->best_mv.as_mv; in av1_simple_motion_search()
3169 const MV ref_mv_full, int use_subpixel, in av1_simple_motion_sse_var()