diff options
author | Paul B Mahol <onemda@gmail.com> | 2018-10-27 13:13:31 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2018-10-27 13:36:00 +0200 |
commit | 40ac622460284f4aad10a13b786d03d6c2cfa868 (patch) | |
tree | 5c74fa3a5b73d209c29c044b4585570314602d46 /libavfilter/window_func.h | |
parent | 59a35fe1f63df1451dec6663dcca3451b16c662d (diff) | |
download | ffmpeg-40ac622460284f4aad10a13b786d03d6c2cfa868.tar.gz |
avfilter/window_func: add bohman window
Diffstat (limited to 'libavfilter/window_func.h')
-rw-r--r-- | libavfilter/window_func.h | 9 |
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); } |