summaryrefslogtreecommitdiff
path: root/libavfilter/window_func.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/window_func.h')
-rw-r--r--libavfilter/window_func.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavfilter/window_func.h b/libavfilter/window_func.h
index a94482c937..1de8f1fbdb 100644
--- a/libavfilter/window_func.h
+++ b/libavfilter/window_func.h
@@ -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);
}