Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2016-07-15 21:29:16 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-07-15 21:29:16 +0300
commitaa32042a50f2cbe0ff9d339948cb4712f5cc3d6e (patch)
tree3c1de6c7ab603ee614ef61276be2a162948edf9d
parentbca70b87efc40595e2bb469d63c77618872bd97b (diff)
Slightly increase the safety margin for opus_pcm_soft_clip()v1.1.3
No values outside of +/-1 detected now.
-rw-r--r--src/opus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opus.c b/src/opus.c
index 2b47cdac..f76f125c 100644
--- a/src/opus.c
+++ b/src/opus.c
@@ -104,10 +104,10 @@ OPUS_EXPORT void opus_pcm_soft_clip(float *_x, int N, int C, float *declip_mem)
/* Compute a such that maxval + a*maxval^2 = 1 */
a=(maxval-1)/(maxval*maxval);
- /* Slightly boost "a" by 2^-24. This is just enough to ensure -ffast-math
+ /* Slightly boost "a" by 2^-22. This is just enough to ensure -ffast-math
does not cause output values larger than +/-1, but small enough not
to matter even for 24-bit output. */
- a += a*6e-8;
+ a += a*2.4e-7;
if (x[i*C]>0)
a = -a;
/* Apply soft clipping */