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
06fb9369
Commit
06fb9369
authored
Dec 02, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the same ThreadPool instance for speed scan and speed refine.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
b916dbff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
wmspeed.cc
src/wmspeed.cc
+8
-8
No files found.
src/wmspeed.cc
View file @
06fb9369
...
...
@@ -204,7 +204,7 @@ public:
};
static
double
speed_scan
(
const
WavData
&
in_data
)
speed_scan
(
ThreadPool
&
thread_pool
,
const
WavData
&
in_data
)
{
vector
<
SpeedSync
::
Score
>
scores
;
...
...
@@ -216,7 +216,6 @@ speed_scan (const WavData& in_data)
vector
<
std
::
unique_ptr
<
SpeedSync
>>
speed_sync
;
auto
t
=
get_time
();
ThreadPool
thread_pool
;
for
(
int
c
=
-
n_center_steps
;
c
<=
n_center_steps
;
c
++
)
{
double
c_speed
=
pow
(
step
,
c
*
(
n_steps
*
2
+
1
));
...
...
@@ -483,18 +482,19 @@ detect_speed (const WavData& in_data)
WavData
in_clip_short
=
get_speed_clip
(
clip_location
,
in_data
,
21
*
1.3
);
WavData
in_clip_long
=
get_speed_clip
(
clip_location
,
in_data
,
50
*
1.3
);
ThreadPool
thread_pool
;
/* first pass: find approximation for speed */
speed
=
speed_scan
(
in_clip_short
);
speed
=
speed_scan
(
thread_pool
,
in_clip_short
);
/* second pass: fast refine (not always perfect) */
double
t
=
get_time
();
SpeedSync
speed_sync
(
in_clip_long
,
speed
,
1.00005
,
20
,
/* seconds */
50
);
ThreadPool
tp
;
speed_sync
.
prepare_job
(
tp
);
tp
.
wait_all
();
speed_sync
.
prepare_job
(
thread_pool
);
thread_pool
.
wait_all
();
speed_sync
.
search
(
t
p
);
t
p
.
wait_all
();
speed_sync
.
search
(
t
hread_pool
);
t
hread_pool
.
wait_all
();
auto
scores
=
speed_sync
.
get_scores
();
sort
(
scores
.
begin
(),
scores
.
end
(),
[]
(
SpeedSync
::
Score
s_a
,
SpeedSync
::
Score
s_b
)
{
...
...
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