Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
Opus
Commits
aa32042a
Commit
aa32042a
authored
8 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Slightly increase the safety margin for opus_pcm_soft_clip()
No values outside of +/-1 detected now.
parent
bca70b87
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/opus.c
+2
-2
2 additions, 2 deletions
src/opus.c
with
2 additions
and
2 deletions
src/opus.c
+
2
−
2
View file @
aa32042a
...
...
@@ -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^-2
4
. This is just enough to ensure -ffast-math
/* Slightly boost "a" by 2^-2
2
. 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
*
6
e-
8
;
a
+=
a
*
2.4
e-
7
;
if
(
x
[
i
*
C
]
>
0
)
a
=
-
a
;
/* Apply soft clipping */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment