Commit 2eea07ef authored by Stefan Westerfeld's avatar Stefan Westerfeld

Support --test-no-sync to disable sync search for tests.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 1e1a673c
...@@ -49,6 +49,7 @@ namespace Params ...@@ -49,6 +49,7 @@ namespace Params
static int mark_sample_rate = 44100; // watermark generation and detection sample rate static int mark_sample_rate = 44100; // watermark generation and detection sample rate
static int test_cut = 0; // for sync test static int test_cut = 0; // for sync test
static bool test_no_sync = false; // disable sync
} }
void void
...@@ -187,6 +188,10 @@ parse_options (int *argc_p, ...@@ -187,6 +188,10 @@ parse_options (int *argc_p,
{ {
Params::test_cut = atoi (opt_arg); Params::test_cut = atoi (opt_arg);
} }
else if (check_arg (argc, argv, &i, "--test-no-sync"))
{
Params::test_no_sync = true;
}
} }
/* resort argc/argv */ /* resort argc/argv */
...@@ -1002,6 +1007,17 @@ public: ...@@ -1002,6 +1007,17 @@ public:
vector<Score> result_scores; vector<Score> result_scores;
vector<Score> sync_scores; vector<Score> sync_scores;
if (Params::test_no_sync)
{
const size_t expect0 = Params::frames_pad_start * Params::frame_size;
const size_t expect_step = (mark_sync_frame_count() + mark_data_frame_count()) * Params::frame_size;
const size_t expect_end = frame_count (wav_data) * Params::frame_size;
for (size_t expect_index = expect0; expect_index + expect_step < expect_end; expect_index += expect_step)
result_scores.push_back (Score { expect_index, 1.0 });
return result_scores;
}
init_up_down (wav_data); init_up_down (wav_data);
vector<float> fft_db; vector<float> fft_db;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment