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;
}

                                          
_________________________________________________________________
Windows Live Hotmail: Your friends can get your Facebook updates, right from 
HotmailĀ®.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092009
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to