Commit Graph

4158 Commits

Author SHA1 Message Date
Felicia Lim
c85499757c
Match silenced overflow checks in the sse4.1 version
Update silk/x86/NSQ_del_dec_sse4_1.c to match the remaining
silk/NSQ_del_dec.c changes made in
https://gitlab.xiph.org/xiph/opus/-/commit/c913dc38
2023-11-03 15:07:54 -07:00
Felicia Lim
c913dc38fd Silence some overflow checks
Co-authored-by: James Zern <jzern@google.com>
2023-10-23 15:50:15 -07:00
Jean-Marc Valin
101a71e03b
Fixes stack overflow for some custom modes
This only affects custom modes (builds with --enable-custom-modes) with frame
sizes 2.5, 5, 10, and 20ms and sampling rates below 40 kHz. The problem does
not affect normal use of Opus (using OpusEncoder/OpusDecoder) even when built
with custom modes enabled, but only special applications that use
OpusCustomEncoder/OpusCustomDecoder.
2023-08-11 04:06:52 -04:00
Marcus Asteborg
9fc8fc4cf4
Fix Gitlab CI
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2023-06-14 01:46:52 -04:00
Marcus Asteborg
5023249b5c
cmake instructions
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2023-05-27 17:32:31 -04:00
Tim-Philipp Müller
69b31099c6
ci: add ci-fairy linter to make sure commits are GPG signed 2023-04-27 16:23:52 +01:00
Tim-Philipp Müller
558a3c2a3f
ci: add arm64 CI 2023-04-26 14:18:21 -04:00
Tim-Philipp Müller
20c032d27c meson: fix build on arm64
Would fail like:

Checking if "compiler supports ARMv7/AArch64 NEON intrinsics" : links: NO
Checking if "compiler supports ARMv7/AArch64 NEON intrinsics with -mfpu=neon" : links: YES
Checking if "compiler supports AArch64 NEON intrinsics" : links: NO
Checking if "compiler supports AArch64 NEON intrinsics with -mfpu=neon" : links: NO
Message: Compiler does not support AArch64 NEON intrinsics
../silk/meson.build:28:45: ERROR: Unknown variable "have_arm_intrinsics_or_asm".

since commit 0808841125.
2023-04-26 12:42:03 +00:00
Claudio Saavedra
f3de7ca743
docs: replace fgrep with grep -F
It's been deprecated for decades and in Debian system it's starting
to print warnings. Just use grep -F instead.

Signed-off-by: Ralph Giles <giles@thaumas.net>
2023-04-20 15:13:19 -07:00
Jean-Marc Valin
82ac57d9f1
oops, avoid using a reserved identifier 2023-04-19 00:31:59 -04:00
Jean-Marc Valin
9efa0eac04
Avoid "ISO C forbids an empty translation unit"
Add dummy typedef to avoid the warning
2023-04-17 23:07:02 -04:00
Jean-Marc Valin
09f7f82ca6
Bump LT version
Added OPUS_SET_INBAND_FEC(2) since previous version
2023-04-17 22:50:28 -04:00
Zheng Lv
8cf872a186 Make CELT FFT twiddle complex type aligned
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>
2023-01-17 20:10:28 -08:00
Sam James
757c53f775
opus.m4: fix -Wstrict-prototypes
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-11-24 17:20:32 -08:00
Nathan E. Egge
bce1f39235
Fix typo in MacroDebug.h comment.
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2022-09-05 18:55:23 -04:00
Jean-Marc Valin
997fdf54e7
Change pitch scaling behavior wrt nFramesPerPacket
Not sure if it was the original intent, but we now reduce the
loss percentage threshold for pitch scaling as 1/nFramesPerPacket
since only the first frame will have pitch scaling anyway.
As a side effect, this brings back the original behavior of
disabling pitch scaling for 0% loss.
2022-08-04 19:02:02 -04:00
Jean-Marc Valin
ab04fbb1b7
Smooth out the LBRR rate estimate
Reduces fluctuations in the non-FEC target bitrate.
2022-07-24 03:46:16 -04:00
Jean-Marc Valin
fd9c0f1e1f
More FEC tuning: lowering the LBRR bitrate a bit 2022-07-24 02:16:03 -04:00
Jean-Marc Valin
5413ef7849
Re-tuning the use of LTP scaling
Making LTP scaling depend on the bitrate and whether FEC is on.
The thresholds for scaling 1 and 2 are now independent.
2022-07-24 02:12:03 -04:00
Jean-Marc Valin
378b4e5fc3
Ensuring we can see where crashes occur
Reviewed by Mark Harris
2022-07-22 12:22:47 -04:00
Jean-Marc Valin
4c6bae5078
More ubsan fixes for the debug macros themselves
Reviewed by Mark Harris
2022-07-22 12:22:41 -04:00
Jean-Marc Valin
e05aea9785
Using saturating round to fix some wrap-arounds
Reviewed by Mark Harris
2022-07-22 12:22:34 -04:00
Jean-Marc Valin
fbed746cb2
Relaxing checks for MULT16_32_QX()
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-22 12:22:12 -04:00
Jean-Marc Valin
c9d5bea13e
Fix NORM_ALIASING_HACK
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-15 15:01:38 -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
243987518a
Silence Clang 13+ null-pointer-subtraction warning 2022-07-10 16:25:01 -07:00
Timothy B. Terriberry
0808841125
Only build platform RTCD sources when enabled.
To avoid issues with empty compilation units.
2022-07-09 21:18:52 -07:00
Timothy B. Terriberry
71fb707875
Don't compile x86 cpu detection without RTCD.
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-09 21:18:52 -07:00
Timothy B. Terriberry
affb551e47
Make silk/x86 header indentation consistent.
The indentation for nested #ifs was all over the place.
2022-07-09 21:18:52 -07:00
Jean-Marc Valin
1504d2d4aa
Fix C90-related warnings 2022-07-09 03:15:18 -04:00
Marcus Asteborg
caf56aab41
update doc on custom mode
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2022-07-09 01:51:02 -04:00
Marcus Asteborg
1f891e3616
cmake - move warning C4244 to level 4
Opus compare is used to generate test vectors so no cosmetic changes
is taken. Hence we move this warning to level 4 for opus compare.

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-07-07 22:07:40 -07:00
Marcus Asteborg
510e1029b4
cmake - fix rtcd detection on x86 non windows
Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-07-07 22:07:33 -07:00
Marcus Asteborg
a80e9e9533
cmake - fix lrintf, lrint detection
This commit addresses the issues of not finding lrintf and lrint. We
switch to check_symbol_exists instead per cmake documentation. Also
make sure to link math lib for detection for nix.

