Commit graph

25 commits

Author SHA1 Message Date
Sandor Zsombor Vegh
d4494e6ed7
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>
2025-03-24 10:38:14 -04:00
Jean-Marc Valin
5a29ca93ac
Looser error bound for celt_log2() 2025-03-14 17:51:14 -04:00
Yunho Huh
ea3eb56a01
Update the celt_exp2_db to match the new floating point celt_exp2.
Change-Id: Ib016fc8f0066980e3e5122b3f286680adc228ff9
Signed-off-by: Jean-Marc Valin <jeanmarcv@google.com>
2025-02-13 12:50:04 -05:00
Yunho Huh
255f013035
Improve exp2's precision to 20-24 bits.
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>
2025-02-13 12:50:03 -05:00
Yunho Huh
7fa23b4ed0
Update celt_log2_db fixed point to match new celt_log2 floating point.
Change-Id: Ibd0d16918272cb568923d384475e139dc312c61b
Signed-off-by: Jean-Marc Valin <jeanmarcv@google.com>
2025-02-13 12:50:03 -05:00
Yunho Huh
e75503be94
Improve log2's precision to 20-24 bits.
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>
2025-02-13 12:50:03 -05:00
Nirbheek Chauhan
034c1b61a2
Fix MSVC warning about trunction from double to float
Specify the precision as float to avoid truncating from double.

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2020-08-21 23:41:40 -07:00
Jean-Marc Valin
4507637ccc
Fixes unit tests that need arch-specific code
We now include the object files for those rather than attempt to
problems.
2017-05-25 19:30:59 -04:00
Jean-Marc Valin
76674feae2 SSE2 implementation of the PVQ search
We used the SSE reciprocal square root instruction to vectorize the serch rather
than compare one at a time with multiplies. Speeds up the entire encoder by 8-10%.
2016-08-09 23:22:27 -04:00
Jonathan Lennox
19677f6b06 Fix unit tests on ARM without RTCD (e.g. aarch64 or iOS). 2015-11-02 18:56:13 -08:00
Viswanath Puttagunta
ba8713ccb5 armv7: Optimize fixed point FFT using NE10 library
Uses NEON optimized fixed point FFT routines in NE10 library.

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2015-10-07 18:09:20 -04:00
Viswanath Puttagunta
f48abe8308 armv7(float): Optimize encode usecase using NE10 library
Optimize opus encode (float only) usecase using ARM NE10
library. Mainly effects opus_fft and ctl_mdct_forward
and related functions.

This optimization can be used for ARM CPUs that have NEON
VFP unit. This patch only enables optimizations for ARMv7.

Official ARM NE10 library page available at
http://projectne10.github.io/Ne10/

To enable this optimization, use
--enable-intrinsics --with-NE10=<install_prefix>
or
--enable-intrinsics --with-NE10-libraries=<NE10_lib_dir> --with-NE10-includes=<NE10_includes_dir>

Compile time checks made during configure process to make sure
optimization option available only when compiler supports NEON
instrinsics.

Runtime checks made to make sure optimized functions only called
on appropriate hardware.

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2015-10-07 18:09:20 -04:00
Jonathan Lennox
cb0875e07d Move SSE2 and SSE4.1 intrinsics functions to separate files, to be compiled with appropriate compiler flags. Otherwise, compilers are allowed to take advantage of (e.g.) -msse4.1 to generate code that uses SSE4.1 instructions, even when no SSE4.1 intrinsics are explicitly used in the source. 2015-09-01 17:21:31 -04:00
Viswanath Puttagunta
0b0a2b4d06 armv7: celt_pitch_xcorr: Introduce ARM NEON intrinsics
Optimize celt_pitch_xcorr function (for floating point)
using ARM NEON intrinsics for SoCs that have NEON VFP unit.

To enable this optimization, use --enable-intrinsics
configure option.

Compile time and runtime checks are also supported to make sure
this optimization is only enabled when the compiler supports
NEON intrinsics.

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2014-12-25 14:36:46 -08:00
Tristan Matthews
fd562eefa2 tests: fix linking for --enable-fixed-point on ARM 2014-10-12 15:12:52 -04:00
Timothy B. Terriberry
554b349cdb There are no tabs in source code.
There is also no trailing whitespace.
2014-10-03 21:49:57 -07:00
xiangmingzhu
c95c9a048f Cisco optimization for x86 & fixed point
1. Only for fixed point on x86 platform (32bit and 64bit, uses SIMD
   intrinsics up to SSE4.2)
2. Use "configure --enable-fixed-point --enable-intrinsics" to enable
   optimization, default is disabled.
3. Official test cases are verified and passed.

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2014-10-03 21:16:00 -04:00
Gregory Maxwell
5280c71883 Revert "Fixes a number of double promotions and missing casts."
This reverts commit 43279728cd.
2013-07-15 15:51:24 -07:00
Gregory Maxwell
43279728cd Fixes a number of double promotions and missing casts.
At a minimum MSVC warns on some of this stuff.
2013-07-15 15:23:03 -07:00
Jean-Marc Valin
ee2506b2c7 Moves log2Amp inside denormalise_bands() and get rid of bandE[]
Also get rid of the MSE measurement code which is outdated and no longer useful
2013-06-16 20:24:52 -04:00
Jean-Marc Valin
00898f2091 Adds missing license headers on some scripts and test files 2012-10-30 01:26:36 -04:00
Gregory Maxwell
de74fc1b6b Remove C99ism in celt/tests/test_unit_mathops.c w/ fixed point build. 2012-08-19 19:42:49 -04:00
Timothy B. Terriberry
02f19c26f1 Fix fixed-point testilog2.
Use exact integer operations to confirm the value returned is the
 correct one.
2012-08-06 13:08:11 -04:00
Ralph Giles
cb3cc53014 Fix --enable-fixed-point-debug.
Use the celt_mips defined in fixed_debug.h from the unit tests
by defining CELT_C earlier. We must export celt_mips so it can
be used by clients calling the library, like opus_custom_demo.
2012-03-05 17:09:53 -08:00
Gregory Maxwell
9652f81eb9 Test cleanups and renaming.
Build tests in the tests/ directory instead of top, cleanup, rename,
and eliminate recursive make for the celt/ unit tests.
2011-10-27 06:27:13 -04:00
Renamed from celt/tests/mathops-test.c (Browse further)