summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2016-08-15 19:50:45 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-08-15 19:50:45 -0400
commit18335e8e4d6ddb289b31d8a4a362f5e15c24ff0a (patch)
treead858be0da7779d53613f5dbe3136b481c40b8fd
parentb4d0df8ddee3b555369c571a60d76360e1ecfd86 (diff)
downloadopus-18335e8e4d6ddb289b31d8a4a362f5e15c24ff0a.tar.gz
Removed a float operation that sneaked in in the fixed-point code
-rw-r--r--celt/vq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/celt/vq.c b/celt/vq.c
index 2f864c2a..1fac70e2 100644
--- a/celt/vq.c
+++ b/celt/vq.c
@@ -210,8 +210,12 @@ opus_val16 op_pvq_search_c(celt_norm *X, int *iy, int K, int N, int arch)
while (++j<N);
sum = QCONST16(1.f,14);
}
+#ifdef FIXED_POINT
+ rcp = EXTRACT16(MULT16_32_Q16(K, celt_rcp(sum)));
+#else
/* Using K+e with e < 1 guarantees we cannot get more than K pulses. */
rcp = EXTRACT16(MULT16_32_Q16(K+0.8, celt_rcp(sum)));
+#endif
j=0; do {
#ifdef FIXED_POINT
/* It's really important to round *towards zero* here */