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
dc887e1c
Commit
dc887e1c
authored
Nov 27, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use better parameters to make speed detection more reliable.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
f7a21add
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
21 deletions
+7
-21
wmget.cc
src/wmget.cc
+7
-21
No files found.
src/wmget.cc
View file @
dc887e1c
...
...
@@ -1161,36 +1161,22 @@ speed_scan (const WavData& in_data)
vector
<
SpeedSync
::
Score
>
scores
;
/* n_center_steps / n_steps settings: speed approximately 0.8..1.25 */
const
int
n_center_steps
=
10
;
const
int
n_steps
=
10
;
const
double
step
=
1.00
1
;
const
int
n_center_steps
=
28
;
const
int
n_steps
=
5
;
const
double
step
=
1.00
07
;
for
(
int
c
=
-
n_center_steps
;
c
<=
n_center_steps
;
c
++
)
{
double
c_speed
=
pow
(
step
,
c
*
(
n_steps
*
2
+
1
));
SpeedSync
speed_sync
;
vector
<
SpeedSync
::
Score
>
step_scores
=
speed_sync
.
search
(
in_data
,
c_speed
,
step
,
n_steps
,
/* seconds */
15
);
vector
<
SpeedSync
::
Score
>
step_scores
=
speed_sync
.
search
(
in_data
,
c_speed
,
step
,
n_steps
,
/* seconds */
21
);
scores
.
insert
(
scores
.
end
(),
step_scores
.
begin
(),
step_scores
.
end
());
}
sort
(
scores
.
begin
(),
scores
.
end
(),
[]
(
SpeedSync
::
Score
s_a
,
SpeedSync
::
Score
s_b
)
{
return
s_a
.
quality
>
s_b
.
quality
;
});
if
(
scores
.
size
()
>
5
)
scores
.
resize
(
5
);
double
best_refined_quality
=
0.001
;
// HACK
SpeedSync
::
Score
best_s
;
best_s
.
speed
=
scores
[
0
].
speed
;
best_s
.
quality
=
scores
[
0
].
quality
;
for
(
auto
s
:
scores
)
{
double
refined_quality
=
0
;
detect_speed
(
in_data
,
s
.
speed
,
/* no step */
1
,
/* n_steps */
0
,
/* seconds */
15
,
&
refined_quality
);
if
(
refined_quality
>
best_refined_quality
)
{
best_s
=
s
;
best_refined_quality
=
refined_quality
;
}
}
// we could search the N best matches, but using the best result works well in practice
SpeedSync
::
Score
best_s
=
scores
[
0
];
printf
(
"## %f %f
\n
"
,
best_s
.
speed
,
best_s
.
quality
);
return
best_s
.
speed
;
...
...
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