diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-10-20 13:32:25 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-10-20 13:51:38 +0200 |
commit | 6d59d69bb05f52e7833266bd41dee13a5d285b0e (patch) | |
tree | 7ffca25a898986ad5f0df675731c3969ce3d24c6 /libavfilter | |
parent | fe2be5d9ce528b3894e1e04dc5f936772508be6b (diff) | |
download | ffmpeg-6d59d69bb05f52e7833266bd41dee13a5d285b0e.tar.gz |
avfilter/af_crossfeed: use transposed II form
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_crossfeed.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libavfilter/af_crossfeed.c b/libavfilter/af_crossfeed.c index 70dd26eb28..fb0a49ec87 100644 --- a/libavfilter/af_crossfeed.c +++ b/libavfilter/af_crossfeed.c @@ -35,8 +35,7 @@ typedef struct CrossfeedContext { double a0, a1, a2; double b0, b1, b2; - double i1, i2; - double o1, o2; + double w1, w2; } CrossfeedContext; static int query_formats(AVFilterContext *ctx) @@ -92,8 +91,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) const double b0 = s->b0; const double b1 = s->b1; const double b2 = s->b2; - const double a1 = s->a1; - const double a2 = s->a2; + const double a1 = -s->a1; + const double a2 = -s->a2; AVFrame *out; double *dst; int n; @@ -113,12 +112,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) for (n = 0; n < out->nb_samples; n++, src += 2, dst += 2) { double mid = (src[0] + src[1]) * level_in * .5; double side = (src[0] - src[1]) * level_in * .5; - double oside = side * b0 + s->i1 * b1 + s->i2 * b2 - s->o1 * a1 - s->o2 * a2; + double oside = side * b0 + s->w1; - s->i2 = s->i1; - s->i1 = side; - s->o2 = s->o1; - s->o1 = oside; + s->w1 = b1 * side + s->w2 + a1 * oside; + s->w2 = b2 * side + a2 * oside; if (ctx->is_disabled) { dst[0] = src[0]; |