Commit Graph

125 Commits

Author SHA1 Message Date
Jean-Marc Valin
378b4e5fc3
Ensuring we can see where crashes occur
Reviewed by Mark Harris
2022-07-22 12:22:47 -04: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
Mark Harris
bfebf824ad
Fix quoting and whitespace errors in build test
Reviewed by Jean-Marc Valin.
2022-07-05 18:25:07 -07:00
Jean-Marc Valin
7b6cede819
Add asan/ubsan support in random tests 2022-07-05 17:25:17 -04:00
Jean-Marc Valin
3acaa70965 Adds OPUS_SET_INBAND_FEC(2) option
Unlike OPUS_SET_INBAND_FEC(1), the encoder does not necessarily
switch to SILK if we have music.
2022-06-30 20:11:26 -04:00
Jean-Marc Valin
d7d4b3487f
Fixes --disable-rtcd
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-28 01:13:16 -04:00
Jean-Marc Valin
ccaaffa9a3 print rate used for testvectors 2022-04-02 15:21:48 -04:00
Jean-Marc Valin
2654707e86
Cleanup testing directories to save space 2022-04-01 14:32:38 -04:00
Jean-Marc Valin
f337795982
build test scripts 2022-03-31 23:40:20 -04:00
Tim-Philipp Müller
c2b542b6c0 Add support for Meson build system
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-28 22:29:08 +05:30
Nirbheek Chauhan
907a52315d
Replace WIN32 with _WIN32 everywhere
_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-21 23:35:29 -07:00
Felicia Lim
6bae366f9f opus_decoder_fuzzer: limit the number of decodes to avoid timeout 2020-08-10 09:50:20 -07:00
Felicia Lim
f8ed894b1f
Fix and clean up opus_decode_fuzzer
Use the fuzzed sub-length of the input data instead of the whole input.
2020-06-18 13:01:12 -07:00
Marcus Asteborg
fe00017a06
Disable message box when calling abort(). The message box is causing hangs in tests.
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2020-06-11 13:43:40 -04:00
Mark Harris
6554681d17
test_opus_encode: Use fprintf instead of snprintf
snprintf is not in C89.  Fixes opus-pedantic test failure introduced
in 59f8e5e4f.
2019-02-25 20:19:39 -08:00
Mark Harris
9b24723915
Clean up resources in projection test 2018-12-29 15:55:18 -08:00
Janne Johansson
59f8e5e4f8
Trivial sprintf to snprintf conversion. Some linkers warn about unbounded sprintf calls.
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2018-10-31 02:39:21 -04:00
Jean-Marc Valin
722a66b84b
Remove ambisonics experimental flag 2018-07-26 19:49:35 -04:00
Jean-Marc Valin
784d4ff92d
oops 2018-07-26 00:19:11 -04:00
Mark Harris
1827db6a60
Validate multistream/projection decoder frame_size 2018-07-21 21:36:34 -07:00
Mark Harris
01b035f8ba
Silence compiler warnings
clang -Wcast-align warnings with ambisonics enabled
clang -Wnull-pointer-arithmetic warnings in test_opus_api.c
gcc -Wimplicit-fallthrough warnings on arm
msvc warning C4244 in celt_encoder.c with fixed point
2018-07-21 21:35:39 -07: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
Andrew Allen
cae4445fb7
Ensure mapping matrix size is always valid.
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-12-07 18:04:19 -05:00
Andrew Allen
65f11d326d
Fix memory issues in Projection API.
Modified by Jean-Marc Valin

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-12-07 13:04:19 -05:00
Andrew Allen
f643c03fba
Support for Channel Mapping 253
OpusProjection* classes
MixingMatrix class
Projection tests

Change-Id: I98644466abf4ffd36e48bdecad1204d69e1539b9
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-11-07 17:44:36 -05:00
Felicia Lim
a1b050baee
Add missing #include for gcc 2017-07-13 10:34:08 -07:00
Felicia Lim
ed08a3b0ba Avoid -Wsometimes-uninitialized error for valid test code
|frame_size_enum| in tests/test_opus_encode.cl:117 is flagged as potentially
uninitialized but get_frame_size_enum() will fail anyway if a valid value is
not found.
2017-07-12 13:59:11 -07:00
Mark Harris
20e9378e67
tests/run_vectors.sh: Fix argument quoting
Allows spaces in path arguments
2017-06-13 22:07:02 -07:00
Mark Harris
d6d70371e8
Fix compiler warnings
- celt/modes.c:430:14: warning: cast from 'const unsigned char *' to
  'opus_int16 *' increases required alignment from 1 to 2 [-Wcast-align]
- 'C[0][1]' may be used uninitialized [-Wmaybe-uninitialized]
- Unused variable/parameter
- Value stored is never read
- MSVC warnings about "possible loss of data" due to type conversions
- MSVC warning C4146: unary minus operator applied to unsigned type
- silk/NLSF_del_dec_quant.c:137:20: warning: array subscript is above
  array bounds [-Warray-bounds] (gcc -O3 false positive)
