summaryrefslogtreecommitdiff
path: root/celt
Commit message (Collapse)AuthorAgeFilesLines
* Make CELT FFT twiddle complex type alignedZheng Lv2023-01-171-1/+11
| | | | | | | | | | | | This makes kiss_twiddle_cpx 4-byte aligned (instead of 2-byte) for fixed-point builds. Tested with an armv6j+nofp development board, CELT encoding becomes 1.4x as fast, and decoding over 2x. Performance gain is mostly attributed to the proper alignment of the static const array mdct_twiddles960. Co-authored-by: David Gao <davidgao@google.com> Signed-off-by: Felicia Lim <flim@google.com>
* Using saturating round to fix some wrap-aroundsJean-Marc Valin2022-07-222-9/+9
| | | | Reviewed by Mark Harris
* Relaxing checks for MULT16_32_QX()Jean-Marc Valin2022-07-221-2/+2
| | | | | | | | MULT16_32_QX() is now implemented using a signed-unsigned multiply, so the second argument can now have one extra bit compared to the old signed-signed implementation. Reviewed by Mark Harris
* Fix NORM_ALIASING_HACKJean-Marc Valin2022-07-151-5/+4
| | | | | | | We need to move the history out of the way before we write to the shape array X, or else we get corruption of the audio. Signed-off-by: Jean-Marc Valin <jmvalin@amazon.com>
* Silence MSVC C4244 warningMarcus Asteborg2022-07-121-1/+1
| | | | | | When building with FLOAT_APPROX. Signed-off-by: Mark Harris <mark.hsj@gmail.com>
* Silence Clang 13+ null-pointer-subtraction warningMark Harris2022-07-101-1/+1
|
* Only build platform RTCD sources when enabled.Timothy B. Terriberry2022-07-091-1/+7
| | | | To avoid issues with empty compilation units.
* Don't compile x86 cpu detection without RTCD.Timothy B. Terriberry2022-07-092-5/+9
| | | | | | | Also #error if RTCD is enabled without a detection method, like Arm. A number of SILK functions also still used the lookup tables, even when RTCD was disabled. Fix those, too.
* Fix C90-related warningsexp_warnings1Jean-Marc Valin2022-07-093-4/+6
|
* Fix uninitialized field on custom mode malloc failMark Harris2022-07-071-0/+3
|
* Fix warnings when compiling with FUZZING enabledJean-Marc Valin2022-07-061-0/+2
|
* Fix warning with --disable-rfc8251Jean-Marc Valin2022-07-051-0/+2
|
* Avoids incrementing uninitialized valuesJean-Marc Valin2022-07-051-4/+10
| | | | | | The values were never used, but ubsan + valgrind would complain. Reviewed by Mark Harris
* Fix fixed-point overflow in pitch downsamplingJean-Marc Valin2022-07-051-6/+15
| | | | Reviewed by Mark Harris
* Avoid left shifts of negative values in debug macrosJean-Marc Valin2022-07-051-3/+3
| | | | Reviewed by Mark Harris
* Work around UBSan unaligned access errors.Timothy B. Terriberry2022-07-051-1/+9
| | | | | | | The underlying objects are all 8-bit integers. Verified that the generated assembly still just uses MOVD. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Estimate the inner product accuracy to fix check-asmJean-Marc Valin2022-06-301-30/+21
| | | | | | Estimate the rounding error so that we can have a useful margin of error when checking the asm against the C code even when the float operations get reordered due to -ffast-math.
* Adds fuzzing to CPU detectionJean-Marc Valin2022-06-302-2/+18
| | | | | Makes ti possible to randomize (with --enable-fuzzing) the CPU flags so we can better test all the intrinsics implementations.
* Work around a valgrind false-positive in CPUID.Timothy B. Terriberry2022-06-281-4/+8
| | | | | | | Valgrind versions prior to 3.17.0 assume that an uninitialized value in ECX causes the whole output of CPUID to be uninitialized, even though ECX is only "read" by CPUID for certain values of EAX. Work around that by guaranteeing that ECX is initialized.
* Check the return value of __get_cpuid().Timothy B. Terriberry2022-06-281-2/+7
| | | | | | | | | | | This function can fail if CPUID is not supported or the maximum supported value of EAX is less than the requested one. Check the return value and explicitly disable all SIMD if it does fail. This was happening before implicitly because of the initialization of info[] to zero, but being explicit about it makes it less likely someone will break this behavior because they did not realize what was going on.
* Fixes --disable-rtcdJean-Marc Valin2022-06-282-5/+6
| | | | | Make sure we don't try to use the rtcd table when rtcd is disabled. That code still needs a lot more cleaning up.
* Silence some warnings for fixed-point debug buildsJean-Marc Valin2022-06-281-12/+12
| | | | Reviewed by Timothy B. Terriberry.
* Improve background noise estimation for CELT DTXJean-Marc Valin2022-06-261-21/+19
| | | | | | | | | | | We now update the background noise estimate even in frames classified as transient. It shouldn't be a problem because we're using min statistics. Also, it avoids problems when update frames get missclassified as transient. In addition, we now use the duration of losses rather than the number of lost packets to make decisions. That should make PLC/DTX behaviour more consistent across frame sizes.
* Fix lrint/lrintf detectionJean-Marc Valin2022-04-021-2/+2
| | | | | | Prevents using lrint/lrintf when compiling with -std=c90 even though the functions are in libm. This was causing tests to fail, likely due to incorrect prototypes.
* Initialize non-zero test arrays.Tom Denton2022-01-141-1/+4
| | | | Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Disable dangerous SSE 4.1 intrinsic optimizationsJean-Marc Valin2021-12-181-32/+2
| | | | | These could result in 16-byte-aligned loads on unaligned data, causing a segfault.
* Fix buffer overflow in xcorr_kernel_sse4_1Felicia Lim2021-12-141-3/+45
| | | | | | Before, an overflow can occur in the last loop if `len` is not a multiple of 4 as OP_CVTEPI16_EPI32_M64 tries to load 64 bits, but there are insufficient bits allocated in `x`.
* Remove an unused parameterFelicia Lim2021-07-071-4/+3
|
* Revert relaxing comparison to 0 for fixed point onlyFelicia Lim2021-06-101-1/+1
|
* Relax comparison to 0 to avoid a floating point divide-by-zero error.Felicia Lim2021-06-071-3/+7
|
* celt_lpc: avoid overflows when computing lpcs in fixed pointFelicia Lim2021-03-023-5/+104
| | | | | | | The LPCs are computed in 32-bit, so increase the allowed range from +/-8 to +/-64 to avoid overflows caught during fuzzing. Before downshifting back down to the +/-8 range in the final 16-bit output, perform bandwidth extension to avoid any additional overflow issues.
* Fix float-approx negative left shift UBMark Harris2021-01-231-2/+2
| | | | Reported by toto.
* docs: fix simple typo, neareast -> nearestTim Gates2020-12-081-2/+2
| | | | | | | | There is a small typo in celt/fixed_generic.h. Should read `nearest` rather than `neareast`. Signed-off-by: Ralph Giles <giles@thaumas.net>
* Add support for Meson build systemTim-Philipp Müller2020-10-282-0/+82
| | | | | | | | | | | | | | Tested on: - Linux/x86* with gcc - Android armv7 arm64 x86 x86_64 with clang - Windows x86 x86_64 with Visual Studio 2017 - Windows x86 x86_64 with MinGW - macOS x86_64 with clang - iOS arm64 x86_64 with clang Co-authored by: Nirbheek Chauhan <nirbheek@centricular.com> https://gitlab.xiph.org/xiph/opus/-/merge_requests/13
* Fix MSVC warning about trunction from double to floatNirbheek Chauhan2020-08-211-3/+3
| | | | | | Specify the precision as float to avoid truncating from double. Signed-off-by: Mark Harris <mark.hsj@gmail.com>
* Replace WIN32 with _WIN32 everywhereNirbheek Chauhan2020-08-211-2/+2
| | | | | | | | _WIN32 is defined on all Windows platforms by every compiler that targets Windows. We do not need WIN32 at all. Signed-off-by: Mark Harris <mark.hsj@gmail.com> Resolves https://github.com/xiph/opus/pull/104
* celt: Fix broken SSE pre-processor check due to typoNirbheek Chauhan2020-08-211-1/+1
| | | | | | This broke 5 years ago in 43120f00758219a784f952754f33b9788a8d731b Signed-off-by: Mark Harris <mark.hsj@gmail.com>
* Fix arm build with rtcd enabled.Ralph Giles2020-06-141-0/+2
| | | | | | | | | | | | | | | | | | The autotools build doesn't set OPUS_HAVE_RTCD for arm targets, assuming all the supported intrinsics will work on the runtime cpu. The cmake build however defines this by default when the neon extension is available on the target. On Linux, the runtime cpu detection reads /proc/cpuinfo, so removing stdio.h from celt/os_support.h meant that the cmake build for arm targets failed. We don't currently have ci runs for that configuration, so this only became apparent through manual testing. Signed-off-by: Marcus Asteborg <maastebo@microsoft.com> Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Fix trailing whitspace in previous commitMarcus Asteborg2020-06-131-3/+3
| | | | Signed-off-by: Ralph Giles <giles@thaumas.net>
* Prefer SSE and ASM implementation of float2int before lrintf for MSVCMarcus Asteborg2020-06-141-26/+32
| | | | Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Fix intrin0.h include guard.Ralph Giles2020-06-111-1/+1
| | | | | | | | | This lighter-weight intrinsics header is available starting with Microsoft Visual Studio 2017, so the previous change to allow this header failed when building with Visual Studio 2015. Restores the appveyor continuous integration build.
* Build time improvement, for MSVC use intrin0.h instead of intrin.h and ↵Marcus Asteborg2020-06-112-1/+4
| | | | | | remove usage of stdio.h in production code Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Disable message box when calling abort(). The message box is causing hangs ↵Marcus Asteborg2020-06-111-0/+3
| | | | | | in tests. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* fix equivalent bitrate calculation for <20ms frame sizesHector Martin2020-05-251-1/+1
| | | | | Signed-off-by: Hector Martin <marcan@marcan.st> Signed-off-by: Mark Harris <mark.hsj@gmail.com>
* Fix celt decoder assertion when using OPUS_CUSTOMNiclas Olmenius2020-04-131-1/+7
| | | | | | | When using OPUS_CUSTOM, `CELTDecoder->end` can be larger than 21. Assert against 25 instead in OPUS_CUSTOM builds. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Fix build errors using Makefile.mipsMark Harris2019-04-084-11/+6
| | | | Broken by earlier ARM optimizations.
* Fix #elif OPUS_ARM_INLINE_EDSPJean-Marc Valin2019-04-011-1/+1
| | | | Reported in https://github.com/xiph/opus/issues/108
* Fix mismatching arg names in function declaration and definitionFelicia Lim2019-03-011-1/+1
|
* Fix FIXED_POINT conditional checkevpobr2019-01-201-2/+2
| | | | Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Make float2int() static with VSJean-Marc Valin2018-10-311-2/+2
| | | | Addresses the rest of https://github.com/xiph/opus/pull/79