Revision 2658e7a6 libswscale/utils.c
libswscale/utils.c  

65  65  
66  66 
#define RET 0xC3 //near return opcode for x86 
67  67  
68 
#ifdef M_PI 

69 
#define PI M_PI 

70 
#else 

71 
#define PI 3.14159265358979323846 

72 
#endif 

73  
74  68 
#define isSupportedIn(x) ( \ 
75  69 
(x)==PIX_FMT_YUV420P \ 
76  70 
 (x)==PIX_FMT_YUVA420P \ 
...  ...  
299  293 
double c; 
300  294  
301  295 
if (floatd<1.0) 
302 
c = cos(floatd*PI); 

296 
c = cos(floatd*M_PI);


303  297 
else 
304  298 
c=1.0; 
305  299 
if (c<0.0) c= pow(c, A); 
...  ...  
315  309 
double p= param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0; 
316  310 
coeff = (pow(2.0,  p*floatd*floatd))*fone; 
317  311 
} else if (flags & SWS_SINC) { 
318 
coeff = (d ? sin(floatd*PI)/(floatd*PI) : 1.0)*fone;


312 
coeff = (d ? sin(floatd*M_PI)/(floatd*M_PI) : 1.0)*fone;


319  313 
} else if (flags & SWS_LANCZOS) { 
320  314 
double p= param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0; 
321 
coeff = (d ? sin(floatd*PI)*sin(floatd*PI/p)/(floatd*floatd*PI*PI/p) : 1.0)*fone;


315 
coeff = (d ? sin(floatd*M_PI)*sin(floatd*M_PI/p)/(floatd*floatd*M_PI*M_PI/p) : 1.0)*fone;


322  316 
if (floatd>p) coeff=0; 
323  317 
} else if (flags & SWS_BILINEAR) { 
324  318 
coeff= (1<<30)  d; 
...  ...  
1287  1281  
1288  1282 
for (i=0; i<length; i++) { 
1289  1283 
double dist= imiddle; 
1290 
vec>coeff[i]= exp(dist*dist/(2*variance*variance)) / sqrt(2*variance*PI); 

1284 
vec>coeff[i]= exp(dist*dist/(2*variance*variance)) / sqrt(2*variance*M_PI);


1291  1285 
} 
1292  1286  
1293  1287 
sws_normalizeVec(vec, 1.0); 
Also available in: Unified diff