diff --git a/lib/hackrf/hackrf_sink_c.cc b/lib/hackrf/hackrf_sink_c.cc index 1bb6f7e..1017151 100644 --- a/lib/hackrf/hackrf_sink_c.cc +++ b/lib/hackrf/hackrf_sink_c.cc @@ -217,7 +217,7 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args) set_if_gain( 16 ); /* preset to a reasonable default (non-GRC use case) */ - _buf = (unsigned char *) malloc( BUF_LEN ); + _buf = (char *) malloc( BUF_LEN ); cb_init( &_cbuf, _buf_num, BUF_LEN ); @@ -325,11 +325,9 @@ bool hackrf_sink_c::stop() } #ifdef USE_AVX -void convert_avx(const float* inbuf, unsigned char* outbuf,const unsigned int count) +void convert_avx(const float* inbuf, char* outbuf,const unsigned int count) { __m256 mulme = _mm256_set_ps(127.0f, 127.0f, 127.0f, 127.0f, 127.0f, 127.0f, 127.0f, 127.0f); - __m128i addme = _mm_set_epi16(127, 127, 127, 127, 127, 127, 127, 127); - for(unsigned int i=0; i> 8) - 127.5f) * (1.0f/128.0f) ) ); + _lut.push_back( gr_complex( (float(char(i & 0xff))) * (1.0f/128.0f), + (float(char(i >> 8))) * (1.0f/128.0f) ) ); #else // BOOST_BIG_ENDIAN - _lut.push_back( gr_complex( (float(i >> 8) - 127.5f) * (1.0f/128.0f), - (float(i & 0xff) - 127.5f) * (1.0f/128.0f) ) ); + _lut.push_back( gr_complex( (float(char(i >> 8))) * (1.0f/128.0f), + (float(char(i & 0xff))) * (1.0f/128.0f) ) ); #endif }