From aa04b6f9a7475e9d9457dfc5bf441faf15efc466 Mon Sep 17 00:00:00 2001 From: Jerome Jiang Date: Tue, 19 Mar 2019 17:16:41 -0700 Subject: Wrap macro definition in do-while(0) Change-Id: Id654a48d2fa40355552d7267e58461e6cc1c6998 --- vp9/encoder/mips/msa/vp9_fdct_msa.h | 8 +++---- vp9/encoder/vp9_mcomp.c | 44 ++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 26 deletions(-) (limited to 'vp9/encoder') diff --git a/vp9/encoder/mips/msa/vp9_fdct_msa.h b/vp9/encoder/mips/msa/vp9_fdct_msa.h index fa1af2fc5..564c879fb 100644 --- a/vp9/encoder/mips/msa/vp9_fdct_msa.h +++ b/vp9/encoder/mips/msa/vp9_fdct_msa.h @@ -17,7 +17,7 @@ #define VP9_ADST8(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, \ out3, out4, out5, out6, out7) \ - { \ + do { \ v8i16 cnst0_m, cnst1_m, cnst2_m, cnst3_m, cnst4_m; \ v8i16 vec0_m, vec1_m, vec2_m, vec3_m, s0_m, s1_m; \ v8i16 coeff0_m = { cospi_2_64, cospi_6_64, cospi_10_64, cospi_14_64, \ @@ -77,10 +77,10 @@ out1 = -out1; \ out3 = -out3; \ out5 = -out5; \ - } + } while (0) #define VP9_FADST4(in0, in1, in2, in3, out0, out1, out2, out3) \ - { \ + do { \ v4i32 s0_m, s1_m, s2_m, s3_m, constant_m; \ v4i32 in0_r_m, in1_r_m, in2_r_m, in3_r_m; \ \ @@ -112,5 +112,5 @@ SRARI_W4_SW(in0_r_m, in1_r_m, s2_m, s3_m, DCT_CONST_BITS); \ PCKEV_H4_SH(in0_r_m, in0_r_m, in1_r_m, in1_r_m, s2_m, s2_m, s3_m, s3_m, \ out0, out1, out2, out3); \ - } + } while (0) #endif // VPX_VP9_ENCODER_MIPS_MSA_VP9_FDCT_MSA_H_ diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c index b82cbcdaa..09c5532b3 100644 --- a/vp9/encoder/vp9_mcomp.c +++ b/vp9/encoder/vp9_mcomp.c @@ -211,7 +211,7 @@ static INLINE const uint8_t *pre(const uint8_t *buf, int stride, int r, int c) { #endif #define FIRST_LEVEL_CHECKS \ - { \ + do { \ unsigned int left, right, up, down, diag; \ CHECK_BETTER(left, tr, tc - hstep); \ CHECK_BETTER(right, tr, tc + hstep); \ @@ -224,10 +224,10 @@ static INLINE const uint8_t *pre(const uint8_t *buf, int stride, int r, int c) { case 2: CHECK_BETTER(diag, tr + hstep, tc - hstep); break; \ case 3: CHECK_BETTER(diag, tr + hstep, tc + hstep); break; \ } \ - } + } while (0) #define SECOND_LEVEL_CHECKS \ - { \ + do { \ int kr, kc; \ unsigned int second; \ if (tr != br && tc != bc) { \ @@ -256,7 +256,7 @@ static INLINE const uint8_t *pre(const uint8_t *buf, int stride, int r, int c) { case 3: CHECK_BETTER(second, tr + kr, tc - hstep); break; \ } \ } \ - } + } while (0) #define SETUP_SUBPEL_SEARCH \ const uint8_t *const z = x->plane[0].src.buf; \ @@ -946,7 +946,7 @@ static INLINE int is_mv_in(const MvLimits *mv_limits, const MV *mv) { } #define CHECK_BETTER \ - { \ + do { \ if (thissad < bestsad) { \ if (use_mvcost) \ thissad += mvsad_err_cost(x, &this_mv, &fcenter_mv, sad_per_bit); \ @@ -955,7 +955,7 @@ static INLINE int is_mv_in(const MvLimits *mv_limits, const MV *mv) { best_site = i; \ } \ } \ - } + } while (0) #define MAX_PATTERN_SCALES 11 #define MAX_PATTERN_CANDIDATES 8 // max number of canddiates per scale @@ -1056,7 +1056,7 @@ static int vp9_pattern_search( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } else { for (i = 0; i < num_candidates[t]; i++) { @@ -1066,7 +1066,7 @@ static int vp9_pattern_search( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } if (best_site == -1) { @@ -1098,7 +1098,7 @@ static int vp9_pattern_search( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } else { for (i = 0; i < num_candidates[s]; i++) { @@ -1108,7 +1108,7 @@ static int vp9_pattern_search( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } @@ -1137,7 +1137,7 @@ static int vp9_pattern_search( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } else { for (i = 0; i < PATTERN_CANDIDATES_REF; i++) { @@ -1149,7 +1149,7 @@ static int vp9_pattern_search( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } @@ -1230,7 +1230,7 @@ static int vp9_pattern_search_sad( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } else { for (i = 0; i < num_candidates[t]; i++) { @@ -1240,7 +1240,7 @@ static int vp9_pattern_search_sad( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } if (best_site == -1) { @@ -1272,7 +1272,7 @@ static int vp9_pattern_search_sad( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } else { for (i = 0; i < num_candidates[s]; i++) { @@ -1282,7 +1282,7 @@ static int vp9_pattern_search_sad( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } @@ -1311,7 +1311,7 @@ static int vp9_pattern_search_sad( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } else { for (i = 0; i < PATTERN_CANDIDATES_REF; i++) { @@ -1323,7 +1323,7 @@ static int vp9_pattern_search_sad( thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } @@ -1346,7 +1346,7 @@ static int vp9_pattern_search_sad( cost_list[i + 1] = thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } else { for (i = 0; i < num_candidates[s]; i++) { @@ -1356,7 +1356,7 @@ static int vp9_pattern_search_sad( cost_list[i + 1] = thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } @@ -1385,7 +1385,7 @@ static int vp9_pattern_search_sad( cost_list[next_chkpts_indices[i] + 1] = thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } else { for (i = 0; i < PATTERN_CANDIDATES_REF; i++) { @@ -1400,7 +1400,7 @@ static int vp9_pattern_search_sad( cost_list[next_chkpts_indices[i] + 1] = thissad = vfp->sdf(what->buf, what->stride, get_buf_from_mv(in_what, &this_mv), in_what->stride); - CHECK_BETTER + CHECK_BETTER; } } -- cgit v1.2.3