aboutsummaryrefslogtreecommitdiff
path: root/celt
AgeCommit message (Collapse)Author
2023-01-18Upgrade libopus to 8cf872a186b96085b1bb3a547afd598354ebeb87main-16k-with-phonesSadaf Ebrahimi
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update libopus For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md Test: TreeHugger Change-Id: Ifb9d10d5a1ccb2e7c117b58494c05eb46835f0ad
2023-01-17Make CELT FFT twiddle complex type alignedZheng Lv
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>
2022-10-10Upgrade libopus to bce1f392353d72d77d543bb2069a044ae1045e9dSadaf Ebrahimi
Test: Treehugger Change-Id: Id73447aa0fc7c873f1a476c95b02606ec6f7a2f6
2022-07-25Merge commit 'c9d5bea13e3cb7381bfa897a45d8bab4e7b767a7' into HEADHarish Mahendrakar
Bug: 240201310 Test: atest CtsMediaV2TestCases -- --module-arg \ CtsMediaV2TestCases:instrumentation-arg:codec-prefix:=c2.android.opus. Change-Id: I8c30b927e81e707efbb13cf9265cbbef0e344152
2022-07-22Using saturating round to fix some wrap-aroundsJean-Marc Valin
Reviewed by Mark Harris
2022-07-22Relaxing checks for MULT16_32_QX()Jean-Marc Valin
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
2022-07-15Fix NORM_ALIASING_HACKJean-Marc Valin
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>
2022-07-12Silence MSVC C4244 warningMarcus Asteborg
When building with FLOAT_APPROX. Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-07-10Silence Clang 13+ null-pointer-subtraction warningMark Harris
2022-07-09Only build platform RTCD sources when enabled.Timothy B. Terriberry
To avoid issues with empty compilation units.
2022-07-09Don't compile x86 cpu detection without RTCD.Timothy B. Terriberry
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.
2022-07-09Fix C90-related warningsJean-Marc Valin
2022-07-07Fix uninitialized field on custom mode malloc failMark Harris
2022-07-06Fix warnings when compiling with FUZZING enabledJean-Marc Valin
2022-07-05Fix warning with --disable-rfc8251Jean-Marc Valin
2022-07-05Avoids incrementing uninitialized valuesJean-Marc Valin
The values were never used, but ubsan + valgrind would complain. Reviewed by Mark Harris
2022-07-05Fix fixed-point overflow in pitch downsamplingJean-Marc Valin
Reviewed by Mark Harris
2022-07-05Avoid left shifts of negative values in debug macrosJean-Marc Valin
Reviewed by Mark Harris
2022-07-05Work around UBSan unaligned access errors.Timothy B. Terriberry
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>
2022-06-30Estimate the inner product accuracy to fix check-asmJean-Marc Valin
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.
2022-06-30Adds fuzzing to CPU detectionJean-Marc Valin
Makes ti possible to randomize (with --enable-fuzzing) the CPU flags so we can better test all the intrinsics implementations.
2022-06-28Work around a valgrind false-positive in CPUID.Timothy B. Terriberry
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.
2022-06-28Check the return value of __get_cpuid().Timothy B. Terriberry
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.
2022-06-28Fixes --disable-rtcdJean-Marc Valin
Make sure we don't try to use the rtcd table when rtcd is disabled. That code still needs a lot more cleaning up.
2022-06-28Silence some warnings for fixed-point debug buildsJean-Marc Valin
Reviewed by Timothy B. Terriberry.
2022-06-26Improve background noise estimation for CELT DTXJean-Marc Valin
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.
2022-04-02Fix lrint/lrintf detectionJean-Marc Valin
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.
2022-01-14Initialize non-zero test arrays.Tom Denton
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2021-12-18Disable dangerous SSE 4.1 intrinsic optimizationsJean-Marc Valin
These could result in 16-byte-aligned loads on unaligned data, causing a segfault.
2021-12-14Fix buffer overflow in xcorr_kernel_sse4_1Felicia Lim
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`.
2021-09-28libOpus: fix OOB read in ssse4 correlation kernelNeelkamal Semwal
Few SIMD functions read 16 bytes at a time and this potentially leads to OOB read for some buffers allocated on stack using ALLOC() calls. In order to avoid these OOB reads, ALLOC() now allocates 16 additional bytes. Bug: 191352053 Test: poc in bug description Test: atest VtsHalMediaC2V1_0TargetAudioDecTest Test: atest VtsHalMediaC2V1_0TargetAudioEncTest Change-Id: I4da2840844d60f251dd7a222f51d508e4eb8749f (cherry picked from commit 878bdeb38043407869c684fb73708b04e8fe0ce4)
2021-07-07Remove an unused parameterFelicia Lim
2021-06-10Revert relaxing comparison to 0 for fixed point onlyFelicia Lim
2021-06-07Relax comparison to 0 to avoid a floating point divide-by-zero error.Felicia Lim
2021-03-02celt_lpc: avoid overflows when computing lpcs in fixed pointFelicia Lim
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.
2021-02-05Upgrade libopus to d633f523e36e3b6d01cc6d57386458d770d618beHaibo Huang
Test: make Change-Id: I719a5daa80f9e79d42e66cc66306fdbad4dbe3c1
2021-01-23Fix float-approx negative left shift UBMark Harris
Reported by toto.
2021-01-05Upgrade libopus to 794392ecd77e6fc6aafa62c3f6002780abcc2c7cHaibo Huang
Test: make Change-Id: I3e5232d6c6d250c69abfa71482ac91e30c1933b6
2020-12-08docs: fix simple typo, neareast -> nearestTim Gates
There is a small typo in celt/fixed_generic.h. Should read `nearest` rather than `neareast`. Signed-off-by: Ralph Giles <giles@thaumas.net>
2020-11-30Upgrade libopus to d2f6805c3f36718a742c33c56eb945c2e10646efHaibo Huang
Test: make Change-Id: I995f04a04951ca22916a7b418afdd8ba59bcd130
2020-10-28Add support for Meson build systemTim-Philipp Müller
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
2020-10-01Merge branch 'upstream-master'Harish Mahendrakar
Bug: 167721530 Test: atest android.mediav2.cts Test: run vts -m VtsHalMediaC2V1_0TargetAudioDecTest Test: run vts -m VtsHalMediaC2V1_0TargetAudioEncTest Change-Id: Id6900a9d5084fb6ae840f44a2b9133f95e1b96bc
2020-09-11Merge tag 'v1.3' into masterHarish Mahendrakar
This merges tag v1.3 from upstream-master and establishes history between upstream-master and master This better positions the code for automating future pulls from the upstream repository. Bug: 167721530 Test: builds Change-Id: Ieb361bade32dd21ab7dadbb74b79d3ee3c13ec1a
2020-08-21Fix MSVC warning about trunction from double to floatNirbheek Chauhan
Specify the precision as float to avoid truncating from double. Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2020-08-21Replace WIN32 with _WIN32 everywhereNirbheek Chauhan
_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
2020-08-21celt: Fix broken SSE pre-processor check due to typoNirbheek Chauhan
This broke 5 years ago in 43120f00758219a784f952754f33b9788a8d731b Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2020-06-14Fix arm build with rtcd enabled.Ralph Giles
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>
2020-06-13Fix trailing whitspace in previous commitMarcus Asteborg
Signed-off-by: Ralph Giles <giles@thaumas.net>
2020-06-14Prefer SSE and ASM implementation of float2int before lrintf for MSVCMarcus Asteborg
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2020-06-11Fix intrin0.h include guard.Ralph Giles
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.