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:
parent
edffe56b30
commit
d4494e6ed7
9 changed files with 277 additions and 4 deletions
|
@ -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 */
|
||||
/**
|
||||
@file mathops.h
|
||||
|
@ -35,6 +36,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "float_cast.h"
|
||||
#include "mathops.h"
|
||||
|
||||
/*Compute floor(sqrt(_val)) with exact arithmetic.
|
||||
|
@ -215,3 +217,16 @@ opus_val32 celt_rcp(opus_val32 x)
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_FLOAT_API
|
||||
|
||||
void celt_float2int16_c(const float * OPUS_RESTRICT in, short * OPUS_RESTRICT out, int cnt)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < cnt; i++)
|
||||
{
|
||||
out[i] = FLOAT2INT16(in[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* DISABLE_FLOAT_API */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue