diff options
author | Josh Blum <josh@joshknows.com> | 2011-06-15 14:50:02 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-06-15 14:50:02 -0700 |
commit | 0cef788d3d34a298c975e32c488e800a5c65ccce (patch) | |
tree | 14b7f4242a28927b1701a73a3e8ec0df3fa04811 /host/lib/convert/convert_with_sse2.cpp | |
parent | 7951170c6161d9266726ec19e8c009500cf11f75 (diff) | |
parent | 27f1622d439ceb787e7dada733d0eb82270c5532 (diff) | |
download | uhd-0cef788d3d34a298c975e32c488e800a5c65ccce.tar.gz uhd-0cef788d3d34a298c975e32c488e800a5c65ccce.tar.bz2 uhd-0cef788d3d34a298c975e32c488e800a5c65ccce.zip |
Merge branch 'next'
Diffstat (limited to 'host/lib/convert/convert_with_sse2.cpp')
-rw-r--r-- | host/lib/convert/convert_with_sse2.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/host/lib/convert/convert_with_sse2.cpp b/host/lib/convert/convert_with_sse2.cpp index 96ee9134c..52beea24a 100644 --- a/host/lib/convert/convert_with_sse2.cpp +++ b/host/lib/convert/convert_with_sse2.cpp @@ -25,7 +25,7 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_nswap, PRIORITY_CUSTOM){ const fc32_t *input = reinterpret_cast<const fc32_t *>(inputs[0]); item32_t *output = reinterpret_cast<item32_t *>(outputs[0]); - __m128 scalar = _mm_set_ps1(shorts_per_float); + __m128 scalar = _mm_set_ps1(float(scale_factor)); //convert blocks of samples with intrinsics size_t i = 0; for (; i < (nsamps & ~0x3); i+=4){ @@ -48,7 +48,7 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_nswap, PRIORITY_CUSTOM){ //convert remainder for (; i < nsamps; i++){ - output[i] = fc32_to_item32(input[i]); + output[i] = fc32_to_item32(input[i], float(scale_factor)); } } @@ -56,7 +56,7 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_bswap, PRIORITY_CUSTOM){ const fc32_t *input = reinterpret_cast<const fc32_t *>(inputs[0]); item32_t *output = reinterpret_cast<item32_t *>(outputs[0]); - __m128 scalar = _mm_set_ps1(shorts_per_float); + __m128 scalar = _mm_set_ps1(float(scale_factor)); //convert blocks of samples with intrinsics size_t i = 0; for (; i < (nsamps & ~0x3); i+=4){ @@ -78,7 +78,7 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_bswap, PRIORITY_CUSTOM){ //convert remainder for (; i < nsamps; i++){ - output[i] = uhd::byteswap(fc32_to_item32(input[i])); + output[i] = uhd::byteswap(fc32_to_item32(input[i], float(scale_factor))); } } @@ -86,7 +86,7 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){ const item32_t *input = reinterpret_cast<const item32_t *>(inputs[0]); fc32_t *output = reinterpret_cast<fc32_t *>(outputs[0]); - __m128 scalar = _mm_set_ps1(floats_per_short/(1 << 16)); + __m128 scalar = _mm_set_ps1(float(scale_factor)/(1 << 16)); __m128i zeroi = _mm_setzero_si128(); //convert blocks of samples with intrinsics @@ -111,7 +111,7 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){ //convert remainder for (; i < nsamps; i++){ - output[i] = item32_to_fc32(input[i]); + output[i] = item32_to_fc32(input[i], float(scale_factor)); } } @@ -119,7 +119,7 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_bswap, PRIORITY_CUSTOM){ const item32_t *input = reinterpret_cast<const item32_t *>(inputs[0]); fc32_t *output = reinterpret_cast<fc32_t *>(outputs[0]); - __m128 scalar = _mm_set_ps1(floats_per_short/(1 << 16)); + __m128 scalar = _mm_set_ps1(float(scale_factor)/(1 << 16)); __m128i zeroi = _mm_setzero_si128(); //convert blocks of samples with intrinsics @@ -143,6 +143,6 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_bswap, PRIORITY_CUSTOM){ //convert remainder for (; i < nsamps; i++){ - output[i] = item32_to_fc32(uhd::byteswap(input[i])); + output[i] = item32_to_fc32(uhd::byteswap(input[i]), float(scale_factor)); } } |