diff options
author | Muhammad Faiz <mfcc64@gmail.com> | 2016-10-16 05:50:47 +0700 |
---|---|---|
committer | Muhammad Faiz <mfcc64@gmail.com> | 2016-10-16 05:50:47 +0700 |
commit | 01ab60201be902eec3cc65e4b716e7f8be4c085b (patch) | |
tree | 3e87850fcb22ad5fce175bb0368a6e5a1dacabc0 | |
parent | 7c5fca15bbc65941bd6d5fdc954737686a589ca4 (diff) | |
download | ffmpeg-01ab60201be902eec3cc65e4b716e7f8be4c085b.tar.gz |
avfilter/firequalizer: add tukey window
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
-rw-r--r-- | libavfilter/af_firequalizer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/af_firequalizer.c b/libavfilter/af_firequalizer.c index 189bc03884..c7569bbdf3 100644 --- a/libavfilter/af_firequalizer.c +++ b/libavfilter/af_firequalizer.c @@ -39,6 +39,7 @@ enum WindowFunc { WFUNC_NUTTALL, WFUNC_BNUTTALL, WFUNC_BHARRIS, + WFUNC_TUKEY, NB_WFUNC }; @@ -107,6 +108,7 @@ static const AVOption firequalizer_options[] = { { "nuttall", "nuttall window", 0, AV_OPT_TYPE_CONST, { .i64 = WFUNC_NUTTALL }, 0, 0, FLAGS, "wfunc" }, { "bnuttall", "blackman-nuttall window", 0, AV_OPT_TYPE_CONST, { .i64 = WFUNC_BNUTTALL }, 0, 0, FLAGS, "wfunc" }, { "bharris", "blackman-harris window", 0, AV_OPT_TYPE_CONST, { .i64 = WFUNC_BHARRIS }, 0, 0, FLAGS, "wfunc" }, + { "tukey", "tukey window", 0, AV_OPT_TYPE_CONST, { .i64 = WFUNC_TUKEY }, 0, 0, FLAGS, "wfunc" }, { "fixed", "set fixed frame samples", OFFSET(fixed), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, { "multi", "set multi channels mode", OFFSET(multi), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, { "zero_phase", "set zero phase mode", OFFSET(zero_phase), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, @@ -385,6 +387,9 @@ static int generate_kernel(AVFilterContext *ctx, const char *gain, const char *g case WFUNC_BHARRIS: win = 0.35875 + 0.48829 * cos(u) + 0.14128 * cos(2*u) + 0.01168 * cos(3*u); break; + case WFUNC_TUKEY: + win = (u <= 0.5 * M_PI) ? 1.0 : (0.5 + 0.5 * cos(2*u - M_PI)); + break; default: av_assert0(0); } |