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
f4132aa2
Commit
f4132aa2
authored
Sep 09, 2021
by
Tim Janik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SRC: audiowmark.cc, wmcommon: add --json option and Params::json_output flag
Signed-off-by:
Tim Janik
<
timj@gnu.org
>
parent
09e50c8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
audiowmark.cc
src/audiowmark.cc
+5
-0
wmcommon.cc
src/wmcommon.cc
+1
-0
wmcommon.hh
src/wmcommon.hh
+1
-0
No files found.
src/audiowmark.cc
View file @
f4132aa2
...
@@ -58,6 +58,7 @@ print_usage()
...
@@ -58,6 +58,7 @@ print_usage()
printf
(
"
\n
"
);
printf
(
"
\n
"
);
printf
(
"Global options:
\n
"
);
printf
(
"Global options:
\n
"
);
printf
(
" --strength <s> set watermark strength [%.6g]
\n
"
,
Params
::
water_delta
*
1000
);
printf
(
" --strength <s> set watermark strength [%.6g]
\n
"
,
Params
::
water_delta
*
1000
);
printf
(
" --json produce JSON output
\n
"
);
printf
(
" --linear disable non-linear bit storage
\n
"
);
printf
(
" --linear disable non-linear bit storage
\n
"
);
printf
(
" --short <bits> enable short payload mode
\n
"
);
printf
(
" --short <bits> enable short payload mode
\n
"
);
printf
(
" --key <file> load watermarking key from file
\n
"
);
printf
(
" --key <file> load watermarking key from file
\n
"
);
...
@@ -456,6 +457,10 @@ parse_shared_options (ArgParser& ap)
...
@@ -456,6 +457,10 @@ parse_shared_options (ArgParser& ap)
{
{
Params
::
water_delta
=
f
/
1000
;
Params
::
water_delta
=
f
/
1000
;
}
}
if
(
ap
.
parse_opt
(
"--json"
))
{
Params
::
json_output
=
true
;
}
if
(
ap
.
parse_opt
(
"--key"
,
s
))
if
(
ap
.
parse_opt
(
"--key"
,
s
))
{
{
Params
::
have_key
++
;
Params
::
have_key
++
;
...
...
src/wmcommon.cc
View file @
f4132aa2
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
int
Params
::
frames_per_bit
=
2
;
int
Params
::
frames_per_bit
=
2
;
double
Params
::
water_delta
=
0.01
;
double
Params
::
water_delta
=
0.01
;
bool
Params
::
json_output
=
false
;
bool
Params
::
mix
=
true
;
bool
Params
::
mix
=
true
;
bool
Params
::
hard
=
false
;
// hard decode bits? (soft decoding is better)
bool
Params
::
hard
=
false
;
// hard decode bits? (soft decoding is better)
bool
Params
::
snr
=
false
;
// compute/show snr while adding watermark
bool
Params
::
snr
=
false
;
// compute/show snr while adding watermark
...
...
src/wmcommon.hh
View file @
f4132aa2
...
@@ -40,6 +40,7 @@ public:
...
@@ -40,6 +40,7 @@ public:
static
constexpr
int
min_band
=
20
;
static
constexpr
int
min_band
=
20
;
static
double
water_delta
;
static
double
water_delta
;
static
bool
json_output
;
static
bool
mix
;
static
bool
mix
;
static
bool
hard
;
// hard decode bits? (soft decoding is better)
static
bool
hard
;
// hard decode bits? (soft decoding is better)
static
bool
snr
;
// compute/show snr while adding watermark
static
bool
snr
;
// compute/show snr while adding watermark
...
...
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