diff options
author | Nick Foster | 2011-01-21 18:24:02 -0800 |
---|---|---|
committer | Nick Foster | 2011-01-21 18:24:02 -0800 |
commit | f832c9789be9fec46e211be4fb2355013d19c000 (patch) | |
tree | d9219c50cf4e864ceeed30c0d700276b14c38546 | |
parent | 6091bad60cdfdf21624da452c7a8b74405345070 (diff) | |
download | gnuradio-f832c9789be9fec46e211be4fb2355013d19c000.tar.gz gnuradio-f832c9789be9fec46e211be4fb2355013d19c000.tar.bz2 gnuradio-f832c9789be9fec46e211be4fb2355013d19c000.zip |
Volk: Small changes to speed things up.
-rw-r--r-- | volk/include/volk/volk_16ic_deinterleave_real_8i_a16.h | 4 | ||||
-rw-r--r-- | volk/include/volk/volk_32f_s32f_convert_8i_a16.h | 2 | ||||
-rw-r--r-- | volk/lib/qa_utils.cc | 2 | ||||
-rw-r--r-- | volk/lib/testqa.cc | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/volk/include/volk/volk_16ic_deinterleave_real_8i_a16.h b/volk/include/volk/volk_16ic_deinterleave_real_8i_a16.h index cfbebd57b..55a25702e 100644 --- a/volk/include/volk/volk_16ic_deinterleave_real_8i_a16.h +++ b/volk/include/volk/volk_16ic_deinterleave_real_8i_a16.h @@ -53,7 +53,7 @@ static inline void volk_16ic_deinterleave_real_8i_a16_ssse3(int8_t* iBuffer, con number = sixteenthPoints * 16; int16_t* int16ComplexVectorPtr = (int16_t*)complexVectorPtr; for(; number < num_points; number++){ - *iBufferPtr++ = ((int8_t)(*int16ComplexVectorPtr++ / 256)); + *iBufferPtr++ = ((int8_t)(*int16ComplexVectorPtr++ >> 8)); int16ComplexVectorPtr++; } } @@ -71,7 +71,7 @@ static inline void volk_16ic_deinterleave_real_8i_a16_generic(int8_t* iBuffer, c int16_t* complexVectorPtr = (int16_t*)complexVector; int8_t* iBufferPtr = iBuffer; for(number = 0; number < num_points; number++){ - *iBufferPtr++ = ((int8_t)(*complexVectorPtr++ / 256)); + *iBufferPtr++ = ((int8_t)(*complexVectorPtr++ >> 8)); complexVectorPtr++; } } diff --git a/volk/include/volk/volk_32f_s32f_convert_8i_a16.h b/volk/include/volk/volk_32f_s32f_convert_8i_a16.h index c91448951..f64f2a213 100644 --- a/volk/include/volk/volk_32f_s32f_convert_8i_a16.h +++ b/volk/include/volk/volk_32f_s32f_convert_8i_a16.h @@ -106,7 +106,7 @@ static inline void volk_32f_s32f_convert_8i_a16_generic(int8_t* outputVector, co unsigned int number = 0; for(number = 0; number < num_points; number++){ - *outputVectorPtr++ = ((int8_t)(*inputVectorPtr++ * scalar)); + *outputVectorPtr++ = (int8_t)(*inputVectorPtr++ * scalar); } } #endif /* LV_HAVE_GENERIC */ diff --git a/volk/lib/qa_utils.cc b/volk/lib/qa_utils.cc index 67ce5ddef..9cafd459f 100644 --- a/volk/lib/qa_utils.cc +++ b/volk/lib/qa_utils.cc @@ -32,7 +32,7 @@ void load_random_data(void *data, volk_type_t type, unsigned int n) { if(type.size == 8) random_floats<double>((double *)data, n); else random_floats<float>((float *)data, n); } else { - float int_max = pow(2, type.size*8); + float int_max = float(uint64_t(2) << (type.size*8)); if(type.is_signed) int_max /= 2.0; for(int i=0; i<n; i++) { float scaled_rand = (((float) (rand() - (RAND_MAX/2))) / static_cast<float>((RAND_MAX/2))) * int_max; diff --git a/volk/lib/testqa.cc b/volk/lib/testqa.cc index 9f4934dc0..4cef7b443 100644 --- a/volk/lib/testqa.cc +++ b/volk/lib/testqa.cc @@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(volk_test_all) { VOLK_RUN_TESTS(volk_32fc_deinterleave_real_64f_a16, 1e-4, 0, 2046, 10000); VOLK_RUN_TESTS(volk_32fc_x2_dot_prod_32fc_a16, 1e-4, 0, 2046, 10000); VOLK_RUN_TESTS(volk_32fc_index_max_16u_a16, 0, 0, 2046, 10000); - VOLK_RUN_TESTS(volk_32fc_s32f_magnitude_16i_a16, 0, 32768, 2046, 10000); + VOLK_RUN_TESTS(volk_32fc_s32f_magnitude_16i_a16, 1, 32768, 2046, 10000); VOLK_RUN_TESTS(volk_32fc_magnitude_32f_a16, 1e-4, 0, 2046, 10000); VOLK_RUN_TESTS(volk_32fc_x2_multiply_32fc_a16, 1e-4, 0, 2046, 10000); VOLK_RUN_TESTS(volk_32f_s32f_convert_16i_a16, 1, 32768, 2046, 10000); |