]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/window_func.h
Merge commit '90adbf4abf336f8042aecdf1e18fdf76a96304b1'
[ffmpeg] / libavfilter / window_func.h
index a94482c9379420bda69cdd929c4eecd74524db89..1de8f1fbdb693199f8ceaac46b91761ccb8f699e 100644 (file)
@@ -30,6 +30,7 @@ enum WindowFunc     { WFUNC_RECT, WFUNC_HANNING, WFUNC_HAMMING, WFUNC_BLACKMAN,
                       WFUNC_BHARRIS, WFUNC_BNUTTALL, WFUNC_SINE, WFUNC_NUTTALL,
                       WFUNC_BHANN, WFUNC_LANCZOS, WFUNC_GAUSS, WFUNC_TUKEY,
                       WFUNC_DOLPH, WFUNC_CAUCHY, WFUNC_PARZEN, WFUNC_POISSON,
+                      WFUNC_BOHMAN,
                       NB_WFUNC };
 
 static inline void generate_window_func(float *lut, int N, int win_func,
@@ -182,6 +183,14 @@ static inline void generate_window_func(float *lut, int N, int win_func,
         }
         *overlap = 0.75;
         break;
+    case WFUNC_BOHMAN:
+        for (n = 0; n < N; n++) {
+            double x = 2 * ((n / (double)(N - 1))) - 1.;
+
+            lut[n] = (1 - fabs(x)) * cos(M_PI*fabs(x)) + 1./M_PI*sin(M_PI*fabs(x));
+        }
+        *overlap = 0.75;
+        break;
     default:
         av_assert0(0);
     }