aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/convert/convert_with_neon.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-05-23 13:37:05 -0700
committerJosh Blum <josh@joshknows.com>2011-06-14 17:27:46 -0700
commit86f12cd1c1c606bbfbc6f0ddbd98166fe9251a13 (patch)
tree94cb1723707957dc0ff7288220ff24c6ca6bbb9e /host/lib/convert/convert_with_neon.cpp
parentfb85b0c9eb5a50a16e7568140d144650794774de (diff)
downloaduhd-86f12cd1c1c606bbfbc6f0ddbd98166fe9251a13.tar.gz
uhd-86f12cd1c1c606bbfbc6f0ddbd98166fe9251a13.tar.bz2
uhd-86f12cd1c1c606bbfbc6f0ddbd98166fe9251a13.zip
uhd: added scaling factor to conversion routines
Diffstat (limited to 'host/lib/convert/convert_with_neon.cpp')
-rw-r--r--host/lib/convert/convert_with_neon.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/host/lib/convert/convert_with_neon.cpp b/host/lib/convert/convert_with_neon.cpp
index 3d677db5b..e5f08cad9 100644
--- a/host/lib/convert/convert_with_neon.cpp
+++ b/host/lib/convert/convert_with_neon.cpp
@@ -26,7 +26,7 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_nswap, PRIORITY_CUSTOM){
size_t i;
- float32x4_t Q0 = vdupq_n_f32(shorts_per_float);
+ float32x4_t Q0 = vdupq_n_f32(float(scale_factor));
for (i=0; i < (nsamps & ~0x03); i+=2) {
float32x4_t Q1 = vld1q_f32(reinterpret_cast<const float *>(&input[i]));
float32x4_t Q2 = vmulq_f32(Q1, Q0);
@@ -37,7 +37,7 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_nswap, PRIORITY_CUSTOM){
}
for (; i < nsamps; i++)
- output[i] = fc32_to_item32(input[i]);
+ output[i] = fc32_to_item32(input[i], float(scale_factor));
}
DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){
@@ -46,7 +46,7 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){
size_t i;
- float32x4_t Q1 = vdupq_n_f32(floats_per_short);
+ float32x4_t Q1 = vdupq_n_f32(float(scale_factor));
for (i=0; i < (nsamps & ~0x03); i+=2) {
int16x4_t D0 = vld1_s16(reinterpret_cast<const int16_t *>(&input[i]));
int16x4_t D1 = vrev32_s16(D0);
@@ -57,5 +57,5 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){
}
for (; i < nsamps; i++)
- output[i] = item32_to_fc32(input[i]);
+ output[i] = item32_to_fc32(input[i], float(scale_factor));
}