aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/me_cmp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-16 23:13:00 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-16 23:13:00 +0100
commit235782260da483bcbe0122bec846dd917e8362fb (patch)
tree92418588aca5d2ad6d649cbb396ff4ef36c17873 /libavcodec/me_cmp.c
parent17a62cbcb9ee98774797334095ed46780406752e (diff)
downloadffmpeg-235782260da483bcbe0122bec846dd917e8362fb.tar.gz
avcodec/me_cmp: add () to protect avg*s arguments
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/me_cmp.c')
-rw-r--r--libavcodec/me_cmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/me_cmp.c b/libavcodec/me_cmp.c
index cfd14abb01..d4213d2759 100644
--- a/libavcodec/me_cmp.c
+++ b/libavcodec/me_cmp.c
@@ -108,8 +108,8 @@ static int sum_abs_dctelem_c(int16_t *block)
return sum;
}
-#define avg2(a, b) ((a + b + 1) >> 1)
-#define avg4(a, b, c, d) ((a + b + c + d + 2) >> 2)
+#define avg2(a, b) (((a) + (b) + 1) >> 1)
+#define avg4(a, b, c, d) (((a) + (b) + (c) + (d) + 2) >> 2)
static inline int pix_abs16_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
ptrdiff_t stride, int h)