Lines Matching full:mv
33 const MV *mv) { in get_buf_from_mv() argument
34 return &buf->buf[mv->row * buf->stride + mv->col]; in get_buf_from_mv()
37 void vp9_set_mv_search_range(MvLimits *mv_limits, const MV *mv) { in vp9_set_mv_search_range() argument
38 int col_min = (mv->col >> 3) - MAX_FULL_PEL_VAL + (mv->col & 7 ? 1 : 0); in vp9_set_mv_search_range()
39 int row_min = (mv->row >> 3) - MAX_FULL_PEL_VAL + (mv->row & 7 ? 1 : 0); in vp9_set_mv_search_range()
40 int col_max = (mv->col >> 3) + MAX_FULL_PEL_VAL; in vp9_set_mv_search_range()
41 int row_max = (mv->row >> 3) + MAX_FULL_PEL_VAL; in vp9_set_mv_search_range()
48 // Get intersection of UMV window and valid MV window to reduce # of checks in vp9_set_mv_search_range()
58 const MV *ref_mv) { in vp9_set_subpel_mv_search_range()
85 static INLINE int mv_cost(const MV *mv, const int *joint_cost, in mv_cost() argument
87 assert(mv->row >= -MV_MAX && mv->row < MV_MAX); in mv_cost()
88 assert(mv->col >= -MV_MAX && mv->col < MV_MAX); in mv_cost()
89 return joint_cost[vp9_get_mv_joint(mv)] + comp_cost[0][mv->row] + in mv_cost()
90 comp_cost[1][mv->col]; in mv_cost()
93 int vp9_mv_bit_cost(const MV *mv, const MV *ref, const int *mvjcost, in vp9_mv_bit_cost() argument
95 const MV diff = { mv->row - ref->row, mv->col - ref->col }; in vp9_mv_bit_cost()
100 static int mv_err_cost(const MV *mv, const MV *ref, const int *mvjcost, in mv_err_cost() argument
103 const MV diff = { mv->row - ref->row, mv->col - ref->col }; in mv_err_cost()
112 static int mvsad_err_cost(const MACROBLOCK *x, const MV *mv, const MV *ref, in mvsad_err_cost() argument
114 const MV diff = { mv->row - ref->row, mv->col - ref->col }; in mvsad_err_cost()
126 const MV ss_mvs[] = { { -len, 0 }, { len, 0 }, { 0, -len }, { 0, len } }; in vp9_init_dsmotion_compensation()
144 const MV ss_mvs[8] = { { -len, 0 }, { len, 0 }, { 0, -len }, in vp9_init3smotion_compensation()
170 const MV mv = { r, c }; \
171 const MV ref_mv = { rr, rc }; \
180 tmpmse += mv_err_cost(&mv, &ref_mv, mvjcost, mvcost, error_per_bit); \
197 const MV mv = { r, c }; \
198 const MV ref_mv = { rr, rc }; \
205 if ((v = mv_err_cost(&mv, &ref_mv, mvjcost, mvcost, error_per_bit) + \
301 const MACROBLOCKD *xd, const MV *bestmv, const MV *ref_mv, in setup_center_error()
371 const MACROBLOCK *x, MV *bestmv, const MV *ref_mv, int allow_hp, in vp9_skip_sub_pixel_tree()
404 const MACROBLOCK *x, MV *bestmv, const MV *ref_mv, int allow_hp, in vp9_find_best_sub_pixel_tree_pruned_evenmore()
470 const MACROBLOCK *x, MV *bestmv, const MV *ref_mv, int allow_hp, in vp9_find_best_sub_pixel_tree_pruned_more()
532 const MACROBLOCK *x, MV *bestmv, const MV *ref_mv, int allow_hp, in vp9_find_best_sub_pixel_tree_pruned()
616 static const MV search_step_table[12] = {
625 const MACROBLOCKD *xd, const MV *this_mv, const struct scale_factors *sf, in accurate_sub_pel_search()
689 const MV mv = { r, c }; \
690 const MV ref_mv = { rr, rc }; \
692 accurate_sub_pel_search(xd, &mv, x->me_sf, kernel, vfp, z, src_stride, \
695 tmpmse += mv_err_cost(&mv, &ref_mv, mvjcost, mvcost, error_per_bit); \
712 const MV mv = { r, c }; \
713 const MV ref_mv = { rr, rc }; \
715 accurate_sub_pel_search(xd, &mv, x->me_sf, kernel, vfp, z, src_stride, \
717 if ((v = mv_err_cost(&mv, &ref_mv, mvjcost, mvcost, error_per_bit) + \
732 const MACROBLOCK *x, MV *bestmv, const MV *ref_mv, int allow_hp, in vp9_find_best_sub_pixel_tree()
758 const MV *search_step = search_step_table; in vp9_find_best_sub_pixel_tree()
799 MV this_mv; in vp9_find_best_sub_pixel_tree()
839 MV this_mv = { tr, tc }; in vp9_find_best_sub_pixel_tree()
948 static INLINE int is_mv_in(const MvLimits *mv_limits, const MV *mv) { in is_mv_in() argument
949 return (mv->col >= mv_limits->col_min) && (mv->col <= mv_limits->col_max) && in is_mv_in()
950 (mv->row >= mv_limits->row_min) && (mv->row <= mv_limits->row_max); in is_mv_in()
970 static INLINE void calc_int_cost_list(const MACROBLOCK *x, const MV *ref_mv, in calc_int_cost_list()
973 const MV *best_mv, int *cost_list) { in calc_int_cost_list()
974 static const MV neighbors[4] = { { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 } }; in calc_int_cost_list()
977 const MV fcenter_mv = { ref_mv->row >> 3, ref_mv->col >> 3 }; in calc_int_cost_list()
980 MV this_mv; in calc_int_cost_list()
992 const MV this_mv = { br + neighbors[i].row, bc + neighbors[i].col }; in calc_int_cost_list()
1001 const MV this_mv = { br + neighbors[i].row, bc + neighbors[i].col }; in calc_int_cost_list()
1020 const MACROBLOCK *x, MV *ref_mv, int search_param, int sad_per_bit, in vp9_pattern_search()
1022 int use_mvcost, const MV *center_mv, MV *best_mv, in vp9_pattern_search()
1024 const MV candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES]) { in vp9_pattern_search()
1036 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in vp9_pattern_search()
1038 // adjust ref_mv to make sure it is within MV range in vp9_pattern_search()
1059 const MV this_mv = { br + candidates[t][i].row, in vp9_pattern_search()
1068 const MV this_mv = { br + candidates[t][i].row, in vp9_pattern_search()
1101 const MV this_mv = { br + candidates[s][i].row, in vp9_pattern_search()
1110 const MV this_mv = { br + candidates[s][i].row, in vp9_pattern_search()
1138 const MV this_mv = { in vp9_pattern_search()
1149 const MV this_mv = { in vp9_pattern_search()
1177 const MV best_mv = { br, bc }; in vp9_pattern_search()
1190 const MACROBLOCK *x, MV *ref_mv, int search_param, int sad_per_bit, in vp9_pattern_search_sad()
1192 int use_mvcost, const MV *center_mv, MV *best_mv, in vp9_pattern_search_sad()
1194 const MV candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES]) { in vp9_pattern_search_sad()
1206 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in vp9_pattern_search_sad()
1208 // adjust ref_mv to make sure it is within MV range in vp9_pattern_search_sad()
1233 const MV this_mv = { br + candidates[t][i].row, in vp9_pattern_search_sad()
1242 const MV this_mv = { br + candidates[t][i].row, in vp9_pattern_search_sad()
1275 const MV this_mv = { br + candidates[s][i].row, in vp9_pattern_search_sad()
1284 const MV this_mv = { br + candidates[s][i].row, in vp9_pattern_search_sad()
1312 const MV this_mv = { in vp9_pattern_search_sad()
1323 const MV this_mv = { in vp9_pattern_search_sad()
1349 const MV this_mv = { br + candidates[s][i].row, in vp9_pattern_search_sad()
1358 const MV this_mv = { br + candidates[s][i].row, in vp9_pattern_search_sad()
1386 const MV this_mv = { in vp9_pattern_search_sad()
1397 const MV this_mv = { in vp9_pattern_search_sad()
1428 static const MV neighbors[4] = { { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 } }; in vp9_pattern_search_sad()
1433 const MV this_mv = { br + neighbors[i].row, bc + neighbors[i].col }; in vp9_pattern_search_sad()
1440 const MV this_mv = { br + neighbors[i].row, bc + neighbors[i].col }; in vp9_pattern_search_sad()
1452 const MV this_mv = { br + neighbors[i].row, bc + neighbors[i].col }; in vp9_pattern_search_sad()
1466 int vp9_get_mvpred_var(const MACROBLOCK *x, const MV *best_mv, in vp9_get_mvpred_var()
1467 const MV *center_mv, const vp9_variance_fn_ptr_t *vfp, in vp9_get_mvpred_var()
1472 const MV mv = { best_mv->row * 8, best_mv->col * 8 }; in vp9_get_mvpred_var() local
1478 err += (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmvjointcost, x->mvcost, in vp9_get_mvpred_var()
1486 (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmvjointcost, x->mvcost, in vp9_get_mvpred_var()
1492 int vp9_get_mvpred_av_var(const MACROBLOCK *x, const MV *best_mv, in vp9_get_mvpred_av_var()
1493 const MV *center_mv, const uint8_t *second_pred, in vp9_get_mvpred_av_var()
1498 const MV mv = { best_mv->row * 8, best_mv->col * 8 }; in vp9_get_mvpred_av_var() local
1503 (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmvjointcost, x->mvcost, in vp9_get_mvpred_av_var()
1508 static int hex_search(const MACROBLOCK *x, MV *ref_mv, int search_param, in hex_search()
1511 const MV *center_mv, MV *best_mv) { in hex_search()
1518 static const MV hex_candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES] = { in hex_search()
1544 static int bigdia_search(const MACROBLOCK *x, MV *ref_mv, int search_param, in bigdia_search()
1547 const MV *center_mv, MV *best_mv) { in bigdia_search()
1555 static const MV in bigdia_search()
1585 static int square_search(const MACROBLOCK *x, MV *ref_mv, int search_param, in square_search()
1588 const MV *center_mv, MV *best_mv) { in square_search()
1595 static const MV in square_search()
1626 static int fast_hex_search(const MACROBLOCK *x, MV *ref_mv, int search_param, in fast_hex_search()
1630 int use_mvcost, const MV *center_mv, MV *best_mv) { in fast_hex_search()
1636 static int fast_dia_search(const MACROBLOCK *x, MV *ref_mv, int search_param, in fast_dia_search()
1639 const MV *center_mv, MV *best_mv) { in fast_dia_search()
1649 static int exhuastive_mesh_search(const MACROBLOCK *x, MV *ref_mv, MV *best_mv, in exhuastive_mesh_search()
1652 const MV *center_mv) { in exhuastive_mesh_search()
1656 MV fcenter_mv = { center_mv->row, center_mv->col }; in exhuastive_mesh_search()
1680 const MV mv = { fcenter_mv.row + r, fcenter_mv.col + c }; in exhuastive_mesh_search() local
1682 fn_ptr->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &mv), in exhuastive_mesh_search()
1685 sad += mvsad_err_cost(x, &mv, ref_mv, sad_per_bit); in exhuastive_mesh_search()
1688 *best_mv = mv; in exhuastive_mesh_search()
1697 const MV mv = { fcenter_mv.row + r, fcenter_mv.col + c + i }; in exhuastive_mesh_search() local
1698 addrs[i] = get_buf_from_mv(in_what, &mv); in exhuastive_mesh_search()
1704 const MV mv = { fcenter_mv.row + r, fcenter_mv.col + c + i }; in exhuastive_mesh_search() local
1706 sads[i] + mvsad_err_cost(x, &mv, ref_mv, sad_per_bit); in exhuastive_mesh_search()
1709 *best_mv = mv; in exhuastive_mesh_search()
1715 const MV mv = { fcenter_mv.row + r, fcenter_mv.col + c + i }; in exhuastive_mesh_search() local
1718 get_buf_from_mv(in_what, &mv), in_what->stride); in exhuastive_mesh_search()
1720 sad += mvsad_err_cost(x, &mv, ref_mv, sad_per_bit); in exhuastive_mesh_search()
1723 *best_mv = mv; in exhuastive_mesh_search()
1736 double vp9_nb_mvs_inconsistency(const MV *mv, const int_mv *nb_mvs, in vp9_nb_mvs_inconsistency() argument
1744 MV nb_mv = nb_mvs[i].as_mv; in vp9_nb_mvs_inconsistency()
1745 const double row_diff = mv->row - nb_mv.row; in vp9_nb_mvs_inconsistency()
1746 const double col_diff = mv->col - nb_mv.col; in vp9_nb_mvs_inconsistency()
1762 const MV *init_full_mv, MV *best_full_mv, in vp9_diamond_search_sad_new()
1786 const MV *ss_mv = &cfg->ss_mv[search_param * cfg->searches_per_step]; in vp9_diamond_search_sad_new()
1834 const MV this_mv = { best_full_mv->row + ss_mv[i].row, in vp9_diamond_search_sad_new()
1851 const MV this_mv = { best_full_mv->row + ss_mv[i].row, in vp9_diamond_search_sad_new()
1898 int_mv *mv = in vp9_prepare_nb_full_mvs() local
1901 nb_full_mvs[i].as_mv = get_full_mv(&mv->as_mv); in vp9_prepare_nb_full_mvs()
1913 MV *ref_mv, MV *best_mv, int search_param, in vp9_diamond_search_sad_c()
1916 const MV *center_mv) { in vp9_diamond_search_sad_c()
1939 const MV *ss_mv = &cfg->ss_mv[search_param * cfg->searches_per_step]; in vp9_diamond_search_sad_c()
1943 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in vp9_diamond_search_sad_c()
1988 const MV this_mv = { best_mv->row + ss_mv[i].row, in vp9_diamond_search_sad_c()
2002 const MV this_mv = { best_mv->row + ss_mv[i].row, in vp9_diamond_search_sad_c()
2028 const MV this_mv = { best_mv->row + ss_mv[best_site].row, in vp9_diamond_search_sad_c()
2120 static const MV search_pos[4] = {
2129 int mi_col, const MV *ref_mv) { in vp9_int_pro_motion_estimation()
2145 MV *tmp_mv = &xd->mi[0]->mv[0].as_mv; in vp9_int_pro_motion_estimation()
2147 MV this_mv; in vp9_int_pro_motion_estimation()
2272 MV *mvp_full, int step_param, double lambda, in vp9_full_pixel_diamond_new()
2276 MV *best_mv, double *best_mv_dist, in vp9_full_pixel_diamond_new()
2296 MV temp_mv; in vp9_full_pixel_diamond_new()
2317 MV temp_mv = *best_mv; in vp9_full_pixel_diamond_new()
2338 static int full_pixel_diamond(const VP9_COMP *cpi, MACROBLOCK *x, MV *mvp_full, in full_pixel_diamond()
2342 const MV *ref_mv, MV *dst_mv) { in full_pixel_diamond()
2343 MV temp_mv; in full_pixel_diamond()
2380 MV best_mv = *dst_mv; in full_pixel_diamond()
2404 MV *centre_mv_full, int sadpb, int *cost_list, in full_pixel_exhaustive()
2406 const MV *ref_mv, MV *dst_mv) { in full_pixel_exhaustive()
2408 MV temp_mv = { centre_mv_full->row, centre_mv_full->col }; in full_pixel_exhaustive()
2409 MV f_ref_mv = { ref_mv->row >> 3, ref_mv->col >> 3 }; in full_pixel_exhaustive()
2458 double vp9_refining_search_sad_new(const MACROBLOCK *x, MV *best_full_mv, in vp9_refining_search_sad_new()
2464 const MV neighbors[4] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 } }; in vp9_refining_search_sad_new()
2493 const MV mv = { best_full_mv->row + neighbors[j].row, in vp9_refining_search_sad_new() local
2497 vp9_nb_mvs_inconsistency(&mv, nb_full_mvs, full_mv_num); in vp9_refining_search_sad_new()
2508 const MV mv = { best_full_mv->row + neighbors[j].row, in vp9_refining_search_sad_new() local
2511 if (is_mv_in(&x->mv_limits, &mv)) { in vp9_refining_search_sad_new()
2514 get_buf_from_mv(in_what, &mv), in_what->stride); in vp9_refining_search_sad_new()
2516 vp9_nb_mvs_inconsistency(&mv, nb_full_mvs, full_mv_num); in vp9_refining_search_sad_new()
2541 int vp9_refining_search_sad(const MACROBLOCK *x, MV *ref_mv, int error_per_bit, in vp9_refining_search_sad()
2544 const MV *center_mv) { in vp9_refining_search_sad()
2546 const MV neighbors[4] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 } }; in vp9_refining_search_sad()
2549 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in vp9_refining_search_sad()
2573 const MV mv = { ref_mv->row + neighbors[j].row, in vp9_refining_search_sad() local
2575 sads[j] += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit); in vp9_refining_search_sad()
2584 const MV mv = { ref_mv->row + neighbors[j].row, in vp9_refining_search_sad() local
2587 if (is_mv_in(&x->mv_limits, &mv)) { in vp9_refining_search_sad()
2590 get_buf_from_mv(in_what, &mv), in_what->stride); in vp9_refining_search_sad()
2592 sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit); in vp9_refining_search_sad()
2616 int vp9_refining_search_8p_c(const MACROBLOCK *x, MV *ref_mv, int error_per_bit, in vp9_refining_search_8p_c()
2619 const MV *center_mv, const uint8_t *second_pred) { in vp9_refining_search_8p_c()
2620 const MV neighbors[8] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 }, in vp9_refining_search_8p_c()
2625 const MV fcenter_mv = { center_mv->row >> 3, center_mv->col >> 3 }; in vp9_refining_search_8p_c()
2639 const MV mv = { ref_mv->row + neighbors[j].row, in vp9_refining_search_8p_c() local
2642 if (is_mv_in(&x->mv_limits, &mv)) { in vp9_refining_search_8p_c()
2644 fn_ptr->sdaf(what->buf, what->stride, get_buf_from_mv(in_what, &mv), in vp9_refining_search_8p_c()
2647 sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit); in vp9_refining_search_8p_c()
2667 MV *mvp_full, int step_param, int search_method, in vp9_full_pixel_search()
2668 int error_per_bit, int *cost_list, const MV *ref_mv, in vp9_full_pixel_search()
2669 MV *tmp_mv, int var_max, int rd) { in vp9_full_pixel_search()
2728 MV tmp_mv_ex; in vp9_full_pixel_search()
2744 // vector unit test, which return extreme motion vectors allowed by the MV
2781 // Return the maximum MV.
2783 const MACROBLOCK *x, MV *bestmv, const MV *ref_mv, int allow_hp, in vp9_return_max_sub_pixel_mv()
2797 // In the sub-pel motion search, if hp is not used, then the last bit of mv in vp9_return_max_sub_pixel_mv()
2803 // Return the minimum MV.
2805 const MACROBLOCK *x, MV *bestmv, const MV *ref_mv, int allow_hp, in vp9_return_min_sub_pixel_mv()
2819 // In the sub-pel motion search, if hp is not used, then the last bit of mv in vp9_return_min_sub_pixel_mv()