diff options
author | Jerome Jiang <jianj@google.com> | 2019-03-28 10:03:27 -0700 |
---|---|---|
committer | Jerome Jiang <jianj@google.com> | 2019-03-28 10:05:11 -0700 |
commit | 26ef25a364f13a1cb47e7007c1c50677e55a8fcf (patch) | |
tree | 1672ad8534e2062f11a5540461b746e12edba79e /vp8/encoder/mcomp.c | |
parent | c09e95fc7da1c91db3cef34dc61010ab33443eea (diff) | |
download | libvpx-26ef25a364f13a1cb47e7007c1c50677e55a8fcf.tar libvpx-26ef25a364f13a1cb47e7007c1c50677e55a8fcf.tar.gz libvpx-26ef25a364f13a1cb47e7007c1c50677e55a8fcf.tar.bz2 libvpx-26ef25a364f13a1cb47e7007c1c50677e55a8fcf.zip |
Revert "Wrap macro definition in do-while(0)"
This reverts commit aa04b6f9a7475e9d9457dfc5bf441faf15efc466.
It caused big regression on webrtc VP8 tests.
Change-Id: I937e769d133abeca62ba063e59a58b5c461f5b5e
Diffstat (limited to 'vp8/encoder/mcomp.c')
-rw-r--r-- | vp8/encoder/mcomp.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/vp8/encoder/mcomp.c b/vp8/encoder/mcomp.c index fd9810e1e..999d6e851 100644 --- a/vp8/encoder/mcomp.c +++ b/vp8/encoder/mcomp.c @@ -800,24 +800,24 @@ int vp8_find_best_half_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d, } #define CHECK_BOUNDS(range) \ - do { \ + { \ all_in = 1; \ all_in &= ((br - range) >= x->mv_row_min); \ all_in &= ((br + range) <= x->mv_row_max); \ all_in &= ((bc - range) >= x->mv_col_min); \ all_in &= ((bc + range) <= x->mv_col_max); \ - } while (0) + } #define CHECK_POINT \ - do { \ + { \ if (this_mv.as_mv.col < x->mv_col_min) continue; \ if (this_mv.as_mv.col > x->mv_col_max) continue; \ if (this_mv.as_mv.row < x->mv_row_min) continue; \ if (this_mv.as_mv.row > x->mv_row_max) continue; \ - } while (0) + } #define CHECK_BETTER \ - do { \ + { \ if (thissad < bestsad) { \ thissad += \ mvsad_err_cost(&this_mv, &fcenter_mv, mvsadcost, sad_per_bit); \ @@ -826,7 +826,7 @@ int vp8_find_best_half_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d, best_site = i; \ } \ } \ - } while (0) + } static const MV next_chkpts[6][3] = { { { -2, 0 }, { -1, -2 }, { 1, -2 } }, { { -1, -2 }, { 1, -2 }, { 2, 0 } }, @@ -903,7 +903,7 @@ int vp8_hex_search(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, #endif /* hex search */ - CHECK_BOUNDS(2); + CHECK_BOUNDS(2) if (all_in) { for (i = 0; i < 6; ++i) { @@ -912,17 +912,17 @@ int vp8_hex_search(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, this_offset = base_offset + (this_mv.as_mv.row * in_what_stride) + this_mv.as_mv.col; thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride); - CHECK_BETTER; + CHECK_BETTER } } else { for (i = 0; i < 6; ++i) { this_mv.as_mv.row = br + hex[i].row; this_mv.as_mv.col = bc + hex[i].col; - CHECK_POINT; + CHECK_POINT this_offset = base_offset + (this_mv.as_mv.row * in_what_stride) + this_mv.as_mv.col; thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride); - CHECK_BETTER; + CHECK_BETTER } } @@ -936,7 +936,7 @@ int vp8_hex_search(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, for (j = 1; j < hex_range; ++j) { best_site = -1; - CHECK_BOUNDS(2); + CHECK_BOUNDS(2) if (all_in) { for (i = 0; i < 3; ++i) { @@ -945,17 +945,17 @@ int vp8_hex_search(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) + this_mv.as_mv.col; thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride); - CHECK_BETTER; + CHECK_BETTER } } else { for (i = 0; i < 3; ++i) { this_mv.as_mv.row = br + next_chkpts[k][i].row; this_mv.as_mv.col = bc + next_chkpts[k][i].col; - CHECK_POINT; + CHECK_POINT this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) + this_mv.as_mv.col; thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride); - CHECK_BETTER; + CHECK_BETTER } } @@ -977,7 +977,7 @@ int vp8_hex_search(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, cal_neighbors: for (j = 0; j < dia_range; ++j) { best_site = -1; - CHECK_BOUNDS(1); + CHECK_BOUNDS(1) if (all_in) { for (i = 0; i < 4; ++i) { @@ -986,17 +986,17 @@ cal_neighbors: this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) + this_mv.as_mv.col; thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride); - CHECK_BETTER; + CHECK_BETTER } } else { for (i = 0; i < 4; ++i) { this_mv.as_mv.row = br + neighbors[i].row; this_mv.as_mv.col = bc + neighbors[i].col; - CHECK_POINT; + CHECK_POINT this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) + this_mv.as_mv.col; thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride); - CHECK_BETTER; + CHECK_BETTER } } |