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
8f45c4a8
Commit
8f45c4a8
authored
Jan 13, 2019
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report number of sync matches (against known locations) during cmp.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
fc3cc19e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
audiowmark.cc
src/audiowmark.cc
+14
-2
ber-test.sh
src/ber-test.sh
+4
-2
No files found.
src/audiowmark.cc
View file @
8f45c4a8
...
...
@@ -980,7 +980,7 @@ public:
int
decode_and_report
(
const
WavData
&
wav_data
,
const
string
&
orig_pattern
)
{
int
match_count
=
0
,
total_count
=
0
;
int
match_count
=
0
,
total_count
=
0
,
sync_match
=
0
;
SyncFinder
sync_finder
;
...
...
@@ -1023,13 +1023,25 @@ decode_and_report (const WavData& wav_data, const string& orig_pattern)
if
(
match
)
match_count
++
;
int
expect_index
=
Params
::
frames_pad_start
*
Params
::
frame_size
;
while
(
sync_score
.
index
+
Params
::
frame_size
>
expect_index
)
{
if
(
abs
(
int
(
sync_score
.
index
)
-
expect_index
)
<
Params
::
frame_size
)
sync_match
++
;
expect_index
+=
(
mark_sync_frame_count
()
+
mark_data_frame_count
())
*
Params
::
frame_size
;
}
}
total_count
++
;
}
}
if
(
!
orig_pattern
.
empty
())
printf
(
"match_count %d %d
\n
"
,
match_count
,
total_count
);
{
printf
(
"match_count %d %d
\n
"
,
match_count
,
total_count
);
printf
(
"sync_match %d
\n
"
,
sync_match
);
}
return
0
;
}
...
...
src/ber-test.sh
View file @
8f45c4a8
...
...
@@ -97,9 +97,11 @@ do
# decoding with original
# audiowmark cmp-delta "$i" t.wav $PATTERN $AWM_PARAMS --test-key $SEED
done
done
|
grep
match_count |
{
done
|
{
if
[
"x
$AWM_REPORT
"
==
"xfer"
]
;
then
awk
'BEGIN { bad = n = 0 } { if ($2 == 0) bad++; n++; } END { print bad, n, bad * 100.0 / n; }'
awk
'BEGIN { bad = n = 0 } $1 == "match_count" { if ($2 == 0) bad++; n++; } END { print bad, n, bad * 100.0 / n; }'
elif
[
"x
$AWM_REPORT
"
==
"xsync"
]
;
then
awk
'BEGIN { bad = n = 0 } $1 == "sync_match" { bad += (3 - $2) / 3.0; n++; } END { print bad, n, bad * 100.0 / n; }'
else
echo
"unknown report
$AWM_REPORT
"
>
&2
exit
1
...
...
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