- src/mlp_train.h:39:20: warning: function declaration isn't a prototype
  [-Wstrict-prototypes]
- Remove SMALL_FOOTPRINT code from SSE 4.1 FIR implementation, matching
  the C implementation.

The clang -Wcast-align warnings with SSE intrinsics are a known
clang issue: https://llvm.org/bugs/show_bug.cgi?id=20670
2017-02-26 19:10:45 -08:00
Mark Harris
c340d83689
test_opus_decode: Fix build on GCC 3.4 to 4.5.x
Broken by b0949f11, reported by ko-zu on GitHub.
2017-02-18 20:54:19 -08:00
Felicia Lim
468327d726
Add decoder fuzz target. 2017-02-10 15:08:53 -08:00
Mark Harris
bd54e279d5
Correct SILK encoder gain limit
Ensure that the SILK encoder's log gain is 63, not 64, when encoding
a maximum-value delta gain index of 40.  This matches the decoder
and RFC 6716 4.2.7.4, and prevents an assertion failure in the rare
case that the gain is later independently coded.
2016-11-16 20:16:23 -08:00
Mark Harris
d74fa2785a
Fix crash on bad encoder frame_size argument 2016-11-05 21:32:28 -07:00
Mark Harris
f1deb29cd6
Eliminate trailing spaces 2016-11-02 07:20:12 -07:00
Mark Harris
20bf3b3300
Reduce redundancy when SILK uses too many bits
Fix Hybrid redundancy assertion failure in ec_enc_shrink(), even
if SILK produces more than maxBits, by reducing or eliminating
redundancy when necessary.  Don't reserve space for redundancy that
is too small to be used for redundancy.  When there is not enough
space for redundancy, allow the regular frame to use all the bits.
2016-11-02 07:19:56 -07:00
Jean-Marc Valin
b0949f1194
Temporarily disable -Wnonnull around an opus_decode() call in test_opus_decode.c
Reported by wtchang in trac: https://trac.xiph.org/ticket/2160
2016-11-01 16:10:36 -04:00
Jean-Marc Valin
d0d1cf3b60
New regression test from Mark's fuzzing test cases 2016-10-29 15:49:39 -04:00
Felicia Lim
33698ee159
Update bandwidth and opusCanSwitch before generating SILK DTX ToC
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2016-10-27 23:36:57 -04:00
Felicia Lim
0962cbe2ae
Support encoding 80/100/120 ms frame lengths
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2016-10-27 23:36:57 -04:00
Jean-Marc Valin
386883179a
Fixing some opus_int vs opus_int32 mismatches
Reported by Mark Warner.
2016-10-05 00:09:00 -04:00
Felicia Lim
c305b824e9
Remove float ops from encoder settings fuzzer test 2016-09-16 08:39:08 -04:00
Jean-Marc Valin
f4dcc09f62
Fix mixed declarations and code 2016-09-15 15:02:00 -04:00
Felicia Lim
348bb27aa3
Fuzzer test for changing encoder settings online 2016-09-15 14:39:04 -04:00
Jean-Marc Valin
18a380a7c2
Make it possible to ignore inverted phase stereo for downmix purposes 2016-09-01 01:23:06 -04:00
Mark Harris
b0b6d6aeac test_opus_decode: Check all soft clip samples 2016-07-21 21:39:41 -07:00
Mark Harris
d401961a18 tests: Avoid shift into sign undefined behavior 2016-07-21 21:22:22 -07:00
Jean-Marc Valin
328953e189 Making calls to opus_packet_pad() on a bad packet return OPUS_INVALID_PACKET
We were previously returning OPUS_BAD_ARG because the failure was
only detected in opus_repacketizer_out_range_impl() rather than in
opus_repacketizer_cat(). Checking the return value from opus_repacketizer_cat()
also addresses the last outstanding Coverity defect.
2016-07-04 01:29:23 -04:00
Jonathan Lennox
3a1dc9dc15 Make it possible to pass in paths to opus_demo and opus_compare.
This patch lets you pass paths for opus_demo and opus_compare to the
run_vectors.sh script.

The motivation for this was for my aarch64 patches (forthcoming),
which I've been testing under qemu.  I want to run an emulated
opus_demo, but a native opus_compare, so the script completes in a
reasonable amount of time.
2015-09-01 17:24:49 -04:00
Ralph Giles
4784e0717e Fix malloc_hook warning on glibc 2.17 and later.
In glib 2.17 the __malloc_ptr define was removed in favour
of using void* directly. Our declaration of mhook using this
type for the second argument therefore rightly generates a warning
on modern systems, since the type is assumed to be an int, which
is too narrow to hold a pointer on 64 bit architectures.

Since it was only ever a define we could use an #ifndef to define
__malloc_ptr ourselves. However we only use it once, so using void*
in the signature directly is cleaner. This should cause no problems
on older systems where it will match either the void* or the char*
(for non __STDC__ code) the define resolved to.
2014-01-14 11:07:37 -08:00