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
92ed9316
Commit
92ed9316
authored
Dec 26, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_sofalizer: fix regression after
7ea4b928
parent
60e9007b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
af_sofalizer.c
libavfilter/af_sofalizer.c
+7
-7
No files found.
libavfilter/af_sofalizer.c
View file @
92ed9316
...
...
@@ -395,12 +395,12 @@ static int sofalizer_convolute(AVFilterContext *ctx, void *arg, int jobnr, int n
/* current read position in ringbuffer: input sample write position
* - delay for l-th ch. + diff. betw. IR length and buffer length
* (mod buffer length) */
read
=
(
wr
-
delay
[
l
]
-
(
n
_samples
-
1
)
+
buffer_length
)
&
modulo
;
read
=
(
wr
-
delay
[
l
]
-
(
ir
_samples
-
1
)
+
buffer_length
)
&
modulo
;
if
(
read
+
n
_samples
<
buffer_length
)
{
memmove
(
temp_src
,
bptr
+
read
,
n
_samples
*
sizeof
(
*
temp_src
));
if
(
read
+
ir
_samples
<
buffer_length
)
{
memmove
(
temp_src
,
bptr
+
read
,
ir
_samples
*
sizeof
(
*
temp_src
));
}
else
{
int
len
=
FFMIN
(
n_samples
-
(
read
%
n
_samples
),
buffer_length
-
read
);
int
len
=
FFMIN
(
n_samples
-
(
read
%
ir
_samples
),
buffer_length
-
read
);
memmove
(
temp_src
,
bptr
+
read
,
len
*
sizeof
(
*
temp_src
));
memmove
(
temp_src
+
len
,
bptr
,
(
n_samples
-
len
)
*
sizeof
(
*
temp_src
));
...
...
@@ -436,7 +436,7 @@ static int sofalizer_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr,
FFTComplex
*
hrtf
=
s
->
data_hrtf
[
jobnr
];
/* get pointers to current HRTF data */
int
*
n_clippings
=
&
td
->
n_clippings
[
jobnr
];
float
*
ringbuffer
=
td
->
ringbuffer
[
jobnr
];
const
int
n_samples
=
s
->
sofa
.
n
_samples
;
/* length of one IR */
const
int
ir_samples
=
s
->
sofa
.
ir
_samples
;
/* length of one IR */
const
int
planar
=
in
->
format
==
AV_SAMPLE_FMT_FLTP
;
const
int
mult
=
1
+
!
planar
;
float
*
dst
=
(
float
*
)
out
->
extended_data
[
jobnr
*
planar
];
/* get pointer to audio output buffer */
...
...
@@ -462,7 +462,7 @@ static int sofalizer_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr,
/* find minimum between number of samples and output buffer length:
* (important, if one IR is longer than the output buffer) */
n_read
=
FFMIN
(
s
->
sofa
.
n
_samples
,
in
->
nb_samples
);
n_read
=
FFMIN
(
ir
_samples
,
in
->
nb_samples
);
for
(
j
=
0
;
j
<
n_read
;
j
++
)
{
/* initialize output buf with saved signal from overflow buf */
dst
[
mult
*
j
]
=
ringbuffer
[
wr
];
...
...
@@ -543,7 +543,7 @@ static int sofalizer_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr,
dst
[
mult
*
j
]
+=
fft_acc
[
j
].
re
*
fft_scale
;
}
for
(
j
=
0
;
j
<
n
_samples
-
1
;
j
++
)
{
/* overflow length is IR length - 1 */
for
(
j
=
0
;
j
<
ir
_samples
-
1
;
j
++
)
{
/* overflow length is IR length - 1 */
/* write the rest of output signal to overflow buffer */
int
write_pos
=
(
wr
+
j
)
&
modulo
;
...
...
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