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
1d31e57e
Commit
1d31e57e
authored
Jan 27, 2024
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BlockDecoder: use mix_or_linear_decode from ClipDecoder as well
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
8026697a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
wmget.cc
src/wmget.cc
+10
-17
No files found.
src/wmget.cc
View file @
1d31e57e
...
...
@@ -134,6 +134,15 @@ linear_decode (const Key& key, vector<vector<complex<float>>>& fft_out, int n_ch
return
raw_bit_vec
;
}
static
vector
<
float
>
mix_or_linear_decode
(
const
Key
&
key
,
vector
<
vector
<
complex
<
float
>>>&
fft_out
,
int
n_channels
)
{
if
(
Params
::
mix
)
return
mix_decode
(
key
,
fft_out
,
n_channels
);
else
return
linear_decode
(
key
,
fft_out
,
n_channels
);
}
class
ResultSet
{
public
:
...
...
@@ -404,15 +413,7 @@ public:
if
(
fft_range_out
.
size
())
{
/* ---- retrieve bits from watermark ---- */
vector
<
float
>
raw_bit_vec
;
if
(
Params
::
mix
)
{
raw_bit_vec
=
mix_decode
(
key
,
fft_range_out
,
wav_data
.
n_channels
());
}
else
{
raw_bit_vec
=
linear_decode
(
key
,
fft_range_out
,
wav_data
.
n_channels
());
}
vector
<
float
>
raw_bit_vec
=
mix_or_linear_decode
(
key
,
fft_range_out
,
wav_data
.
n_channels
());
assert
(
raw_bit_vec
.
size
()
==
code_size
(
ConvBlockType
::
a
,
Params
::
payload_size
));
raw_bit_vec
=
randomize_bit_order
(
key
,
raw_bit_vec
,
/* encode */
false
);
...
...
@@ -554,14 +555,6 @@ class ClipDecoder
const
int
frames_per_block
=
0
;
const
double
speed
=
0
;
vector
<
float
>
mix_or_linear_decode
(
const
Key
&
key
,
vector
<
vector
<
complex
<
float
>>>&
fft_out
,
int
n_channels
)
{
if
(
Params
::
mix
)
return
mix_decode
(
key
,
fft_out
,
n_channels
);
else
return
linear_decode
(
key
,
fft_out
,
n_channels
);
}
void
run_padded
(
const
vector
<
Key
>&
key_list
,
const
WavData
&
wav_data
,
ResultSet
&
result_set
,
double
time_offset_sec
)
{
...
...
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