Commit graph

39 commits

Author SHA1 Message Date
Jean-Marc Valin
448518fbed
Add some DRED decoding tests 2024-02-25 17:14:29 -05:00
Jean-Marc Valin
65b131ec09
Add basic testing for Deep PLC, DRED, and OSCE
Still need more targeted tests, DRED decoding
2024-02-06 20:52:21 -05:00
Jean-Marc Valin
378b4e5fc3
Ensuring we can see where crashes occur
Reviewed by Mark Harris
2022-07-22 12:22:47 -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
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
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
d74fa2785a
Fix crash on bad encoder frame_size argument 2016-11-05 21:32:28 -07: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
Mark Harris
d401961a18 tests: Avoid shift into sign undefined behavior 2016-07-21 21:22:22 -07:00
Gregory Maxwell
f6ec71925a Add some multistream resets to the tests. 2013-11-22 10:30:30 -08:00
Gregory Maxwell
733b47f31c Add opus_packet_(un)pad tests. 2013-11-18 23:25:20 -08:00
Jean-Marc Valin
6bc3e3cff7 Fixes SILK surround calibration while fixing other MSVC warnings 2013-11-17 22:35:15 -05:00
Gregory Maxwell
2632ef0396 Add some basic testing for OPUS_{GET|SET}_PREDICTION_DISABLED. 2013-11-17 08:52:00 -08: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
Gregory Maxwell
2fb4f5c439 Random complexity in the encoder tests. 2013-04-05 19:16:58 -07:00
Jean-Marc Valin
7fcd66c40d Changes the PLC behaviour and fixes the FEC behaviour on concatenated packets
PLC and FEC now return exactly the number of samples specified for the
buffer rather than (usually) returning the size of the last packet.
Doc and tests are updated accordingly.
2012-12-04 15:07:45 -05:00
Gregory Maxwell
de95da9bf1 Fix several issues with multistream argument validation.
As reported by Mark Warner opus_multistream_*_create were depending on
 the behavior of malloc(0) in order to correctly report some kinds of
 argument errors. Bad arguments could be incorrectly reported as
 allocation failures. This changes multistream to explicitly check the
 arguments like the single stream _create functions. The unit tests were
 enough to catch this on systems where malloc(0) returns NULL but didn't
 catch it on other systems because the later _init call would catch the
 bad arguments and trigger the correct error if and only if the malloc
 didn't return a null pointer.

In multistream_encoder_init failures of the internal non-multistream
 init calls were not being caught and propagated. Decode didn't have
 this problem. This propagates the errors and adds additional tests
 (the multistream encoder api is sill under tested) that would have
 detected this error.

Plus add some stronger tests for things like error==NULL for the _create
 functions that take a pointer for error output.
2012-10-27 13:42:48 -04:00
Ralph Giles
662ae9bb18 Include process.h for _getpid on windows.
Previously the test programmes happened to link because _getpid
returns an int, which is the default prototype. Instead, include
the appropriate header to supply a real declaration, fixing the
associated warning.

I moved the getpid->_getpid define to the site of the header
inclusion to make clear what's going on, rather than have it
floating in win32/config.h.
2012-10-23 13:04:36 -07:00
Gregory Maxwell
e23b15f1ea Add some more multistream encoder API tests. 2012-09-26 08:33:16 -04:00
Gregory Maxwell
582eba6f4f Additional multistream tests and reject channels<1 in MS API. 2012-08-21 16:08:35 -04:00
Gregory Maxwell
ce87883686 Fix headers by mingw broken by recent win32 changes. 2012-07-14 11:00:24 -04:00
Gian-Carlo Pascutto
c0edd63737 Make tests work on MSVC.
Add project files for Opus tests, fixup test source for Win32.
2012-07-12 18:00:46 -04:00
Gregory Maxwell
d6737c8522 Avoid an inconsequential memory leak in tests/test_opus_encode.c. 2012-06-01 00:52:51 -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
Gregory Maxwell
a26b2be2f9 Improvements to the tests, add a TEST_OPUS_NOFUZZ to disable testing corrupted input.
No changes to the codec itself.
2012-01-25 12:04:17 +13:00
Gregory Maxwell
e699c1989c Testing tools improvements (no impact on draft) 2011-11-25 23:53:15 -05:00
Gregory Maxwell
afd05aca0c Fix multistream packet corruption, implement GET_FINAL_RANGE for multistream, and add many tests.
Multistream encode was failing to add the length of the extra length for
self-delimited packets causing corrupted output. Multistream decode was
not properly handling lost frames (and potentially reading out of bounds
as a result).

GET_FINAL_RANGE has been implemented as the xor of the final range of all
the streams in the packet.

test_opus_encode now does the mono narrowband tests using dual-mono
multistream.
2011-10-30 19:57:22 -04:00
Gregory Maxwell
54a3495a52 Minor changes to test_opus_encode to improve coverage a little bit. 2011-10-29 18:19:23 -04:00
Gregory Maxwell
8fcfe02bc0 Update test_opus_encode / test_opus_decode for better LBRR/PLC testing and to reduce stack usage. 2011-10-28 23:15:04 -04:00
Ralph Giles
7931a60135 Remove relative paths to opus.h.
Files are already compiled with -I./include, the relative
path in the #include line isn't necessary.
2011-10-28 11:30:57 -07:00
Gregory Maxwell
71c04dc00c Improve test_opus_encode's coverage of some high rate cases. 2011-10-27 18:07:40 -04:00
Jean-Marc Valin
4923f3f80e Moves the main headers from src/ to include/ 2011-10-26 21:36:57 -04:00
Gregory Maxwell
a5ff49ecdc Renames test_opus to opus_demo and adds the test_opus_api, test_opus_encode, test_opus_decode test programs. 2011-10-26 19:59:49 -04:00