Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
fa2c1eab
Commit
fa2c1eab
authored
Dec 16, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_sofalizer: use SIMD in compensate_volume()
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
a2f2abc8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
af_sofalizer.c
libavfilter/af_sofalizer.c
+8
-6
No files found.
libavfilter/af_sofalizer.c
View file @
fa2c1eab
...
...
@@ -567,7 +567,7 @@ static int compensate_volume(AVFilterContext *ctx)
float
compensate
;
float
energy
=
0
;
float
*
ir
;
int
m
,
j
;
int
m
;
if
(
s
->
sofa
.
ncid
)
{
/* find IR at front center position in the SOFA file (IR closest to 0°,0°,1m) */
...
...
@@ -575,15 +575,17 @@ static int compensate_volume(AVFilterContext *ctx)
m
=
find_m
(
s
,
0
,
0
,
1
);
/* get energy of that IR and compensate volume */
ir
=
sofa
->
data_ir
+
2
*
m
*
sofa
->
n_samples
;
for
(
j
=
0
;
j
<
sofa
->
n_samples
;
j
++
)
{
energy
+=
*
(
ir
+
j
)
*
*
(
ir
+
j
);
if
(
sofa
->
n_samples
&
31
)
{
energy
=
avpriv_scalarproduct_float_c
(
ir
,
ir
,
sofa
->
n_samples
);
}
else
{
energy
=
s
->
fdsp
->
scalarproduct_float
(
ir
,
ir
,
sofa
->
n_samples
);
}
compensate
=
256
/
(
sofa
->
n_samples
*
sqrt
(
energy
));
av_log
(
ctx
,
AV_LOG_DEBUG
,
"Compensate-factor: %f
\n
"
,
compensate
);
ir
=
sofa
->
data_ir
;
for
(
j
=
0
;
j
<
sofa
->
n_samples
*
sofa
->
m_dim
*
2
;
j
++
)
{
ir
[
j
]
*=
compensate
;
/* apply volume compensation to IRs */
}
/* apply volume compensation to IRs */
s
->
fdsp
->
vector_fmul_scalar
(
ir
,
ir
,
compensate
,
sofa
->
n_samples
*
sofa
->
m_dim
*
2
);
emms_c
();
}
return
0
;
...
...
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