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

@ -1,6 +1,7 @@
/* Copyright (c) 2002-2008 Jean-Marc Valin
Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Copyright (c) 2024 Arm Limited
Written by Jean-Marc Valin, and Yunho Huh */
/**
@file mathops.h
@ -38,6 +39,10 @@
#include "entcode.h"
#include "os_support.h"
#if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
#include "arm/mathops_arm.h"
#endif
#define PI 3.141592653f
/* Multiplies two 16-bit fractional values. Bit-exactness of this macro is important */
@ -476,4 +481,15 @@ static OPUS_INLINE opus_val16 celt_atan2p(opus_val16 y, opus_val16 x)
}
#endif /* FIXED_POINT */
#ifndef DISABLE_FLOAT_API
void celt_float2int16_c(const float * OPUS_RESTRICT in, short * OPUS_RESTRICT out, int cnt);
#ifndef OVERRIDE_FLOAT2INT16
#define celt_float2int16(in, out, cnt, arch) ((void)(arch), celt_float2int16_c(in, out, cnt))
#endif
#endif /* DISABLE_FLOAT_API */
#endif /* MATHOPS_H */