[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 12/43: fec: re-shuffling LDPC make helper
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 12/43: fec: re-shuffling LDPC make helper |
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 5c199bafbc9aaced179f19bef8aa737e087067ed
Author: Tim O'Shea <address@hidden>
Date: Wed Apr 1 11:06:00 2015 -0700
fec: re-shuffling LDPC make helper
---
gr-fec/grc/ldpc_decoder_def_list.xml | 4 ++--
gr-fec/grc/ldpc_encoder_def_list.xml | 4 ++--
gr-fec/include/gnuradio/fec/ldpc_decoder.h | 12 ++++--------
gr-fec/include/gnuradio/fec/ldpc_encoder.h | 11 +++--------
gr-fec/lib/ldpc_decoder.cc | 2 +-
gr-fec/lib/ldpc_encoder.cc | 2 +-
6 files changed, 13 insertions(+), 22 deletions(-)
diff --git a/gr-fec/grc/ldpc_decoder_def_list.xml
b/gr-fec/grc/ldpc_decoder_def_list.xml
index 01bdce7..9e21f24 100644
--- a/gr-fec/grc/ldpc_decoder_def_list.xml
+++ b/gr-fec/grc/ldpc_decoder_def_list.xml
@@ -10,9 +10,9 @@
<import>from gnuradio import fec</import>
<var_make>
#if int($ndim())==1 #
-self.$(id) = $(id) = map( (lambda a: fec.ldpc_make_decoder($file, $sigma,
$max_iter)), range(0,$dim1) ); #slurp
+self.$(id) = $(id) = map( (lambda a: fec.ldpc_decoder.make($file, $sigma,
$max_iter)), range(0,$dim1) ); #slurp
#else
-self.$(id) = $(id) = map( (lambda b: map( ( lambda a:
fec.ldpc_make_decoder($file, $sigma, $max_iter)), range(0,$dim2) ) ),
range(0,$dim1)); #slurp
+self.$(id) = $(id) = map( (lambda b: map( ( lambda a:
fec.ldpc_decoder.make($file, $sigma, $max_iter)), range(0,$dim2) ) ),
range(0,$dim1)); #slurp
#end if</var_make>
<make></make>
diff --git a/gr-fec/grc/ldpc_encoder_def_list.xml
b/gr-fec/grc/ldpc_encoder_def_list.xml
index 26200ab..9ec98b6 100755
--- a/gr-fec/grc/ldpc_encoder_def_list.xml
+++ b/gr-fec/grc/ldpc_encoder_def_list.xml
@@ -10,9 +10,9 @@
<import>from gnuradio import fec</import>
<var_make>
#if int($ndim())==1 #
-self.$(id) = $(id) = map( (lambda a: fec.ldpc_make_encoder($file)),
range(0,$dim1) ); #slurp
+self.$(id) = $(id) = map( (lambda a: fec.ldpc_encoder.make($file)),
range(0,$dim1) ); #slurp
#else
-self.$(id) = $(id) = map( (lambda b: map( ( lambda a:
fec.ldpc_make_encoder($file)), range(0,$dim2) ) ), range(0,$dim1)); #slurp
+self.$(id) = $(id) = map( (lambda b: map( ( lambda a:
fec.ldpc_encoder.make($file)), range(0,$dim2) ) ), range(0,$dim1)); #slurp
#end if</var_make>
<make></make>
diff --git a/gr-fec/include/gnuradio/fec/ldpc_decoder.h
b/gr-fec/include/gnuradio/fec/ldpc_decoder.h
index 0f411bd..bc26464 100644
--- a/gr-fec/include/gnuradio/fec/ldpc_decoder.h
+++ b/gr-fec/include/gnuradio/fec/ldpc_decoder.h
@@ -38,16 +38,10 @@ typedef unsigned char OUTPUT_DATATYPE;
namespace gr {
namespace fec {
-FEC_API generic_decoder::sptr
-ldpc_make_decoder (std::string alist_file, float sigma=0.5, int
max_iterations=50);
#define MAXLOG 1e7
class FEC_API ldpc_decoder : public generic_decoder {
- //befriend the global, swigged make function
- friend generic_decoder::sptr
- ldpc_make_decoder (std::string alist_file, float sigma, int
max_iterations);
-
//private constructor
ldpc_decoder (std::string alist_file, float sigma, int max_iterations);
@@ -70,9 +64,11 @@ class FEC_API ldpc_decoder : public generic_decoder {
public:
~ldpc_decoder ();
+ double rate() { return (1.0*get_output_item_size() /
get_input_item_size()); }
+ bool set_frame_size(unsigned int frame_size) { return false; }
- double rate() { return 1; }
- bool set_frame_size(unsigned int frame_size) { throw
std::runtime_error("Nope"); }
+ static generic_decoder::sptr
+ make (std::string alist_file, float sigma=0.5, int max_iterations=50);
};
}
diff --git a/gr-fec/include/gnuradio/fec/ldpc_encoder.h
b/gr-fec/include/gnuradio/fec/ldpc_encoder.h
index 0498430..86220e9 100755
--- a/gr-fec/include/gnuradio/fec/ldpc_encoder.h
+++ b/gr-fec/include/gnuradio/fec/ldpc_encoder.h
@@ -34,15 +34,9 @@
namespace gr {
namespace fec {
-FEC_API generic_encoder::sptr
-ldpc_make_encoder (std::string alist_file);
class FEC_API ldpc_encoder : public generic_encoder {
- //befriend the global, swigged make function
- friend generic_encoder::sptr
- ldpc_make_encoder (std::string alist_file);
-
//private constructor
ldpc_encoder (std::string alist_file);
@@ -57,11 +51,12 @@ class FEC_API ldpc_encoder : public generic_encoder {
alist d_list;
cldpc d_code;
- double rate() { return 1.0; }
- bool set_frame_size(unsigned int frame_size) { throw
std::runtime_error("Not supported!!!"); }
+ double rate() { return (1.0*get_input_size() / get_output_size()); }
+ bool set_frame_size(unsigned int frame_size) { return false; }
public:
~ldpc_encoder ();
+ static generic_encoder::sptr make (std::string alist_file);
};
diff --git a/gr-fec/lib/ldpc_decoder.cc b/gr-fec/lib/ldpc_decoder.cc
index b7aae0b..3f545ed 100644
--- a/gr-fec/lib/ldpc_decoder.cc
+++ b/gr-fec/lib/ldpc_decoder.cc
@@ -37,7 +37,7 @@ namespace gr {
namespace fec {
generic_decoder::sptr
-ldpc_make_decoder(std::string alist_file, float sigma, int max_iterations)
+ldpc_decoder::make(std::string alist_file, float sigma, int max_iterations)
{
return generic_decoder::sptr(new ldpc_decoder(alist_file, sigma,
max_iterations));
}
diff --git a/gr-fec/lib/ldpc_encoder.cc b/gr-fec/lib/ldpc_encoder.cc
index 0385dc8..e25eade 100755
--- a/gr-fec/lib/ldpc_encoder.cc
+++ b/gr-fec/lib/ldpc_encoder.cc
@@ -34,7 +34,7 @@ namespace gr {
namespace fec {
generic_encoder::sptr
-ldpc_make_encoder(std::string alist_file)
+ldpc_encoder::make(std::string alist_file)
{
return generic_encoder::sptr(new ldpc_encoder(alist_file));
}
- [Commit-gnuradio] [gnuradio] 27/43: grc: optional thread-safe setters in generated code (#748), (continued)
- [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, 2015/04/02
- [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 <=
- [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
- [Commit-gnuradio] [gnuradio] 29/43: grc: move context def into Bars.py and add submenu, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 14/43: gnuradio-runtime: modified buffer length types to size_t, moved buffer length vectors into detail, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 22/43: grc: close unsaved pages first (for cancel save option), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 13/43: fec: ldpc GRC compat cleanup, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 36/43: Merge remote-tracking branch 'fengzhe/chunks_to_symbols_update', git, 2015/04/02