[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 14/22: blocks: deinterleaver will process m
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 14/22: blocks: deinterleaver will process more than one block at a time for significant speed improvements. |
Date: |
Wed, 24 Sep 2014 22:07:39 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit 22fc5b1484121d5c14ea638db766925a4523968a
Author: Tom Rondeau <address@hidden>
Date: Tue Sep 23 18:00:41 2014 -0400
blocks: deinterleaver will process more than one block at a time for
significant speed improvements.
---
gr-blocks/lib/deinterleave_impl.cc | 36 +++++++++++++++++++++++++++++++-----
gr-blocks/lib/deinterleave_impl.h | 3 ++-
2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/gr-blocks/lib/deinterleave_impl.cc
b/gr-blocks/lib/deinterleave_impl.cc
index c9d0e9a..9e18c35 100644
--- a/gr-blocks/lib/deinterleave_impl.cc
+++ b/gr-blocks/lib/deinterleave_impl.cc
@@ -41,13 +41,20 @@ namespace gr {
io_signature::make (1, io_signature::IO_INFINITE, itemsize)),
d_itemsize(itemsize), d_blocksize(blocksize), d_current_output(0)
{
+ d_size_bytes = d_itemsize * d_blocksize;
set_output_multiple(blocksize);
}
+ void
+ deinterleave_impl::forecast(int noutput_items, gr_vector_int
&ninput_items_required)
+ {
+ ninput_items_required[0] = noutput_items * d_noutputs;
+ }
+
bool
deinterleave_impl::check_topology(int ninputs, int noutputs)
{
- set_relative_rate((double)noutputs);
+ set_relative_rate(1.0/(double)noutputs);
d_noutputs = noutputs;
return true;
}
@@ -61,10 +68,29 @@ namespace gr {
const char *in = (const char*)input_items[0];
char **out = (char**)&output_items[0];
- memcpy(out[d_current_output], in, d_itemsize * d_blocksize);
- consume_each(d_blocksize);
- produce(d_current_output, d_blocksize);
- d_current_output = (d_current_output + 1) % d_noutputs;
+ int count = 0, totalcount = noutput_items*d_noutputs;
+ unsigned int skip = 0;
+ unsigned int acc = 0;
+ while(count < totalcount) {
+ memcpy(out[d_current_output]+skip*d_size_bytes, in, d_size_bytes);
+ in += d_size_bytes;
+ produce(d_current_output, d_blocksize);
+ d_current_output = (d_current_output + 1) % d_noutputs;
+
+ // accumulate times through the loop; increment skip after a
+ // full pass over the output streams.
+ // This is separate than d_current_output since we could be in
+ // the middle of a loop when we exit.
+ acc++;
+ if(acc >= d_noutputs) {
+ skip++;
+ acc = 0;
+ }
+
+ // Keep track of our loop counter
+ count+=d_blocksize;
+ }
+ consume_each(totalcount);
return WORK_CALLED_PRODUCE;
}
diff --git a/gr-blocks/lib/deinterleave_impl.h
b/gr-blocks/lib/deinterleave_impl.h
index 247ee3a..71a551a 100644
--- a/gr-blocks/lib/deinterleave_impl.h
+++ b/gr-blocks/lib/deinterleave_impl.h
@@ -35,11 +35,12 @@ namespace gr {
unsigned int d_blocksize;
unsigned int d_current_output;
unsigned int d_noutputs;
-
+ unsigned int d_size_bytes; // block size in bytes
public:
deinterleave_impl(size_t itemsize, unsigned int blocksize);
+ void forecast(int noutput_items, gr_vector_int &ninput_items_required);
bool check_topology(int ninputs, int noutputs);
int general_work(int noutput_items,
- [Commit-gnuradio] [gnuradio] 02/22: blocks: make tagged stream to pdu output optional, (continued)
- [Commit-gnuradio] [gnuradio] 02/22: blocks: make tagged stream to pdu output optional, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 08/22: Fix prune_tags, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 01/22: Add vector support to abs block. Remove unused num_inputs from xml., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 05/22: blocks: Added callback to vector source GRC bindings, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 07/22: Fix(?) prune_tags: needs verification, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 15/22: digital: clock recovery fix relative limit, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 21/22: Merge branch 'master' of git.gnuradio.org:gnuradio, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 13/22: fec: turning off some debug output., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 10/22: Formatting fix-ups, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 19/22: digital: applying same fix of the complex M&M clock recovery block as the float version., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 14/22: blocks: deinterleaver will process more than one block at a time for significant speed improvements.,
git <=
- [Commit-gnuradio] [gnuradio] 06/22: tags_wip, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 22/22: Merge branch 'maint', git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 09/22: runtime: speed up all the things, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 12/22: docs: fixed path stripping for binary dirs in doxygen manual., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 17/22: digital: clock recovery more verbose documentation, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 11/22: blocks: added example of how to construct and add a tag to a vector_source., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 18/22: digital: adapt clock recovery QA, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 16/22: digital: clock recovery delete unused variables, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 20/22: CID 1240027: runtime: clean up tag pruning using iter range, git, 2014/09/24