[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 34/39: fec: LDPC: changing namespace of ldp
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 34/39: fec: LDPC: changing namespace of ldpc_encoder back. |
Date: |
Thu, 15 Oct 2015 21:21:33 +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 12564af5eb11740216651735f3a58c2c37b0b1d0
Author: Tom Rondeau <address@hidden>
Date: Mon Oct 12 11:22:07 2015 -0400
fec: LDPC: changing namespace of ldpc_encoder back.
Keep the original API for this class in 3.7. We should convert this to
gr::fec::code in 3.8.
---
gr-fec/include/gnuradio/fec/ldpc_encoder.h | 22 ++---
gr-fec/lib/ldpc_encoder_impl.cc | 142 ++++++++++++++---------------
gr-fec/lib/ldpc_encoder_impl.h | 45 +++++----
3 files changed, 101 insertions(+), 108 deletions(-)
diff --git a/gr-fec/include/gnuradio/fec/ldpc_encoder.h
b/gr-fec/include/gnuradio/fec/ldpc_encoder.h
index 5a8bb6c..aef3119 100755
--- a/gr-fec/include/gnuradio/fec/ldpc_encoder.h
+++ b/gr-fec/include/gnuradio/fec/ldpc_encoder.h
@@ -31,21 +31,19 @@
namespace gr {
namespace fec {
- namespace code {
- class FEC_API ldpc_encoder : virtual public generic_encoder
- {
- public:
- static generic_encoder::sptr make(std::string alist_file, unsigned int
gap=0);
- static generic_encoder::sptr make_H(const ldpc_H_matrix::sptr H_obj);
+ class FEC_API ldpc_encoder : virtual public generic_encoder
+ {
+ public:
+ static generic_encoder::sptr make(std::string alist_file, unsigned int
gap=0);
+ static generic_encoder::sptr make_H(const code::ldpc_H_matrix::sptr
H_obj);
- virtual double rate() = 0;
- virtual bool set_frame_size(unsigned int frame_size) = 0;
- virtual int get_output_size() = 0;
- virtual int get_input_size() = 0;
- };
+ virtual double rate() = 0;
+ virtual bool set_frame_size(unsigned int frame_size) = 0;
+ virtual int get_output_size() = 0;
+ virtual int get_input_size() = 0;
+ };
- }
}
}
diff --git a/gr-fec/lib/ldpc_encoder_impl.cc b/gr-fec/lib/ldpc_encoder_impl.cc
index ccc9de8..95879ea 100755
--- a/gr-fec/lib/ldpc_encoder_impl.cc
+++ b/gr-fec/lib/ldpc_encoder_impl.cc
@@ -33,93 +33,91 @@
namespace gr {
namespace fec {
- namespace code{
- generic_encoder::sptr
- ldpc_encoder::make(std::string alist_file, unsigned int gap)
- {
- ldpc_H_matrix::sptr H_obj = ldpc_H_matrix::make(alist_file, gap);
- return make_H(H_obj);
- }
-
- generic_encoder::sptr
- ldpc_encoder::make_H(const ldpc_H_matrix::sptr H_obj)
- {
- return generic_encoder::sptr
- (new ldpc_encoder_impl(H_obj));
- }
+ generic_encoder::sptr
+ ldpc_encoder::make(std::string alist_file, unsigned int gap)
+ {
+ code::ldpc_H_matrix::sptr H_obj = code::ldpc_H_matrix::make(alist_file,
gap);
+ return make_H(H_obj);
+ }
- ldpc_encoder_impl::ldpc_encoder_impl(const ldpc_H_matrix::sptr H_obj)
- : generic_encoder("ldpc_encoder")
- {
- // LDPC parity check matrix to use for encoding
- d_H = H_obj;
+ generic_encoder::sptr
+ ldpc_encoder::make_H(const code::ldpc_H_matrix::sptr H_obj)
+ {
+ return generic_encoder::sptr
+ (new ldpc_encoder_impl(H_obj));
+ }
- d_rate = static_cast<double>(d_H->n())/static_cast<double>(d_H->k());
+ ldpc_encoder_impl::ldpc_encoder_impl(const code::ldpc_H_matrix::sptr H_obj)
+ : generic_encoder("ldpc_encoder")
+ {
+ // LDPC parity check matrix to use for encoding
+ d_H = H_obj;
- // Set frame size to k, the # of bits in the information word
- // All buffers and settings will be based on this value.
- set_frame_size(d_H->k());
- }
+ d_rate = static_cast<double>(d_H->n())/static_cast<double>(d_H->k());
- ldpc_encoder_impl::~ldpc_encoder_impl()
- {
- }
+ // Set frame size to k, the # of bits in the information word
+ // All buffers and settings will be based on this value.
+ set_frame_size(d_H->k());
+ }
- int
- ldpc_encoder_impl::get_output_size()
- {
- //return outputSize;
- return d_output_size;
- }
+ ldpc_encoder_impl::~ldpc_encoder_impl()
+ {
+ }
- int
- ldpc_encoder_impl::get_input_size()
- {
- //return inputSize;
- return d_frame_size;
- }
+ int
+ ldpc_encoder_impl::get_output_size()
+ {
+ //return outputSize;
+ return d_output_size;
+ }
- bool
- ldpc_encoder_impl::set_frame_size(unsigned int frame_size)
- {
- bool ret = true;
+ int
+ ldpc_encoder_impl::get_input_size()
+ {
+ //return inputSize;
+ return d_frame_size;
+ }
- if(frame_size % d_H->k() != 0) {
- GR_LOG_ERROR(d_logger, boost::format("Frame size (%1% bits) must be
a "
- "multiple of the information
word "
- "size of the LDPC matrix
(%2%).") \
- % frame_size % (d_H->k()));
- throw std::runtime_error("ldpc_encoder: cannot use frame size.");
- }
+ bool
+ ldpc_encoder_impl::set_frame_size(unsigned int frame_size)
+ {
+ bool ret = true;
+
+ if(frame_size % d_H->k() != 0) {
+ GR_LOG_ERROR(d_logger, boost::format("Frame size (%1% bits) must be a "
+ "multiple of the information word
"
+ "size of the LDPC matrix (%2%).")
\
+ % frame_size % (d_H->k()));
+ throw std::runtime_error("ldpc_encoder: cannot use frame size.");
+ }
- d_frame_size = frame_size;
+ d_frame_size = frame_size;
- d_output_size = static_cast<int>(d_rate * d_frame_size);
+ d_output_size = static_cast<int>(d_rate * d_frame_size);
- return ret;
- }
+ return ret;
+ }
- double
- ldpc_encoder_impl::rate()
- {
- return d_rate;
- }
+ double
+ ldpc_encoder_impl::rate()
+ {
+ return d_rate;
+ }
- void
- ldpc_encoder_impl::generic_work(void *inbuffer, void *outbuffer)
- {
- // Populate the information word
- const unsigned char *in = (const unsigned char *)inbuffer;
- unsigned char *out = (unsigned char*)outbuffer;
-
- int j = 0;
- for(int i = 0; i < get_input_size(); i+=d_H->k()) {
- d_H->encode(&out[j], &in[i]);
- j += d_H->n();
- }
+ void
+ ldpc_encoder_impl::generic_work(void *inbuffer, void *outbuffer)
+ {
+ // Populate the information word
+ const unsigned char *in = (const unsigned char *)inbuffer;
+ unsigned char *out = (unsigned char*)outbuffer;
+
+ int j = 0;
+ for(int i = 0; i < get_input_size(); i+=d_H->k()) {
+ d_H->encode(&out[j], &in[i]);
+ j += d_H->n();
}
-
}
+
}
}
diff --git a/gr-fec/lib/ldpc_encoder_impl.h b/gr-fec/lib/ldpc_encoder_impl.h
index 00dd194..4a6bd82 100644
--- a/gr-fec/lib/ldpc_encoder_impl.h
+++ b/gr-fec/lib/ldpc_encoder_impl.h
@@ -24,40 +24,37 @@
#define INCLUDED_LDPC_ENCODER_IMPL_H
#include <gnuradio/fec/ldpc_encoder.h>
-#include <gnuradio/fec/ldpc_G_matrix.h>
namespace gr {
namespace fec {
- namespace code {
- class ldpc_encoder_impl : public ldpc_encoder
- {
- private:
- // plug into the generic fec api
- void generic_work(void *inbuffer, void *outbuffer);
+ class ldpc_encoder_impl : public ldpc_encoder
+ {
+ private:
+ // plug into the generic fec api
+ void generic_work(void *inbuffer, void *outbuffer);
- // Number of bits in the frame to be encoded
- unsigned int d_frame_size;
+ // Number of bits in the frame to be encoded
+ unsigned int d_frame_size;
- // Number of output bits after coding
- int d_output_size;
+ // Number of output bits after coding
+ int d_output_size;
- // Rate of the code, n/k
- double d_rate;
+ // Rate of the code, n/k
+ double d_rate;
- // LDPC parity check matrix object
- ldpc_H_matrix::sptr d_H;
+ // LDPC parity check matrix object
+ code::ldpc_H_matrix::sptr d_H;
- public:
- ldpc_encoder_impl(const ldpc_H_matrix::sptr H_obj);
- ~ldpc_encoder_impl();
+ public:
+ ldpc_encoder_impl(const code::ldpc_H_matrix::sptr H_obj);
+ ~ldpc_encoder_impl();
- double rate();
- bool set_frame_size(unsigned int frame_size);
- int get_output_size();
- int get_input_size();
- };
- }
+ double rate();
+ bool set_frame_size(unsigned int frame_size);
+ int get_output_size();
+ int get_input_size();
+ };
}
}
- [Commit-gnuradio] [gnuradio] 06/39: fec: LDPC: Adding bit flip decoder variable work function., (continued)
- [Commit-gnuradio] [gnuradio] 06/39: fec: LDPC: Adding bit flip decoder variable work function., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 15/39: fec: LDPC: Change GRC block name text to match new class name., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 19/39: fec: LDPC: renaming some of the LDPC classes for clarity/consistency., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 09/39: fec: LDPC: Adding scripts to generate matrices for encoder., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 18/39: fec: LDPC: Updates to LDPC-related matrix classes., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 01/39: fec: LDPC: Adding class for LDPC parity check matrix., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 16/39: fec: LDPC: updates for LDPC functionality., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 22/39: fec: LDPC: Updating decoder to handle parity bits either first or last., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 28/39: qtgui: fixes calculation of BPSK BER curve., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 05/39: fec: LDPC: Adding LDPC encoder variable., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 34/39: fec: LDPC: changing namespace of ldpc_encoder back.,
git <=
- [Commit-gnuradio] [gnuradio] 30/39: fec: Updated docs for Forward Error Correction section in manual., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 32/39: fec: LDPC: removing apps until we can fix them up properly., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 35/39: fec: LDPC: better docs describing encoder/decoders and how to use., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 39/39: Merge remote-tracking branch 'tom/fec/ldpc_methods', git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 26/39: fec: LDPC: Setting copyright date to current year., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 38/39: fec: LDPC: added back all QA tests and added a test of ldpc_gen_mtrx_encoder., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 13/39: fec: LDPC: Renaming class from ldpc_par_chk_mtrx to ldpc_R_U_mtrx, git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 36/39: fec: LDPC: reworking code to make sure API is ok., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 25/39: fec: LDPC: Moving alist files to a more global place; updating example., git, 2015/10/15
- [Commit-gnuradio] [gnuradio] 04/39: fec: LDPC: Classes for LDPC encoder., git, 2015/10/15