[FFmpeg-cvslog] yadif: add parens around macro parameters

Mans Rullgard git
Tue Mar 8 02:43:28 CET 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Thu Feb 24 21:25:53 2011 +0000| [49e617f9565b6528fe707bae7ea4b62b10c771a5] | committer: Michael Niedermayer

yadif: add parens around macro parameters

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>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49e617f9565b6528fe707bae7ea4b62b10c771a5
---

 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 26bae0e..04b03ad 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[mrefs+1] - cur[prefs+1]) - 1;
 
 #define CHECK(j)\
-    {   int score = FFABS(cur[mrefs-1+j] - cur[prefs-1-j])\
-                  + FFABS(cur[mrefs  +j] - cur[prefs  -j])\
-                  + FFABS(cur[mrefs+1+j] - cur[prefs+1-j]);\
+    {   int score = FFABS(cur[mrefs-1+(j)] - cur[prefs-1-(j)])\
+                  + FFABS(cur[mrefs  +(j)] - cur[prefs  -(j)])\
+                  + FFABS(cur[mrefs+1+(j)] - cur[prefs+1-(j)]);\
         if (score < spatial_score) {\
             spatial_score= score;\
-            spatial_pred= (cur[mrefs  +j] + cur[prefs  -j])>>1;\
+            spatial_pred= (cur[mrefs  +(j)] + cur[prefs  -(j)])>>1;\
 
         CHECK(-1) CHECK(-2) }} }}
         CHECK( 1) CHECK( 2) }} }}




More information about the ffmpeg-cvslog mailing list