diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2021-07-16 19:22:21 +0200 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-07-27 11:21:52 -0400 |
commit | f6b3295ae29e3ee3c2c8fc3c6738ee4561ca194b (patch) | |
tree | 31b557f0cdc3990deb104a33291be48606915301 /gr-digital/lib/chunks_to_symbols_impl.h | |
parent | 52a9d49acef2ec124d52e7e223dc16e767af92c7 (diff) |
digital/chunks to symbols: be less inefficient
The block formerly took the tags from get_tags_in_range (which are
sorted), gave them to tag_checker, which sorted them, and then went
through every input sample, checking its index against the next tag.
Removed the tag_checker; that saves us a sorting of a sorted vector.
The other optimization is to not dispatch any tag encountered to the own
message handler; instead, the handler is called directly.
Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
Diffstat (limited to 'gr-digital/lib/chunks_to_symbols_impl.h')
-rw-r--r-- | gr-digital/lib/chunks_to_symbols_impl.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gr-digital/lib/chunks_to_symbols_impl.h b/gr-digital/lib/chunks_to_symbols_impl.h index a16b05a703..8800ebdbf4 100644 --- a/gr-digital/lib/chunks_to_symbols_impl.h +++ b/gr-digital/lib/chunks_to_symbols_impl.h @@ -12,6 +12,7 @@ #define CHUNKS_TO_SYMBOLS_IMPL_H #include <gnuradio/digital/chunks_to_symbols.h> +#include <pmt/pmt.h> namespace gr { namespace digital { @@ -20,18 +21,20 @@ template <class IN_T, class OUT_T> class chunks_to_symbols_impl : public chunks_to_symbols<IN_T, OUT_T> { private: - const int d_D; + const unsigned int d_D; std::vector<OUT_T> d_symbol_table; + const pmt::pmt_t symbol_table_key; public: - chunks_to_symbols_impl(const std::vector<OUT_T>& symbol_table, const int D = 1); + chunks_to_symbols_impl(const std::vector<OUT_T>& symbol_table, + const unsigned int D = 1); ~chunks_to_symbols_impl() override; - void handle_set_symbol_table(pmt::pmt_t symbol_table_pmt); + void handle_set_symbol_table(const pmt::pmt_t& symbol_table_pmt); void set_symbol_table(const std::vector<OUT_T>& symbol_table) override; - int D() const override { return d_D; } + unsigned int D() const override { return d_D; } std::vector<OUT_T> symbol_table() const override { return d_symbol_table; } int work(int noutput_items, |