diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2023-10-18 08:44:50 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-10-18 08:44:50 +0300 |
commit | 8c7c03e568ae6430018959f3f91d1f5745950069 (patch) | |
tree | 632aba52ef26d6deac23f513f642777c7bbb47fb /silk | |
parent | 0e397a7241a8dd0021acc0677c80c222c5156440 (diff) |
Don't call the libm tanh()
Diffstat (limited to 'silk')
-rw-r--r-- | silk/dred_coding.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/silk/dred_coding.c b/silk/dred_coding.c index af735faf..01792e0a 100644 --- a/silk/dred_coding.c +++ b/silk/dred_coding.c @@ -37,6 +37,7 @@ #include "os_support.h" #include "dred_config.h" #include "dred_coding.h" +#include "vec.h" #define LATENT_DIM 80 #define STATE_DIM 80 @@ -59,7 +60,7 @@ void dred_encode_latents(ec_enc *enc, const float *x, const opus_uint16 *scale, int q; delta = dzone[i]*(1.f/1024.f); xq = x[i]*scale[i]*(1.f/256.f); - xq = xq - delta*tanh(xq/(delta+eps)); + xq = xq - delta*tanh_approx(xq/(delta+eps)); q = (int)floor(.5f+xq); /* Make the impossible actually impossible. */ if (r[i] == 0 || p0[i] >= 32767) q = 0; |