Commit 12f72835 authored by Stefan Westerfeld's avatar Stefan Westerfeld

Initialize type a frame mod vector only when needed.

This minimizes the startup latency.
Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 17187b4a
...@@ -6,4 +6,3 @@ streaming: ...@@ -6,4 +6,3 @@ streaming:
- mp3 indexing / detect (resync-limit) - mp3 indexing / detect (resync-limit)
- final documentation - final documentation
- --snr - --snr
- ab init lazy
...@@ -265,7 +265,6 @@ public: ...@@ -265,7 +265,6 @@ public:
bitvec_b (bitvec_b) bitvec_b (bitvec_b)
{ {
init_pad_mod_vec (pad_mod_vec); init_pad_mod_vec (pad_mod_vec);
init_frame_mod_vec (frame_mod_vec_a, 0, bitvec_a);
} }
vector<float> vector<float>
run (const vector<float>& samples) run (const vector<float>& samples)
...@@ -298,6 +297,10 @@ public: ...@@ -298,6 +297,10 @@ public:
{ {
state = WATERMARK; state = WATERMARK;
frame_bound = mark_sync_frame_count() + mark_data_frame_count(); frame_bound = mark_sync_frame_count() + mark_data_frame_count();
// initialize a-block frame mod vector here to minimize startup latency
assert (frame_mod_vec_a.empty());
init_frame_mod_vec (frame_mod_vec_a, 0, bitvec_a);
} }
else if (state == WATERMARK) else if (state == WATERMARK)
{ {
...@@ -306,7 +309,7 @@ public: ...@@ -306,7 +309,7 @@ public:
if (frame_mod_vec_b.empty()) if (frame_mod_vec_b.empty())
{ {
// we initialize this only when we need it to minimize startup latency // initialize b-block frame mod vector here to minimize startup latency
init_frame_mod_vec (frame_mod_vec_b, 1, bitvec_b); init_frame_mod_vec (frame_mod_vec_b, 1, bitvec_b);
} }
} }
......
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