Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
6f7b2c43
Commit
6f7b2c43
authored
Aug 13, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
param_eq: single precision math
parent
0896977b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
modules/audio_filter/param_eq.c
modules/audio_filter/param_eq.c
+19
-19
No files found.
modules/audio_filter/param_eq.c
View file @
6f7b2c43
...
...
@@ -200,15 +200,15 @@ static void CalcPeakEQCoeffs( float f0, float Q, float gainDB, float Fs,
if
(
gainDB
<
-
40
)
gainDB
=
-
40
;
if
(
gainDB
>
40
)
gainDB
=
40
;
A
=
pow
(
10
,
gainDB
/
40
);
w0
=
2
*
3
.
141593
f
*
f0
/
Fs
;
alpha
=
sin
(
w0
)
/
(
2
*
Q
);
A
=
pow
f
(
10
,
gainDB
/
40
);
w0
=
2
*
((
float
)
M_PI
)
*
f0
/
Fs
;
alpha
=
sin
f
(
w0
)
/
(
2
*
Q
);
b0
=
1
+
alpha
*
A
;
b1
=
-
2
*
cos
(
w0
);
b1
=
-
2
*
cos
f
(
w0
);
b2
=
1
-
alpha
*
A
;
a0
=
1
+
alpha
/
A
;
a1
=
-
2
*
cos
(
w0
);
a1
=
-
2
*
cos
f
(
w0
);
a2
=
1
-
alpha
/
A
;
// Store values to coeffs and normalize by 1/a0
...
...
@@ -244,27 +244,27 @@ static void CalcShelfEQCoeffs( float f0, float slope, float gainDB, int high,
if
(
gainDB
<
-
40
)
gainDB
=
-
40
;
if
(
gainDB
>
40
)
gainDB
=
40
;
A
=
pow
(
10
,
gainDB
/
40
);
A
=
pow
f
(
10
,
gainDB
/
40
);
w0
=
2
*
3
.
141593
f
*
f0
/
Fs
;
alpha
=
sin
(
w0
)
/
2
*
sqrt
(
(
A
+
1
/
A
)
*
(
1
/
slope
-
1
)
+
2
);
alpha
=
sin
f
(
w0
)
/
2
*
sqrtf
(
(
A
+
1
/
A
)
*
(
1
/
slope
-
1
)
+
2
);
if
(
high
)
{
b0
=
A
*
(
(
A
+
1
)
+
(
A
-
1
)
*
cos
(
w0
)
+
2
*
sqrt
(
A
)
*
alpha
);
b1
=
-
2
*
A
*
(
(
A
-
1
)
+
(
A
+
1
)
*
cos
(
w0
)
);
b2
=
A
*
(
(
A
+
1
)
+
(
A
-
1
)
*
cos
(
w0
)
-
2
*
sqrt
(
A
)
*
alpha
);
a0
=
(
A
+
1
)
-
(
A
-
1
)
*
cos
(
w0
)
+
2
*
sqrt
(
A
)
*
alpha
;
a1
=
2
*
(
(
A
-
1
)
-
(
A
+
1
)
*
cos
(
w0
)
);
a2
=
(
A
+
1
)
-
(
A
-
1
)
*
cos
(
w0
)
-
2
*
sqrt
(
A
)
*
alpha
;
b0
=
A
*
(
(
A
+
1
)
+
(
A
-
1
)
*
cos
f
(
w0
)
+
2
*
sqrtf
(
A
)
*
alpha
);
b1
=
-
2
*
A
*
(
(
A
-
1
)
+
(
A
+
1
)
*
cos
f
(
w0
)
);
b2
=
A
*
(
(
A
+
1
)
+
(
A
-
1
)
*
cos
f
(
w0
)
-
2
*
sqrtf
(
A
)
*
alpha
);
a0
=
(
A
+
1
)
-
(
A
-
1
)
*
cos
f
(
w0
)
+
2
*
sqrtf
(
A
)
*
alpha
;
a1
=
2
*
(
(
A
-
1
)
-
(
A
+
1
)
*
cos
f
(
w0
)
);
a2
=
(
A
+
1
)
-
(
A
-
1
)
*
cos
f
(
w0
)
-
2
*
sqrtf
(
A
)
*
alpha
;
}
else
{
b0
=
A
*
(
(
A
+
1
)
-
(
A
-
1
)
*
cos
(
w0
)
+
2
*
sqrt
(
A
)
*
alpha
);
b1
=
2
*
A
*
(
(
A
-
1
)
-
(
A
+
1
)
*
cos
(
w0
));
b2
=
A
*
(
(
A
+
1
)
-
(
A
-
1
)
*
cos
(
w0
)
-
2
*
sqrt
(
A
)
*
alpha
);
a0
=
(
A
+
1
)
+
(
A
-
1
)
*
cos
(
w0
)
+
2
*
sqrt
(
A
)
*
alpha
;
a1
=
-
2
*
(
(
A
-
1
)
+
(
A
+
1
)
*
cos
(
w0
));
a2
=
(
A
+
1
)
+
(
A
-
1
)
*
cos
(
w0
)
-
2
*
sqrt
(
A
)
*
alpha
;
b0
=
A
*
(
(
A
+
1
)
-
(
A
-
1
)
*
cos
f
(
w0
)
+
2
*
sqrtf
(
A
)
*
alpha
);
b1
=
2
*
A
*
(
(
A
-
1
)
-
(
A
+
1
)
*
cos
f
(
w0
));
b2
=
A
*
(
(
A
+
1
)
-
(
A
-
1
)
*
cos
f
(
w0
)
-
2
*
sqrtf
(
A
)
*
alpha
);
a0
=
(
A
+
1
)
+
(
A
-
1
)
*
cos
f
(
w0
)
+
2
*
sqrtf
(
A
)
*
alpha
;
a1
=
-
2
*
(
(
A
-
1
)
+
(
A
+
1
)
*
cos
f
(
w0
));
a2
=
(
A
+
1
)
+
(
A
-
1
)
*
cos
f
(
w0
)
-
2
*
sqrtf
(
A
)
*
alpha
;
}
// Store values to coeffs and normalize by 1/a0
coeffs
[
0
]
=
b0
/
a0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment