Using Neon for float to int conversion, and introducing platform-
specific function for converting an array of float values to int16.
Also adding appropriate unit test.
Signed-off-by: Jean-Marc Valin <jeanmarcv@google.com>
The exp2 function was approximated using lolremez, achieving an
accuracy of less than 2*10^-7 within the range of 0 to 1.
Signed-off-by: Jean-Marc Valin <jeanmarcv@google.com>
The log2 function was approximated using lolremez, achieving an
accuracy of less than 1.4*10^-8 within the range of 1 to 2.
Signed-off-by: Jean-Marc Valin <jeanmarcv@google.com>
Newer versions of MSVC are unhappy with the strategy of the build
environment redefining "inline" (even though they don't support the
actual keyword). Instead we define OPUS_INLINE to the right thing
in opus_defines.h.
This is the same approach we use for restrict.
The overflows reported were:
- Syy in find_best_pitch() in pitch.c
- xy, xx and yy in remove_doubling() in pitch.c
The fixes are:
- Adaptive scaling in pitch_downsample() which also improves quality
- Adding a missing downshift in find_best_pitch()
- More conservative yshift when calling find_best_pitch()