[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 16/43: fec: LDPC async decoder now running
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 16/43: fec: LDPC async decoder now running |
Date: |
Thu, 2 Apr 2015 19:15:50 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 1bd6282cc2523b6f149abf66946ead0309632a4a
Author: Tim O'Shea <address@hidden>
Date: Wed Apr 1 14:13:42 2015 -0700
fec: LDPC async decoder now running
---
gr-fec/include/gnuradio/fec/ldpc_decoder.h | 2 +-
gr-fec/lib/async_decoder_impl.cc | 28 ++++++++++++++++++++++++----
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/gr-fec/include/gnuradio/fec/ldpc_decoder.h
b/gr-fec/include/gnuradio/fec/ldpc_decoder.h
index 3a80dcb..705bbab 100644
--- a/gr-fec/include/gnuradio/fec/ldpc_decoder.h
+++ b/gr-fec/include/gnuradio/fec/ldpc_decoder.h
@@ -60,7 +60,7 @@ class FEC_API ldpc_decoder : public generic_decoder {
public:
~ldpc_decoder ();
- double rate() { return (1.0*get_output_item_size() /
get_input_item_size()); }
+ double rate() { return (1.0*get_output_size() / get_input_size()); }
bool set_frame_size(unsigned int frame_size) { return false; }
static generic_decoder::sptr
diff --git a/gr-fec/lib/async_decoder_impl.cc b/gr-fec/lib/async_decoder_impl.cc
index f5924ec..3044a2c 100644
--- a/gr-fec/lib/async_decoder_impl.cc
+++ b/gr-fec/lib/async_decoder_impl.cc
@@ -114,15 +114,27 @@ namespace gr {
int diff = d_decoder->rate()*d_decoder->get_input_size() -
d_decoder->get_output_size();
int nbits_in = pmt::length(bits);
- int nbits_out = nbits_in*d_decoder->rate() - diff;
+ size_t nbits_out = 0;
+ size_t nblocks = 1;
+ bool variable_frame_size = d_decoder->set_frame_size(nbits_out);
// Check here if the frame size is larger than what we've
// allocated for in the constructor.
- if(nbits_in > d_max_bits_in) {
+ if(variable_frame_size && (nbits_in > d_max_bits_in)) {
throw std::runtime_error("async_decoder: Received frame larger than
max frame size.");
}
- d_decoder->set_frame_size(nbits_out);
+ // set up nbits_out
+ if(variable_frame_size){
+ nbits_out = nbits_in*d_decoder->rate() - diff;
+ } else {
+ nblocks = nbits_in / d_decoder->get_input_size();
+ nbits_out = nblocks * d_decoder->get_output_size();
+ if(nblocks * d_decoder->get_input_size() != nbits_in){
+ throw std::runtime_error("bad block multiple in!");
+ }
+ }
+
size_t o0(0);
const float* f32in = pmt::f32vector_elements(bits, o0);
@@ -133,6 +145,12 @@ namespace gr {
volk_32f_s32f_multiply_32f(d_tmp_f32, f32in, 48.0f, nbits_in);
}
else {
+ if(nbits_in > d_max_bits_in){
+ d_max_bits_in = nbits_in;
+ volk_free(d_tmp_f32);
+ d_tmp_f32 = (float*)volk_malloc(d_max_bits_in*sizeof(float),
+ volk_get_alignment());
+ }
memcpy(d_tmp_f32, f32in, nbits_in*sizeof(float));
}
@@ -149,7 +167,9 @@ namespace gr {
d_decoder->generic_work((void*)d_tmp_u8, (void*)u8out);
}
else {
- d_decoder->generic_work((void*)d_tmp_f32, (void*)u8out);
+ for(size_t i=0; i<nblocks; i++){
+ d_decoder->generic_work((void*)d_tmp_f32, (void*)u8out);
+ }
}
message_port_pub(d_out_port, pmt::cons(meta, outvec));
- [Commit-gnuradio] [gnuradio] branch master updated (7fe6115 -> 3061e47), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 16/43: fec: LDPC async decoder now running,
git <=
- [Commit-gnuradio] [gnuradio] 04/43: gnuradio-runtime: added the individual port assignments to the hier_block2 max/min_output_buffer size; if output ports have different size assignments only the block directly connected to the output port is changed otherwise every block within the hier is set to that output buffer size; therefore single output hier blocks will always set every block within to the output buffer size, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 17/43: gnuradio-runtume: hier_block2 output buffer lengths - clean up of debug output, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 26/43: grc: no shebang for hier blocks; use python2, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 15/43: fec: ldpc encoder now working in async encoder interface, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 06/43: gnuradio-runtime: (option 1) The hier block can now take a generic min/max output buffer length and assign it to every block within the hier (assumes all output buffers have the same min/max values set); (option 2) sets only the blocks connected to hier output ports and does not set the other internal blocks (requires that each port has different values); for single port output hier blocks only option 1 is possible., git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 07/43: gnuradio-runtime: non-helpful debug outputs removed from hier_block2 and hier_block2_detail, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 27/43: grc: optional thread-safe setters in generated code (#748), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 19/43: gnuradio-runtime: added logger to flat_flowgraph and print out a warning for when the max_output_buffer isn't set to the requested value, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 28/43: grc: don't try to open missing files, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 01/43: gnuradio-runtime: trying to see if this will handle the output buffer size of hier blocks; trying to find the proper casting methods, git, 2015/04/02