[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 15/43: fec: ldpc encoder now working in asy
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 15/43: fec: ldpc encoder now working in async encoder interface |
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 ef9b37cb05411a8cbfcaa05495b22329c3b913b9
Author: Tim O'Shea <address@hidden>
Date: Wed Apr 1 13:46:18 2015 -0700
fec: ldpc encoder now working in async encoder interface
---
gr-fec/lib/async_encoder_impl.cc | 20 +++++++++++++++++---
gr-fec/lib/ldpc_encoder.cc | 4 ++--
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/gr-fec/lib/async_encoder_impl.cc b/gr-fec/lib/async_encoder_impl.cc
index d6ce67d..106ad25 100644
--- a/gr-fec/lib/async_encoder_impl.cc
+++ b/gr-fec/lib/async_encoder_impl.cc
@@ -110,9 +110,21 @@ namespace gr {
int nbits_in = pmt::length(bits);
const uint8_t* bits_in = pmt::u8vector_elements(bits, o0);
- d_encoder->set_frame_size(nbits_in);
+ bool variable_framesize = d_encoder->set_frame_size(nbits_in);
+ size_t nbits_out = 0;
+ size_t nblocks = 1;
+ if( variable_framesize ){
+ nbits_out = d_encoder->get_output_size();
+ } else {
+ nblocks = nbits_in / d_encoder->get_input_size();
+ if( nblocks * d_encoder->get_input_size() != nbits_in ){
+ printf("nblocks: %d, in_block_size: %d, got_input_size: %d\n",
+ nblocks, d_encoder->get_input_size(), nbits_in);
+ throw std::runtime_error("input does not divide into code block
size!");
+ }
+ nbits_out = nblocks * d_encoder->get_output_size();
+ }
- int nbits_out = d_encoder->get_output_size();
// buffers for output bits to go to
pmt::pmt_t outvec = pmt::make_u8vector(nbits_out, 0x00);
@@ -123,7 +135,9 @@ namespace gr {
d_encoder->generic_work((void*)d_bits_in, (void*)bits_out);
}
else {
- d_encoder->generic_work((void*)bits_in, (void*)bits_out);
+ for(size_t i=0; i<nblocks; i++){
+ d_encoder->generic_work((void*)
&bits_in[i*d_encoder->get_input_size()],
(void*)&bits_out[i*d_encoder->get_output_size()]);
+ }
}
pmt::pmt_t msg_pair = pmt::cons(meta, outvec);
diff --git a/gr-fec/lib/ldpc_encoder.cc b/gr-fec/lib/ldpc_encoder.cc
index e25eade..a181c28 100755
--- a/gr-fec/lib/ldpc_encoder.cc
+++ b/gr-fec/lib/ldpc_encoder.cc
@@ -58,11 +58,11 @@ int ldpc_encoder::get_input_size() {
void ldpc_encoder::generic_work(void *inBuffer, void *outBuffer) {
const unsigned char *in = (const unsigned char *) inBuffer;
- float *out = (float *) outBuffer;
+ unsigned char *out = (unsigned char *) outBuffer;
std::vector<char> inbuf(inputSize);
memcpy(&inbuf[0], in, inputSize);
std::vector<char> coded(d_code.encode(inbuf));
- for(size_t i=0; i<coded.size();i++){ out[i] = coded[i]; }
+ memcpy(&out[0], &coded[0], coded.size());
}
- [Commit-gnuradio] [gnuradio] branch master updated (7fe6115 -> 3061e47), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 16/43: fec: LDPC async decoder now running, git, 2015/04/02
- [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 <=
- [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, 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