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
1ab2561f
Commit
1ab2561f
authored
Nov 27, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid SyncFinder private API in SpeedSync class.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
dc887e1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
wmget.cc
src/wmget.cc
+14
-7
No files found.
src/wmget.cc
View file @
1ab2561f
...
...
@@ -269,13 +269,13 @@ public:
double
quality
;
ConvBlockType
block_type
;
};
public
:
struct
FrameBit
{
int
frame
;
vector
<
int
>
up
;
vector
<
int
>
down
;
};
private
:
vector
<
vector
<
FrameBit
>>
sync_bits
;
void
...
...
@@ -596,6 +596,12 @@ public:
return
sync_scores
;
}
vector
<
vector
<
FrameBit
>>
get_sync_bits
(
const
WavData
&
wav_data
,
Mode
mode
)
{
init_up_down
(
wav_data
,
mode
);
return
sync_bits
;
}
private
:
void
sync_fft
(
const
WavData
&
wav_data
,
size_t
index
,
size_t
frame_count
,
vector
<
float
>&
fft_out_db
,
vector
<
char
>&
have_frames
,
const
vector
<
char
>&
want_frames
)
...
...
@@ -1134,7 +1140,7 @@ private:
float
umag
=
0
;
float
dmag
=
0
;
};
SyncFinder
sync_finder
;
vector
<
vector
<
SyncFinder
::
FrameBit
>>
sync_bits
;
vector
<
vector
<
Mags
>>
fft_sync_bits
;
void
prepare_mags
(
const
WavData
&
in_data
,
double
center
,
double
seconds
);
Score
compare
(
double
relative_speed
,
double
center
);
...
...
@@ -1315,7 +1321,8 @@ SpeedSync::prepare_mags (const WavData& in_data, double center, double seconds)
window
[
i
]
*=
2.0
/
window_weight
;
}
sync_finder
.
init_up_down
(
in_data
,
SyncFinder
::
Mode
::
BLOCK
);
SyncFinder
sync_finder
;
sync_bits
=
sync_finder
.
get_sync_bits
(
in_data
,
SyncFinder
::
Mode
::
BLOCK
);
float
*
in
=
new_array_float
(
sub_frame_size
);
float
*
out
=
new_array_float
(
sub_frame_size
);
...
...
@@ -1345,9 +1352,9 @@ SpeedSync::prepare_mags (const WavData& in_data, double center, double seconds)
}
}
vector
<
Mags
>
mags
;
for
(
size_t
bit
=
0
;
bit
<
sync_
finder
.
sync_
bits
.
size
();
bit
++
)
for
(
size_t
bit
=
0
;
bit
<
sync_bits
.
size
();
bit
++
)
{
const
vector
<
SyncFinder
::
FrameBit
>&
frame_bits
=
sync_
finder
.
sync_
bits
[
bit
];
const
vector
<
SyncFinder
::
FrameBit
>&
frame_bits
=
sync_bits
[
bit
];
for
(
const
auto
&
frame_bit
:
frame_bits
)
{
float
umag
=
0
,
dmag
=
0
;
...
...
@@ -1383,7 +1390,7 @@ SpeedSync::compare (double relative_speed, double center)
int
bit_count
=
0
;
for
(
size_t
sync_bit
=
0
;
sync_bit
<
Params
::
sync_bits
;
sync_bit
++
)
{
const
vector
<
SyncFinder
::
FrameBit
>&
frame_bits
=
sync_
finder
.
sync_
bits
[
sync_bit
];
const
vector
<
SyncFinder
::
FrameBit
>&
frame_bits
=
sync_bits
[
sync_bit
];
float
umag
=
0
;
float
dmag
=
0
;
...
...
@@ -1428,7 +1435,7 @@ SpeedSync::compare (double relative_speed, double center)
if
(
bit_count
)
{
sync_quality
/=
bit_count
;
sync_quality
=
fabs
(
sync_finder
.
normalize_sync_quality
(
sync_quality
));
//
sync_quality = fabs (sync_finder.normalize_sync_quality (sync_quality));
//printf ("%d %f\n", offset, fabs (sync_quality));
if
(
sync_quality
>
best_score
.
quality
)
{
...
...
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