Arm: Speed up FLOAT2INT16 conversion with Neon

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>
This commit is contained in:
Sandor Zsombor Vegh 2024-09-11 14:00:32 +02:00 committed by Jean-Marc Valin
parent edffe56b30
commit d4494e6ed7
No known key found for this signature in database
GPG key ID: 8D2952BBB52C646D
9 changed files with 277 additions and 4 deletions

View file

@ -98,6 +98,13 @@ static OPUS_INLINE opus_int32 float2int(float x) {return _mm_cvt_ss2si(_mm_set_s
return intgr ;
}
#elif defined(__aarch64__)
#include <arm_neon.h>
static OPUS_INLINE opus_int32 float2int(float flt)
{
return vcvtns_s32_f32(flt);
}
#elif defined(HAVE_LRINTF) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L