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
172ccd3a
Commit
172ccd3a
authored
May 20, 2022
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial implementation for --detect-speed-patient.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
72273517
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
8 deletions
+28
-8
audiowmark.cc
src/audiowmark.cc
+13
-5
wmcommon.cc
src/wmcommon.cc
+1
-0
wmcommon.hh
src/wmcommon.hh
+1
-0
wmget.cc
src/wmget.cc
+2
-2
wmspeed.cc
src/wmspeed.cc
+11
-1
No files found.
src/audiowmark.cc
View file @
172ccd3a
...
@@ -600,19 +600,27 @@ parse_get_options (ArgParser& ap)
...
@@ -600,19 +600,27 @@ parse_get_options (ArgParser& ap)
{
{
Params
::
test_no_sync
=
true
;
Params
::
test_no_sync
=
true
;
}
}
int
speed_options
=
0
;
if
(
ap
.
parse_opt
(
"--detect-speed"
))
if
(
ap
.
parse_opt
(
"--detect-speed"
))
{
{
Params
::
detect_speed
=
true
;
Params
::
detect_speed
=
true
;
speed_options
++
;
}
if
(
ap
.
parse_opt
(
"--detect-speed-patient"
))
{
Params
::
detect_speed_patient
=
true
;
speed_options
++
;
}
}
if
(
ap
.
parse_opt
(
"--try-speed"
,
f
))
if
(
ap
.
parse_opt
(
"--try-speed"
,
f
))
{
{
if
(
Params
::
detect_speed
)
speed_options
++
;
{
error
(
"audiowmark: can not use both options: --detect-speed and --try-speed
\n
"
);
exit
(
1
);
}
Params
::
try_speed
=
f
;
Params
::
try_speed
=
f
;
}
}
if
(
speed_options
>
1
)
{
error
(
"audiowmark: can only use one option: --detect-speed or --detect-speed-patient or --try-speed
\n
"
);
exit
(
1
);
}
if
(
ap
.
parse_opt
(
"--test-speed"
,
f
))
if
(
ap
.
parse_opt
(
"--test-speed"
,
f
))
{
{
Params
::
test_speed
=
f
;
Params
::
test_speed
=
f
;
...
...
src/wmcommon.cc
View file @
172ccd3a
...
@@ -27,6 +27,7 @@ bool Params::hard = false; // hard decode bits? (soft decoding is b
...
@@ -27,6 +27,7 @@ bool Params::hard = false; // hard decode bits? (soft decoding is b
bool
Params
::
snr
=
false
;
// compute/show snr while adding watermark
bool
Params
::
snr
=
false
;
// compute/show snr while adding watermark
bool
Params
::
strict
=
false
;
bool
Params
::
strict
=
false
;
bool
Params
::
detect_speed
=
false
;
bool
Params
::
detect_speed
=
false
;
bool
Params
::
detect_speed_patient
=
false
;
double
Params
::
try_speed
=
-
1
;
double
Params
::
try_speed
=
-
1
;
double
Params
::
test_speed
=
-
1
;
double
Params
::
test_speed
=
-
1
;
int
Params
::
have_key
=
0
;
int
Params
::
have_key
=
0
;
...
...
src/wmcommon.hh
View file @
172ccd3a
...
@@ -48,6 +48,7 @@ public:
...
@@ -48,6 +48,7 @@ public:
static
int
have_key
;
static
int
have_key
;
static
bool
detect_speed
;
static
bool
detect_speed
;
static
bool
detect_speed_patient
;
static
double
try_speed
;
// manual speed correction
static
double
try_speed
;
// manual speed correction
static
double
test_speed
;
// for debugging --detect-speed
static
double
test_speed
;
// for debugging --detect-speed
...
...
src/wmget.cc
View file @
172ccd3a
...
@@ -601,9 +601,9 @@ decode_and_report (const WavData& wav_data, const string& orig_pattern)
...
@@ -601,9 +601,9 @@ decode_and_report (const WavData& wav_data, const string& orig_pattern)
* The reason to do it this way is that the detected speed may be wrong (on short clips)
* The reason to do it this way is that the detected speed may be wrong (on short clips)
* and we don't want to loose a successful clip decoder match in this case.
* and we don't want to loose a successful clip decoder match in this case.
*/
*/
if
(
Params
::
detect_speed
||
Params
::
try_speed
>
0
)
if
(
Params
::
detect_speed
||
Params
::
detect_speed_patient
||
Params
::
try_speed
>
0
)
{
{
if
(
Params
::
detect_speed
)
if
(
Params
::
detect_speed
||
Params
::
detect_speed_patient
)
speed
=
detect_speed
(
wav_data
,
!
orig_pattern
.
empty
());
speed
=
detect_speed
(
wav_data
,
!
orig_pattern
.
empty
());
else
else
speed
=
Params
::
try_speed
;
speed
=
Params
::
try_speed
;
...
...
src/wmspeed.cc
View file @
172ccd3a
...
@@ -589,6 +589,16 @@ detect_speed (const WavData& in_data, bool print_results)
...
@@ -589,6 +589,16 @@ detect_speed (const WavData& in_data, bool print_results)
.
n_center_steps
=
28
,
.
n_center_steps
=
28
,
.
interpolate
=
true
.
interpolate
=
true
};
};
const
SpeedScanParams
scan1_patient
{
.
seconds
=
50
,
/* step / n_steps / n_center_steps settings: speed approximately 0.8..1.25 */
.
step
=
1.00035
,
.
n_steps
=
11
,
.
n_center_steps
=
28
,
.
interpolate
=
true
};
const
int
clip_candidates
=
5
;
const
int
clip_candidates
=
5
;
const
double
clip_location
=
get_best_clip_location
(
in_data
,
scan1
.
seconds
,
clip_candidates
);
const
double
clip_location
=
get_best_clip_location
(
in_data
,
scan1
.
seconds
,
clip_candidates
);
...
@@ -612,6 +622,6 @@ detect_speed (const WavData& in_data, bool print_results)
...
@@ -612,6 +622,6 @@ detect_speed (const WavData& in_data, bool print_results)
.
interpolate
=
false
.
interpolate
=
false
};
};
double
speed
=
speed_scan
(
thread_pool
,
clip_location
,
in_data
,
scan1
,
scan2
,
scan3
,
/* start speed */
1.0
,
print_results
);
double
speed
=
speed_scan
(
thread_pool
,
clip_location
,
in_data
,
Params
::
detect_speed_patient
?
scan1_patient
:
scan1
,
scan2
,
scan3
,
/* start speed */
1.0
,
print_results
);
return
speed
;
return
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