From: Yunqing Wang Date: Tue, 27 Dec 2016 19:52:39 +0000 (-0800) Subject: Make sub-pixel mv search's return value consistent with the return type X-Git-Tag: v1.6.1~19^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d12559b0978e26c53053bb6576abb3f00515b03;p=libvpx Make sub-pixel mv search's return value consistent with the return type For out-of-range cases, returned UINT_MAX instead of INT_MAX in the sub-pixel mv search to be consistent with the "uint32_t" return type. Change-Id: I8e206d771228c13d89bafbbe9f14722c8ecc6a7a --- diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c index 2d9bcbda6..dabd8cd61 100644 --- a/vp9/encoder/vp9_mcomp.c +++ b/vp9/encoder/vp9_mcomp.c @@ -277,7 +277,7 @@ static INLINE const uint8_t *pre(const uint8_t *buf, int stride, int r, int c) { const uint8_t *const z = x->plane[0].src.buf; \ const int src_stride = x->plane[0].src.stride; \ const MACROBLOCKD *xd = &x->e_mbd; \ - unsigned int besterr = INT_MAX; \ + unsigned int besterr = UINT_MAX; \ unsigned int sse; \ unsigned int whichdir; \ int thismse; \ @@ -472,7 +472,7 @@ uint32_t vp9_find_best_sub_pixel_tree_pruned_evenmore( if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) || (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3))) - return INT_MAX; + return UINT_MAX; return besterr; } @@ -622,7 +622,7 @@ uint32_t vp9_find_best_sub_pixel_tree_pruned( if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) || (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3))) - return INT_MAX; + return UINT_MAX; return besterr; } @@ -646,7 +646,7 @@ uint32_t vp9_find_best_sub_pixel_tree( const uint8_t *const src_address = z; const int src_stride = x->plane[0].src.stride; const MACROBLOCKD *xd = &x->e_mbd; - unsigned int besterr = INT_MAX; + unsigned int besterr = UINT_MAX; unsigned int sse; int thismse; const int y_stride = xd->plane[0].pre[0].stride; @@ -708,7 +708,7 @@ uint32_t vp9_find_best_sub_pixel_tree( *sse1 = sse; } } else { - cost_array[idx] = INT_MAX; + cost_array[idx] = UINT_MAX; } } @@ -737,7 +737,7 @@ uint32_t vp9_find_best_sub_pixel_tree( *sse1 = sse; } } else { - cost_array[idx] = INT_MAX; + cost_array[idx] = UINT_MAX; } if (best_idx < 4 && best_idx >= 0) { @@ -771,7 +771,7 @@ uint32_t vp9_find_best_sub_pixel_tree( if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) || (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3))) - return INT_MAX; + return UINT_MAX; return besterr; }