29 #define INTERPOLATION_LINEAR 0
30 #define INTERPOLATION_QUADRATIC 1
52 #define OFFSET(x) offsetof(FlangerContext, x)
53 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
58 {
"regen",
"percentage regeneration (delayed signal feedback)",
OFFSET(feedback_gain),
AV_OPT_TYPE_DOUBLE, {.dbl=0}, -95, 95,
A },
59 {
"width",
"percentage of delayed signal mixed with original",
OFFSET(delay_gain),
AV_OPT_TYPE_DOUBLE, {.dbl=71}, 0, 100,
A },
66 {
"phase",
"swept wave percentage phase-shift for multi-channel",
OFFSET(channel_phase),
AV_OPT_TYPE_DOUBLE, {.dbl=25}, 0, 100,
A },
67 {
"interp",
"delay-line interpolation",
OFFSET(interpolation),
AV_OPT_TYPE_INT, {.i64=0}, 0, 1,
A,
"itype" },
161 double delayed_0, delayed_1;
166 int int_delay = (
int)delay;
167 double frac_delay = modf(delay, &delay);
177 delayed = delayed_0 + (delayed_1 - delayed_0) * frac_delay;
181 delayed_2 -= delayed_0;
182 delayed_1 -= delayed_0;
183 a = delayed_2 * .5 - delayed_1;
184 b = delayed_1 * 2 - delayed_2 *.5;
185 delayed = delayed_0 + (a * frac_delay + b) * frac_delay;
195 if (frame != out_frame)
236 .priv_class = &flanger_class,