Commit graph

43 commits

Author SHA1 Message Date
Jan Buethe
7d328f5bfa
Merge LACE/NoLACE under OSCE framework 2023-12-20 03:42:44 -05:00
Jean-Marc Valin
3c74ef1d73
Increase state size limit for API test 2023-06-16 13:01:37 -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
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
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
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
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
Gregory Maxwell
ac31a0af4a Additional opus_multistream_packet_(un)pad tests. 2013-11-19 08:52:49 -08:00
Gregory Maxwell
733b47f31c Add opus_packet_(un)pad tests. 2013-11-18 23:25:20 -08:00
Gregory Maxwell
2632ef0396 Add some basic testing for OPUS_{GET|SET}_PREDICTION_DISABLED. 2013-11-17 08:52:00 -08:00
Jean-Marc Valin
5174817d36 Hides OPUS_FRAMESIZE_VARIABLE from the API until it actually works 2013-11-08 19:54:03 -05:00
Mark Harris
970d0529ee Correct opus_packet_parse code 0 packet tests. 2013-10-11 17:27:49 -07:00
Gregory Maxwell
a9daf9fec3 Add a couple minor additional decoder tests. 2013-06-29 22:20:54 -07:00
Gregory Maxwell
dd7b0dac3b Fixes some return without va_end in the api, adds tests.
Also makes the CTL bad argument handling more consistent to avoid mistakes
 like that in the future.  Also updates the variable duration docs.
2013-06-29 20:06:07 -07:00
Gregory Maxwell
535efb0707 Add missing packet_get_nb_samples test coverage and fix test output. 2012-12-05 19:27:12 -05:00
Jean-Marc Valin
d0fd9d4baa Implements opus_packet_get_nb_samples() 2012-12-04 15:45:31 -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
Philip Jägenstedt
b7b5872c9d Fix minor issues reported by scan-build 2012-10-11 09:21:44 -04:00
Philip Jägenstedt
6d9c16d142 Fix common misspellings
I stumbled upon the typo in README.draft, so took the opportunity to
grep for common misspellings using List_of_common_misspellings.txt for
hunspell.
2012-09-27 09:16:30 -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
88c499c959 Add basic {GET,SET}_LSB_DEPTH API tests. 2012-08-08 00:52:36 -04:00
Gregory Maxwell
9881484dbd test_opus_api: Fix valgrind expectations broken by last commit.
The last commit changed some of the multistream tests to use a
dual-mono setup instead of a single-stereo setup. Some of the
accompanying explicit valgrind checks were still setup to
look for stereo streams.
2012-07-11 02:18:44 -04:00
Gregory Maxwell
28b41ae5ae Add OPUS_{GET|SET}_GAIN CTLs for adjusting output gain.
This CTL was requested by Nicolas George for FFmpeg.
2012-07-11 00:04:24 -04:00
Gregory Maxwell
c64f4a4265 Update headers to cause warnings on unused returns and null args.
In places where an ignored return or a null-arg is a sure indication
of a bug add the GCC warning attributes. The null arg annotation
is not enable for Opus itself because it will cause the compiler
to optimize out some null checks. I don't trust our callers
quite that much.
2012-06-01 15:58:17 -04:00
Jean-Marc Valin
24ed465e71 int vs opus_int32 consistency 2012-05-18 15:14:17 -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
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
c81b510239 Fix a number of multistream decoder bugs; add some very basic multistream decoder tests. 2011-10-30 02:20:41 -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
Ralph Giles
839de4d082 Remove the define check for __GNUC_PREREQ.
Our arch.h makes sure it's always defined. Thanks to derf
for the suggestion.
2011-10-28 11:03:29 -07:00
Ralph Giles
b4dd4eb780 Fix the test for gcc version >= 4.6 to work for gcc 5 and up.
We use the __GNUC_PREREQ macro from celt/arch.h to check
the required minimum gcc version. The previous check would
have failed for gcc 5.n with n from 0 to 5.

Thanks to pcgod for pointing out the problem and derf for
pointing out we had a macro for this.
2011-10-28 10:51:17 -07:00
Ralph Giles
732ac84452 Move opus_apps inside the MALLOC_FAIL block.
This array is only used by the malloc failure test, and
defining it unconditionally creates an unused variable
warning on platforms where MALLOC_FAIL isn't set.
2011-10-28 10:26:20 -07:00
Ralph Giles
455993f1e1 Make the MALLOC_FAIL test solely dependent on HAVE___MALLOC_HOOK.
This test only works on glibc, but the important thing is support
for the __malloc_hook api, so that's what we should depend on,
especially since not all glibc versions have it.
2011-10-28 10:20:16 -07:00
Ralph Giles
b88a7baf34 Use #pragma GCC diagnostic push/pop only on gcc 4.6 and later.
These pragmas were adding in 4.6, and earlier versions warn
about them being undefined.
2011-10-28 10:20:16 -07:00
Ralph Giles
c19bc34638 Check for __malloc_hook and define MALLOC_FAIL appropriately.
The glibc 2.14 NEWS file says __malloc_hook will be removed
in the next release, so future-proof our use by checking
for this symbol at configure time and only compiling the
malloc failure tests if it is present.
2011-10-28 10:20:16 -07:00
Ralph Giles
ed90cdc369 Disable the deprecated function warning on __malloc_hook.
This just works around the deprecation in glibc 2.14. I
do worry what will happen if they follow through and
remove it in 2.15.
2011-10-28 10:20:16 -07:00
Gregory Maxwell
657dea717e Moving the dash header inline to appease the apple gcc. 2011-10-28 12:10:14 -04:00
Jean-Marc Valin
e6a0be8ee6 Makes OPUS_SET_VOICE_RATIO private
Let's put it back in if/when we have a clearer view of voice/music detection
2011-10-27 13:43:43 -04:00
Gregory Maxwell
6b9c29aee4 Add a test for MAX_BANDWIDTH to test_opus_api. 2011-10-27 09:36:50 -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