summaryrefslogtreecommitdiff
path: root/gr-fec/lib/async_decoder_impl.cc
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2015-09-25 10:52:44 -0400
committerTom Rondeau <tom@trondeau.com>2015-09-25 11:03:51 -0400
commit283ac81498c0ef8c1d9c7e5b7cabf35ac6eb414b (patch)
treeb7bb52ca150c82db9aa957c5cadf63dcc7b95985 /gr-fec/lib/async_decoder_impl.cc
parent649cf8c2f2280aa020287731ee3fdd2ce2454d4a (diff)
fec: Fixed async_decoder. Can't use nbits_out because it's 0 at this point.
Need to calculate based on nbits_in*rate.
Diffstat (limited to 'gr-fec/lib/async_decoder_impl.cc')
-rw-r--r--gr-fec/lib/async_decoder_impl.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/gr-fec/lib/async_decoder_impl.cc b/gr-fec/lib/async_decoder_impl.cc
index b5ae04be17..955aaa51e8 100644
--- a/gr-fec/lib/async_decoder_impl.cc
+++ b/gr-fec/lib/async_decoder_impl.cc
@@ -114,9 +114,9 @@ namespace gr {
int diff = d_decoder->rate()*d_decoder->get_input_size() - d_decoder->get_output_size();
size_t nbits_in = pmt::length(bits);
- size_t nbits_out = 0;
+ size_t nbits_out = 0;
size_t nblocks = 1;
- bool variable_frame_size = d_decoder->set_frame_size(nbits_out);
+ bool variable_frame_size = d_decoder->set_frame_size(nbits_in*d_decoder->rate());
// Check here if the frame size is larger than what we've
// allocated for in the constructor.
@@ -145,7 +145,6 @@ 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;
@@ -169,9 +168,10 @@ namespace gr {
d_decoder->generic_work((void*)d_tmp_u8, (void*)u8out);
}
else {
- for(size_t i=0; i<nblocks; i++){
- d_decoder->generic_work((void*)&d_tmp_f32[i*d_decoder->get_input_size()], (void*)&u8out[i*d_decoder->get_output_size()]);
- }
+ for(size_t i = 0; i < nblocks; i++){
+ 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()) );