[FFmpeg-devel] [PATCH 5/5] Remove PI definition and use M_PI instead.

Stefano Sabatini stefano.sabatini-lala
Tue May 18 23:58:59 CEST 2010


M_PI is defined by the included file libavutil/avutil.h.
---
 swscale.c |    6 ------
 utils.c   |    2 +-
 2 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/swscale.c b/swscale.c
index 5bdcaa5..2187da8 100644
--- a/swscale.c
+++ b/swscale.c
@@ -77,12 +77,6 @@ untested special converters
 
 #define FAST_BGR2YV12 // use 7 bit coefficients instead of 15 bit
 
-#ifdef M_PI
-#define PI M_PI
-#else
-#define PI 3.14159265358979323846
-#endif
-
 #define isPacked(x)         (       \
            (x)==PIX_FMT_PAL8        \
         || (x)==PIX_FMT_YUYV422     \
diff --git a/utils.c b/utils.c
index 9683c1f..5fafb0c 100644
--- a/utils.c
+++ b/utils.c
@@ -300,7 +300,7 @@ static int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSi
                 }
 /*                else if (flags & SWS_X) {
                     double p= param ? param*0.01 : 0.3;
-                    coeff = d ? sin(d*PI)/(d*PI) : 1.0;
+                    coeff = d ? sin(d*M_PI)/(d*M_PI) : 1.0;
                     coeff*= pow(2.0, - p*d*d);
                 }*/
                 else if (flags & SWS_X) {
-- 
1.7.0




More information about the ffmpeg-devel mailing list