diff options
Diffstat (limited to 'gr-blocks/lib/unpack_k_bits_bb_impl.cc')
-rw-r--r-- | gr-blocks/lib/unpack_k_bits_bb_impl.cc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/gr-blocks/lib/unpack_k_bits_bb_impl.cc b/gr-blocks/lib/unpack_k_bits_bb_impl.cc index 70055f9381..caf3d059d6 100644 --- a/gr-blocks/lib/unpack_k_bits_bb_impl.cc +++ b/gr-blocks/lib/unpack_k_bits_bb_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2010,2013 Free Software Foundation, Inc. + * Copyright 2005,2010,2013-2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -41,17 +41,16 @@ namespace gr { unpack_k_bits_bb_impl::unpack_k_bits_bb_impl(unsigned k) : sync_interpolator("unpack_k_bits_bb", - io_signature::make(1, 1, sizeof(unsigned char)), - io_signature::make(1, 1, sizeof(unsigned char)), - k), - d_k(k) + io_signature::make(1, 1, sizeof(unsigned char)), + io_signature::make(1, 1, sizeof(unsigned char)), + k) { - if(d_k == 0) - throw std::out_of_range("interpolation must be > 0"); + d_unpack = new kernel::unpack_k_bits(k); } unpack_k_bits_bb_impl::~unpack_k_bits_bb_impl() { + delete d_unpack; } int @@ -61,15 +60,9 @@ namespace gr { { const unsigned char *in = (const unsigned char *)input_items[0]; unsigned char *out = (unsigned char *)output_items[0]; - - int n = 0; - for(unsigned int i = 0; i < noutput_items/d_k; i++) { - unsigned int t = in[i]; - for(int j = d_k - 1; j >= 0; j--) - out[n++] = (t >> j) & 0x01; - } - assert(n == noutput_items); + d_unpack->unpack(out, in, noutput_items/d_unpack->k()); + return noutput_items; } |