Commit graph

26 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
8b4f3f646d
Fix warnings about unsigned integer overflows
Silences -fsanitize=unsigned-integer-overflow even though the code was
valid (not undefined) C.
2025-03-05 11:37:16 -05: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
Jean-Marc Valin
4ba06d9e32
Increasing log gain resolution to DB_SHIFT=24 2025-02-13 12:50:02 -05:00
Jean-Marc Valin
82485dd2c4
Preserving 24-bit accuracy for fixed-point encoder 2025-02-13 12:49:46 -05:00
Jean-Marc Valin
3b68a48659
Add LPC-based tone detection
Detecting tones can help us prevent the encoder from getting confused
by them.
2025-02-12 13:40:22 -05:00
Michael Klingbeil
17bb81934b
add undefs in mathops.h and remove OPUS_INLINE in vec_neon.h 2023-06-30 22:54:09 -04:00
Marcus Asteborg
e4a74ddeb9
Silence MSVC C4244 warning
When building with FLOAT_APPROX.

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-07-12 20:29:32 -07:00
Mark Harris
d633f523e3
Fix float-approx negative left shift UB
Reported by toto.
2021-01-23 15:06:54 -08:00
Jean-Marc Valin
ef203135b4
Adding ENABLE_HARDENING
Enables "safes" assertions even with ENABLE_ASSERTIONS isn't set
2018-03-27 15:13:25 -04:00
Jean-Marc Valin
82e6cf79c1
Fix #undef of constant
Reported in https://github.com/xiph/opus/issues/55
2017-10-08 03:09:58 -04:00
Jean-Marc Valin
7f3fb20185 Fixes problem with M_PI 2016-08-11 23:23:46 -04:00
Jean-Marc Valin
2ff6556f1f Making stereo_itheta() use the same atan2() approximation as tonality_analysis() 2016-08-11 11:05:51 -04:00
Gregory Maxwell
7830cf1bd2 Replace "inline" with OPUS_INLINE.
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.
2013-10-28 10:18:54 -07:00
Jean-Marc Valin
942fc816d1 Replaces log2() with celt_log2() and fixes a potential divide-by-zero 2013-10-01 19:27:30 -04:00
Jean-Marc Valin
7fd98c571f Converts denormalise_bands() to use 16-bit multiplications 2013-06-16 21:56:41 -04:00
Jean-Marc Valin
b7bd4c20ac celt_maxabs16() now returns an opus_val32 to avoid problems with -32768 2013-05-18 23:52:18 -04:00
Jean-Marc Valin
702458ac82 Should make celt_maxabs*() slightly faster
shorter dependencies
2012-11-12 15:47:17 -05:00
Jean-Marc Valin
cf1053dc85 Implements OPUS_{GET,SET}_LSB_DEPTH
This is used to avoid dynalloc doing silly things on periodic LSB
patterns and to reduce the bitrate on near-silence.
2012-07-13 14:52:52 -04:00
Jean-Marc Valin
ab5a049705 Merge commit '390c89225d' 2012-04-24 13:39:22 -04:00
Jean-Marc Valin
cb05e7cd96 s/FOUNDATION/COPYRIGHT OWNER/ in CELT code and "glue code"
Also added 3rd clause to "master" COPYING file
2012-04-20 16:41:42 -04:00
Jean-Marc Valin
178758b81a Fixes some overflows in the fixed-point pitch code
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()
2012-04-06 23:32:11 -04:00
Jean-Marc Valin
c37499090b renames the libcelt/ directory to celt/ 2011-09-13 18:21:18 -07:00
Renamed from libcelt/mathops.h (Browse further)