[FFmpeg-devel] [PATCH] yadif: add parens around macro parameters

Mans Rullgard mans
Wed Mar 2 18:23:29 CET 2011


This fixes compilation with preprocessors which do not add whitespace
around replaced tokens, resulting in invalid expressions like 1--1.

Signed-off-by: Mans Rullgard <mans at mansr.com>
---
 libavfilter/vf_yadif.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index bd0a9de..f81ee8a 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -73,12 +73,12 @@ static void filter_line_c(uint8_t *dst,
                           + FFABS(cur[-refs+1] - cur[+refs+1]) - 1;
 
 #define CHECK(j)\
-    {   int score = FFABS(cur[-refs-1+j] - cur[+refs-1-j])\
-                  + FFABS(cur[-refs  +j] - cur[+refs  -j])\
-                  + FFABS(cur[-refs+1+j] - cur[+refs+1-j]);\
+    {   int score = FFABS(cur[-refs-1+(j)] - cur[+refs-1-(j)])\
+                  + FFABS(cur[-refs  +(j)] - cur[+refs  -(j)])\
+                  + FFABS(cur[-refs+1+(j)] - cur[+refs+1-(j)]);\
         if (score < spatial_score) {\
             spatial_score= score;\
-            spatial_pred= (cur[-refs  +j] + cur[+refs  -j])>>1;\
+            spatial_pred= (cur[-refs  +(j)] + cur[+refs  -(j)])>>1;\
 
         CHECK(-1) CHECK(-2) }} }}
         CHECK( 1) CHECK( 2) }} }}
-- 
1.7.4.1




More information about the ffmpeg-devel mailing list