Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
ff172cd3
Commit
ff172cd3
authored
Jun 11, 2022
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve fft based speed sync performance by avoiding std::vector.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
0ecc093f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
wmspeed.cc
src/wmspeed.cc
+6
-3
No files found.
src/wmspeed.cc
View file @
ff172cd3
...
...
@@ -358,13 +358,16 @@ SpeedSync::compare_bits_fft (FFTProcessor& fft_processor, BitValue *bit_values,
window
[
i
]
*=
2.0
/
window_weight
;
}
const
size_t
n_bands
=
Params
::
max_band
-
Params
::
min_band
+
1
;
float
fft_out_db
[
n_bands
*
in_data_sub
.
n_channels
()];
for
(
auto
si
=
sync_bits
.
begin
();
si
!=
sync_bits
.
end
();
si
++
)
{
int
pos
=
((
offset
/
steps_per_frame
)
+
si
->
frame
)
*
sub_frame_size
*
relative_speed_inv
;
if
(
pos
>=
0
&&
size_t
(
pos
+
sub_frame_size
)
<
in_data_sub
.
n_frames
())
{
vector
<
float
>
fft_out_db
;
int
out_db_index
=
0
;
for
(
int
ch
=
0
;
ch
<
in_data_sub
.
n_channels
();
ch
++
)
{
...
...
@@ -378,7 +381,7 @@ SpeedSync::compare_bits_fft (FFTProcessor& fft_processor, BitValue *bit_values,
{
const
float
min_db
=
-
96
;
fft_out_db
.
push_back
(
db_from_complex
(
out
[
i
*
2
],
out
[
i
*
2
+
1
],
min_db
)
);
fft_out_db
[
out_db_index
++
]
=
db_from_complex
(
out
[
i
*
2
],
out
[
i
*
2
+
1
],
min_db
);
}
}
auto
&
bv
=
bit_values
[
si
->
bit
];
...
...
@@ -515,7 +518,7 @@ score_smooth_find_best (const vector<SpeedSync::Score>& in_scores, double step,
double
best_speed
=
0
;
double
best_quality
=
0
;
static
constexpr
bool
debug
=
tru
e
;
static
constexpr
bool
debug
=
fals
e
;
if
(
debug
)
{
for
(
auto
s
:
scores
)
...
...
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