[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 18/43: fec: ldpc works, add iterations meta
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 18/43: fec: ldpc works, add iterations meta tag, etc |
Date: |
Thu, 2 Apr 2015 19:15:51 +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 cc1124dcee3043649062bbf1e08a8d313e12a08e
Author: Tim O'Shea <address@hidden>
Date: Wed Apr 1 17:01:20 2015 -0700
fec: ldpc works, add iterations meta tag, etc
---
gr-fec/include/gnuradio/fec/generic_decoder.h | 9 +++++++++
gr-fec/include/gnuradio/fec/ldpc_decoder.h | 4 +++-
gr-fec/lib/async_decoder_impl.cc | 5 ++++-
gr-fec/lib/ldpc_decoder.cc | 3 +++
gr-fec/lib/ldpc_encoder.cc | 2 ++
5 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/gr-fec/include/gnuradio/fec/generic_decoder.h
b/gr-fec/include/gnuradio/fec/generic_decoder.h
index 0e14d49..bfce85a 100644
--- a/gr-fec/include/gnuradio/fec/generic_decoder.h
+++ b/gr-fec/include/gnuradio/fec/generic_decoder.h
@@ -210,6 +210,15 @@ namespace gr {
* behavior. It should also provide bounds checks.
*/
virtual bool set_frame_size(unsigned int frame_size) = 0;
+
+
+ /*!
+ * Get repetitions to decode.
+ *
+ * The child class should implement this function and return the
+ * number of iterations required to decode.
+ */
+ virtual float get_iterations(){ return -1; }
};
/*! see generic_decoder::get_output_size() */
diff --git a/gr-fec/include/gnuradio/fec/ldpc_decoder.h
b/gr-fec/include/gnuradio/fec/ldpc_decoder.h
index 705bbab..02cf12d 100644
--- a/gr-fec/include/gnuradio/fec/ldpc_decoder.h
+++ b/gr-fec/include/gnuradio/fec/ldpc_decoder.h
@@ -50,7 +50,7 @@ class FEC_API ldpc_decoder : public generic_decoder {
float get_shift();
const char* get_conversion();
void generic_work(void *inBuffer, void *outbuffer);
-
+ float d_iterations;
int inputSize, outputSize;
alist d_list;
@@ -69,6 +69,8 @@ class FEC_API ldpc_decoder : public generic_decoder {
int get_input_size();
int get_input_item_size();
int get_output_item_size();
+ float get_iterations(){ return d_iterations; }
+
};
}
diff --git a/gr-fec/lib/async_decoder_impl.cc b/gr-fec/lib/async_decoder_impl.cc
index 3044a2c..2cdea6a 100644
--- a/gr-fec/lib/async_decoder_impl.cc
+++ b/gr-fec/lib/async_decoder_impl.cc
@@ -145,6 +145,8 @@ namespace gr {
volk_32f_s32f_multiply_32f(d_tmp_f32, f32in, 48.0f, nbits_in);
}
else {
+
+ // grow d_tmp_f32 if needed
if(nbits_in > d_max_bits_in){
d_max_bits_in = nbits_in;
volk_free(d_tmp_f32);
@@ -168,10 +170,11 @@ namespace gr {
}
else {
for(size_t i=0; i<nblocks; i++){
- d_decoder->generic_work((void*)d_tmp_f32, (void*)u8out);
+
d_decoder->generic_work((void*)&d_tmp_f32[i*d_decoder->get_input_size()],
(void*)&u8out[i*d_decoder->get_output_size()]);
}
}
+ meta = pmt::dict_add(meta, pmt::mp("iterations"),
pmt::mp(d_decoder->get_iterations()) );
message_port_pub(d_out_port, pmt::cons(meta, outvec));
}
diff --git a/gr-fec/lib/ldpc_decoder.cc b/gr-fec/lib/ldpc_decoder.cc
index 3f545ed..066024c 100644
--- a/gr-fec/lib/ldpc_decoder.cc
+++ b/gr-fec/lib/ldpc_decoder.cc
@@ -45,6 +45,8 @@ ldpc_decoder::make(std::string alist_file, float sigma, int
max_iterations)
ldpc_decoder::ldpc_decoder (std::string alist_file, float sigma, int
max_iterations)
: generic_decoder("ldpc_decoder")
{
+ if(!boost::filesystem::exists( alist_file ))
+ throw std::runtime_error("Bad AList file name!");
d_list.read(alist_file.c_str());
d_code.set_alist(d_list);
d_spa.set_alist_sigma(d_list, sigma);
@@ -73,6 +75,7 @@ void ldpc_decoder::generic_work(void *inBuffer, void
*outBuffer) {
std::vector<char> estimate( d_spa.decode(rx, &n_iterations) );
std::vector<char> data( d_code.get_systematic_bits(estimate) );
memcpy(out, &data[0], outputSize);
+ d_iterations = n_iterations;
}
int ldpc_decoder::get_input_item_size() {
diff --git a/gr-fec/lib/ldpc_encoder.cc b/gr-fec/lib/ldpc_encoder.cc
index a181c28..813715a 100755
--- a/gr-fec/lib/ldpc_encoder.cc
+++ b/gr-fec/lib/ldpc_encoder.cc
@@ -41,6 +41,8 @@ ldpc_encoder::make(std::string alist_file)
ldpc_encoder::ldpc_encoder (std::string alist_file)
{
+ if(!boost::filesystem::exists( alist_file ))
+ throw std::runtime_error("Bad AList file name!");
d_list.read(alist_file.c_str());
d_code.set_alist(d_list);
inputSize = d_code.dimension();
- [Commit-gnuradio] [gnuradio] 17/43: gnuradio-runtume: hier_block2 output buffer lengths - clean up of debug output, (continued)
- [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
- [Commit-gnuradio] [gnuradio] 10/43: fec: cleaning up LDPC warnings, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 18/43: fec: ldpc works, add iterations meta tag, etc,
git <=
- [Commit-gnuradio] [gnuradio] 34/43: Merge remote-tracking branch 'saikwolf/logging_flat_flowgraph', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 03/43: gnuradio-runtime:: removed the individual port setting on hier_block2, current operation assuming the buffers are being set for latency and therefore all blocks are being set to a small amount, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 11/43: fec: LDPC cleaning up comments, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 30/43: grc: clean-up 'gnuradio-companion', add mode 'run from source', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 12/43: fec: re-shuffling LDPC make helper, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 31/43: grc: PropsDialog: apply button and hotkey (Ctrl+Enter), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 40/43: fec: Move the definition of yp_kernel from the class into a temp variable in the main code. This variable is used just to find the actual Volk kernel, and its current use is not c++11 complaint. Moving it makes the code c++11 complaint on both GCC / libstdc++ and Clang / libc++., git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 35/43: Merge remote-tracking branch 'osh/ldpc_add', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 20/43: grc: Reworked save confirmation dialog to allow cancel option, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 42/43: Merge remote-tracking branch 'michaelld/misc_fixes', git, 2015/04/02