The bug in gr_bytes_to_syms?

Hi, All,
Do you notice that the return of this function is noutput_items rather
than output_items? In this function , the noutput_items is the number of
the input_items and output_items. In my opinion, the output of this
function should be output_items. After all, what we concern is the
calculation result of the input data rather than the length of the data?
Does anyone thinks so?
Please clarify it for me!
Thanks!
Fangming

int
gr_bytes_to_syms::work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const unsigned char *in = (unsigned char *) input_items[0];
float *out = (float *) output_items[0];

assert (noutput_items % BITS_PER_BYTE == 0);

for (int i = 0; i < noutput_items / BITS_PER_BYTE; i++){
int x = in[i];

*out++ = (((x >> 7) & 0x1) << 1) - 1;
*out++ = (((x >> 6) & 0x1) << 1) - 1;
*out++ = (((x >> 5) & 0x1) << 1) - 1;
*out++ = (((x >> 4) & 0x1) << 1) - 1;
*out++ = (((x >> 3) & 0x1) << 1) - 1;
*out++ = (((x >> 2) & 0x1) << 1) - 1;
*out++ = (((x >> 1) & 0x1) << 1) - 1;
*out++ = (((x >> 0) & 0x1) << 1) - 1;

}

return noutput_items;
}

On Wed, Nov 11, 2009 at 04:34:16AM +0800, fangming he wrote:

Hi, All,

Do you notice that the return of this function is noutput_items
rather than output_items? In this function , the noutput_items is
the number of the input_items and output_items.

This is incorrect. The block is derived from gr_sync_interpolator,
with the final constructor arg to gr_sync_interpolator being
BITS_PER_BYTE (== 8), thus the noutput_items is always 8 * the number
of input items.

In my opinion, the output of this function should be
output_items. After all, what we concern is the calculation result
of the input data rather than the length of the data? Does anyone
thinks so?

Please clarify it for me!

You could also look at the corresponding QA code contained in
qa_fsk_stuff.py (found by using grep).

Thanks!
Fangming

Eric

Welcome back Eric!

why are we awake so late anyways?

On Tue, Nov 10, 2009 at 11:14:24PM -0800, Firas A. wrote:

Welcome back Eric!

Thanks Firas!

Eric