diff options
Diffstat (limited to 'vp10/encoder/mcomp.c')
-rw-r--r-- | vp10/encoder/mcomp.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/vp10/encoder/mcomp.c b/vp10/encoder/mcomp.c index 5720c63c7..1cfe4712f 100644 --- a/vp10/encoder/mcomp.c +++ b/vp10/encoder/mcomp.c @@ -37,10 +37,10 @@ void vp10_set_mv_search_range(MACROBLOCK *x, const MV *mv) { int col_max = (mv->col >> 3) + MAX_FULL_PEL_VAL; int row_max = (mv->row >> 3) + MAX_FULL_PEL_VAL; - col_min = MAX(col_min, (MV_LOW >> 3) + 1); - row_min = MAX(row_min, (MV_LOW >> 3) + 1); - col_max = MIN(col_max, (MV_UPP >> 3) - 1); - row_max = MIN(row_max, (MV_UPP >> 3) - 1); + col_min = VPXMAX(col_min, (MV_LOW >> 3) + 1); + row_min = VPXMAX(row_min, (MV_LOW >> 3) + 1); + col_max = VPXMIN(col_max, (MV_UPP >> 3) - 1); + row_max = VPXMIN(row_max, (MV_UPP >> 3) - 1); // Get intersection of UMV window and valid MV window to reduce # of checks // in diamond search. @@ -57,12 +57,12 @@ void vp10_set_mv_search_range(MACROBLOCK *x, const MV *mv) { int vp10_init_search_range(int size) { int sr = 0; // Minimum search size no matter what the passed in value. - size = MAX(16, size); + size = VPXMAX(16, size); while ((size << sr) < MAX_FULL_PEL_VAL) sr++; - sr = MIN(sr, MAX_MVSEARCH_STEPS - 2); + sr = VPXMIN(sr, MAX_MVSEARCH_STEPS - 2); return sr; } @@ -297,10 +297,10 @@ static INLINE const uint8_t *pre(const uint8_t *buf, int stride, int r, int c) { int br = bestmv->row * 8; \ int bc = bestmv->col * 8; \ int hstep = 4; \ - const int minc = MAX(x->mv_col_min * 8, ref_mv->col - MV_MAX); \ - const int maxc = MIN(x->mv_col_max * 8, ref_mv->col + MV_MAX); \ - const int minr = MAX(x->mv_row_min * 8, ref_mv->row - MV_MAX); \ - const int maxr = MIN(x->mv_row_max * 8, ref_mv->row + MV_MAX); \ + const int minc = VPXMAX(x->mv_col_min * 8, ref_mv->col - MV_MAX); \ + const int maxc = VPXMIN(x->mv_col_max * 8, ref_mv->col + MV_MAX); \ + const int minr = VPXMAX(x->mv_row_min * 8, ref_mv->row - MV_MAX); \ + const int maxr = VPXMIN(x->mv_row_max * 8, ref_mv->row + MV_MAX); \ int tr = br; \ int tc = bc; \ \ @@ -668,10 +668,10 @@ int vp10_find_best_sub_pixel_tree(const MACROBLOCK *x, int bc = bestmv->col * 8; int hstep = 4; int iter, round = 3 - forced_stop; - const int minc = MAX(x->mv_col_min * 8, ref_mv->col - MV_MAX); - const int maxc = MIN(x->mv_col_max * 8, ref_mv->col + MV_MAX); - const int minr = MAX(x->mv_row_min * 8, ref_mv->row - MV_MAX); - const int maxr = MIN(x->mv_row_max * 8, ref_mv->row + MV_MAX); + const int minc = VPXMAX(x->mv_col_min * 8, ref_mv->col - MV_MAX); + const int maxc = VPXMIN(x->mv_col_max * 8, ref_mv->col + MV_MAX); + const int minr = VPXMAX(x->mv_row_min * 8, ref_mv->row - MV_MAX); + const int maxr = VPXMIN(x->mv_row_max * 8, ref_mv->row + MV_MAX); int tr = br; int tc = bc; const MV *search_step = search_step_table; @@ -1500,9 +1500,9 @@ int vp10_fast_hex_search(const MACROBLOCK *x, int use_mvcost, const MV *center_mv, MV *best_mv) { - return vp10_hex_search(x, ref_mv, MAX(MAX_MVSEARCH_STEPS - 2, search_param), - sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, - center_mv, best_mv); + return vp10_hex_search( + x, ref_mv, VPXMAX(MAX_MVSEARCH_STEPS - 2, search_param), sad_per_bit, + do_init_search, cost_list, vfp, use_mvcost, center_mv, best_mv); } int vp10_fast_dia_search(const MACROBLOCK *x, @@ -1515,9 +1515,9 @@ int vp10_fast_dia_search(const MACROBLOCK *x, int use_mvcost, const MV *center_mv, MV *best_mv) { - return vp10_bigdia_search(x, ref_mv, MAX(MAX_MVSEARCH_STEPS - 2, search_param), - sad_per_bit, do_init_search, cost_list, vfp, - use_mvcost, center_mv, best_mv); + return vp10_bigdia_search( + x, ref_mv, VPXMAX(MAX_MVSEARCH_STEPS - 2, search_param), sad_per_bit, + do_init_search, cost_list, vfp, use_mvcost, center_mv, best_mv); } #undef CHECK_BETTER @@ -1547,10 +1547,10 @@ int vp10_full_range_search_c(const MACROBLOCK *x, best_sad = fn_ptr->sdf(what->buf, what->stride, get_buf_from_mv(in_what, ref_mv), in_what->stride) + mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit); - start_row = MAX(-range, x->mv_row_min - ref_mv->row); - start_col = MAX(-range, x->mv_col_min - ref_mv->col); - end_row = MIN(range, x->mv_row_max - ref_mv->row); - end_col = MIN(range, x->mv_col_max - ref_mv->col); + start_row = VPXMAX(-range, x->mv_row_min - ref_mv->row); + start_col = VPXMAX(-range, x->mv_col_min - ref_mv->col); + end_row = VPXMIN(range, x->mv_row_max - ref_mv->row); + end_col = VPXMIN(range, x->mv_col_max - ref_mv->col); for (r = start_row; r <= end_row; ++r) { for (c = start_col; c <= end_col; c += 4) { @@ -2021,10 +2021,10 @@ int vp10_full_search_sad_c(const MACROBLOCK *x, const MV *ref_mv, const MACROBLOCKD *const xd = &x->e_mbd; const struct buf_2d *const what = &x->plane[0].src; const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const int row_min = MAX(ref_mv->row - distance, x->mv_row_min); - const int row_max = MIN(ref_mv->row + distance, x->mv_row_max); - const int col_min = MAX(ref_mv->col - distance, x->mv_col_min); - const int col_max = MIN(ref_mv->col + distance, x->mv_col_max); + const int row_min = VPXMAX(ref_mv->row - distance, x->mv_row_min); + const int row_max = VPXMIN(ref_mv->row + distance, x->mv_row_max); + const int col_min = VPXMAX(ref_mv->col - distance, x->mv_col_min); + const int col_max = VPXMIN(ref_mv->col + distance, x->mv_col_max); const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; int best_sad = fn_ptr->sdf(what->buf, what->stride, get_buf_from_mv(in_what, ref_mv), in_what->stride) + @@ -2054,10 +2054,10 @@ int vp10_full_search_sadx3(const MACROBLOCK *x, const MV *ref_mv, const MACROBLOCKD *const xd = &x->e_mbd; const struct buf_2d *const what = &x->plane[0].src; const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const int row_min = MAX(ref_mv->row - distance, x->mv_row_min); - const int row_max = MIN(ref_mv->row + distance, x->mv_row_max); - const int col_min = MAX(ref_mv->col - distance, x->mv_col_min); - const int col_max = MIN(ref_mv->col + distance, x->mv_col_max); + const int row_min = VPXMAX(ref_mv->row - distance, x->mv_row_min); + const int row_max = VPXMIN(ref_mv->row + distance, x->mv_row_max); + const int col_min = VPXMAX(ref_mv->col - distance, x->mv_col_min); + const int col_max = VPXMIN(ref_mv->col + distance, x->mv_col_max); const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride, get_buf_from_mv(in_what, ref_mv), in_what->stride) + @@ -2119,10 +2119,10 @@ int vp10_full_search_sadx8(const MACROBLOCK *x, const MV *ref_mv, const MACROBLOCKD *const xd = &x->e_mbd; const struct buf_2d *const what = &x->plane[0].src; const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const int row_min = MAX(ref_mv->row - distance, x->mv_row_min); - const int row_max = MIN(ref_mv->row + distance, x->mv_row_max); - const int col_min = MAX(ref_mv->col - distance, x->mv_col_min); - const int col_max = MIN(ref_mv->col + distance, x->mv_col_max); + const int row_min = VPXMAX(ref_mv->row - distance, x->mv_row_min); + const int row_max = VPXMIN(ref_mv->row + distance, x->mv_row_max); + const int col_min = VPXMAX(ref_mv->col - distance, x->mv_col_min); + const int col_max = VPXMIN(ref_mv->col + distance, x->mv_col_max); const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride, get_buf_from_mv(in_what, ref_mv), in_what->stride) + |