For MSVC the issue for non x86 builds was that the standard was set to
default which is 199409L. This resulted in not using lrintf even that
it was found. To address this we set the C standard to C11 and it will
only apply to newer versions of MSVC where the /std flag is supported.

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-07-07 22:01:42 -07:00
Mark Harris
f1b088001e
Fix uninitialized field on custom mode malloc fail 2022-07-07 21:39:42 -07:00
Doug Nazar
4ad7d21081
meson: Fix reporting of cpu family if intrinsics not supported
Signed-off-by: Doug Nazar <nazard@nazar.ca>
2022-07-06 09:59:17 -07:00
Timothy B. Terriberry
918a09a344
Update x86 CPU detection configure check.
Commit 6577534a80 switched from using __get_cpuid() to
 __get_cpuid_count(), but the corresponding configure check was not
 updated.
Since __get_cpuid_count() was introduced much later, make sure we
 check for the function we actually use.

Thanks to Mark Harris for the report.
2022-07-06 09:59:12 -07:00
Jean-Marc Valin
50407983f2
Fix warnings when compiling with FUZZING enabled 2022-07-06 00:50:54 -04:00
Marcus Asteborg
4b8becdfc5
cmake - Add OPUS_BUILD to test targets
Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-07-05 20:38:37 -07:00
Mark Harris
51fb8955e4
doc: Use consistent alternative notation
Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-07-05 20:14:10 -07:00
Alexander Traud
99afa9c48e
Fix opus.h for doxygen when referencing alternative values
Doxygen was not able to resolve the references because it looked
for OPUS_APPLICATION_VOIP/@ref.

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-07-05 19:51:04 -07:00
Marcus Asteborg
4782baf0af
Remove unused variable in tests
Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-07-05 19:20:24 -07:00
Marcus Asteborg
683592180f
Replace assert with test_failed function in test
This will fix -Wunused-but-set-variable on gcc
9.3 release build. Also remove unused assert.h.

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
2022-07-05 19:07:43 -07:00
Jean-Marc Valin
271d488149
Fix warning with --disable-rfc8251 2022-07-05 21:58:02 -04:00
Mark Harris
bfebf824ad
Fix quoting and whitespace errors in build test
Reviewed by Jean-Marc Valin.
2022-07-05 18:25:07 -07:00
Mark Harris
ef10bf56c3
Silence GCC 11+ -Wmaybe-uninitialized warnings
Reviewed by Timothy B. Terriberry.
2022-07-05 15:16:03 -07:00
Jean-Marc Valin
98a6042bb6
Avoids incrementing uninitialized values
The values were never used, but ubsan + valgrind would complain.

Reviewed by Mark Harris
2022-07-05 17:27:32 -04:00
Jean-Marc Valin
8489ff3ffa
Avoid undefined behaviour within the debug macros
Even when the macro itself would overflow.

Reviewed by Mark Harris
2022-07-05 17:27:32 -04:00
Jean-Marc Valin
68d21fb5b0
Fix fixed-point overflow in pitch downsampling
Reviewed by Mark Harris
2022-07-05 17:27:32 -04:00
Jean-Marc Valin
78fe48adfb
Fix some 16-bit overflows (using 32-bit macros)
Reviewed by Mark Harris
2022-07-05 17:27:31 -04:00