summaryrefslogtreecommitdiffstats
path: root/gst/replaygain
diff options
context:
space:
mode:
authorRené Stadler <mail@renestadler.de>2007-11-12 21:07:31 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2007-11-12 21:07:31 +0000
commit85ea09f1431d759eeeccc67877a3ae165272aa82 (patch)
treeda5a8517e13e9699198b0378a4cf9f5ebcec371e /gst/replaygain
parent7522192fab2995abc74061b96801da0663701771 (diff)
gst/replaygain/rganalysis.c: Avoid slowdown from denormals when processing near-silence input data.
Original commit message from CVS: Patch by: René Stadler <mail at renestadler dot de> * gst/replaygain/rganalysis.c: (yule_filter): Avoid slowdown from denormals when processing near-silence input data. Spotted by Gabriel Bouvigne. Fixes #494499.
Diffstat (limited to 'gst/replaygain')
-rw-r--r--gst/replaygain/rganalysis.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/replaygain/rganalysis.c b/gst/replaygain/rganalysis.c
index 70fa24c5..147eef85 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]