lavfi/vf_cropdetect: replace round by lrint
[ffmpeg.git] / libavfilter / avf_showfreqs.c
index 0f2ae22..3ed0155 100644 (file)
@@ -163,7 +163,7 @@ static void generate_window_func(float *lut, int N, int win_func, float *overlap
         break;
     case WFUNC_BARTLETT:
         for (n = 0; n < N; n++)
-            lut[n] = 1.-FFABS((n-(N-1)/2.)/((N-1)/2.));
+            lut[n] = 1.-fabs((n-(N-1)/2.)/((N-1)/2.));
         *overlap = 0.5;
         break;
     case WFUNC_HANNING:
@@ -207,7 +207,7 @@ static void generate_window_func(float *lut, int N, int win_func, float *overlap
         break;
     case WFUNC_BHANN:
         for (n = 0; n < N; n++)
-            lut[n] = 0.62-0.48*FFABS(n/(double)(N-1)-.5)-0.38*cos(2*M_PI*n/(N-1));
+            lut[n] = 0.62-0.48*fabs(n/(double)(N-1)-.5)-0.38*cos(2*M_PI*n/(N-1));
         *overlap = 0.5;
         break;
     case WFUNC_SINE:
@@ -227,8 +227,9 @@ static void generate_window_func(float *lut, int N, int win_func, float *overlap
         *overlap = 0.75;
         break;
     case WFUNC_GAUSS:
+#define SQR(x) ((x)*(x))
         for (n = 0; n < N; n++)
-            lut[n] = pow(M_E,-0.5*pow((n-(N-1)/2)/(0.4*(N-1)/2.f),2));
+            lut[n] = exp(-0.5 * SQR((n-(N-1)/2)/(0.4*(N-1)/2.f)));
         *overlap = 0.75;
         break;
     default: