From 14c0991fb96413193ddb197cbcc8e84b82763b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Stadler?= Date: Mon, 12 Nov 2007 21:07:31 +0000 Subject: [PATCH] gst/replaygain/rganalysis.c: Avoid slowdown from denormals when processing near-silence input data. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message from CVS: Patch by: René Stadler * gst/replaygain/rganalysis.c: (yule_filter): Avoid slowdown from denormals when processing near-silence input data. Spotted by Gabriel Bouvigne. Fixes #494499. --- ChangeLog | 8 ++++++++ gst/replaygain/rganalysis.c | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7a0ce93c43..cc531c08c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-11-12 Sebastian Dröge + + Patch by: René Stadler + + * gst/replaygain/rganalysis.c: (yule_filter): + Avoid slowdown from denormals when processing near-silence input data. + Spotted by Gabriel Bouvigne. Fixes #494499. + 2007-11-12 Edward Hervey * gst/flv/gstflvparse.c: diff --git a/gst/replaygain/rganalysis.c b/gst/replaygain/rganalysis.c index 70fa24c50b..147eef85d3 100644 --- a/gst/replaygain/rganalysis.c +++ b/gst/replaygain/rganalysis.c @@ -246,7 +246,10 @@ static inline void yule_filter (const gfloat * input, gfloat * output, const gfloat * a, const gfloat * b) { - output[0] = input[0] * b[0] + /* 1e-10 is added below to avoid running into denormals when operating on + * near silence. */ + + output[0] = 1e-10 + input[0] * b[0] + input[-1] * b[1] - output[-1] * a[1] + input[-2] * b[2] - output[-2] * a[2] + input[-3] * b[3] - output[-3] * a[3]