[FFmpeg-cvslog] avfilter/af_crossfeed: use transposed II form

Paul B Mahol git at videolan.org
Tue Oct 20 14:52:26 EEST 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Oct 20 13:32:25 2020 +0200| [6d59d69bb05f52e7833266bd41dee13a5d285b0e] | committer: Paul B Mahol

avfilter/af_crossfeed: use transposed II form

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6d59d69bb05f52e7833266bd41dee13a5d285b0e
---

 libavfilter/af_crossfeed.c | 15 ++++++---------
 1 file 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];



More information about the ffmpeg-cvslog mailing list