aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-04-22Fixes floating-point bug introduced in be9e747bcc542c277d30f6c78a57b0940e0c5b5eJean-Marc Valin
The effect was to always set HB_gain to 1.
2016-03-24Fixes overflows on CPUs with 16-bit intsJean-Marc Valin
As reported by Giovanni Rovatti, this should fix some TI C55 issues.
2015-12-31Actually fix pedantic build bustage.Timothy B. Terriberry
2015-12-31Fix pedantic build bustage.Timothy B. Terriberry
ISO C90 forbids mixed declarations and code, r=bustage
2015-12-31Add tonality_analysis_reset().Ralph Giles
Add a reset function for the TonalityAnalysisState struct and call it on encoder reset. Move the state struct above the clear line in OpusEncoder so reset doesn't clobber reusable fields. Currently this is only the arch field, which is moved to to top of the struct so we can use the same memset-to-the-end pattern as OpusEncoder. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2015-12-31Add an initializer for TonalityAnalysisState.Ralph Giles
This interns the asm flags parameter in the state struct so we don't need to pass it with every call. It can be expensive, so we don't want to query every run_analysis() call, but since this (private) api is used by webrtc code we need to provide a supportable interface for filling in the correct value. Note the initialization code is partially duplicated between opus_encoder_init and the OPUS_RESET_STATE switch case, so we must re-initialize it there. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2015-12-30Remove unused encoder field analysis_offsetMark Harris
2015-12-30Avoids having the Opus-level "arch" be set to 0 on encoder/decoder resetJean-Marc Valin
2015-12-04opus_demo: fixes potential division by zero on files with no active frameJean-Marc Valin
2015-10-07armv7(float): Optimize encode usecase using NE10 libraryViswanath Puttagunta
Optimize opus encode (float only) usecase using ARM NE10 library. Mainly effects opus_fft and ctl_mdct_forward and related functions. This optimization can be used for ARM CPUs that have NEON VFP unit. This patch only enables optimizations for ARMv7. Official ARM NE10 library page available at http://projectne10.github.io/Ne10/ To enable this optimization, use --enable-intrinsics --with-NE10=<install_prefix> or --enable-intrinsics --with-NE10-libraries=<NE10_lib_dir> --with-NE10-includes=<NE10_includes_dir> Compile time checks made during configure process to make sure optimization option available only when compiler supports NEON instrinsics. Runtime checks made to make sure optimized functions only called on appropriate hardware. Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2015-10-07Extra safety against NaNs in surround_analysis()Mark Harris
Fix out-of-bounds memory read in multichannel surround analysis with float input that contains NaNs. Found by afl-fuzz. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2015-10-07Preventing NaNs from crashing surround_analysis()Jean-Marc Valin
2015-08-20Fixes bitrate statistics for decode-only operation and inband FECKoen Vos
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2015-08-07Fix const struct to work with C++ compilationMark Harris
This allows the libopus source files to be compiled with a C++ compiler, by ensuring that the "extern const MLP net" declaration is visible at the point of the "const MLP net" in src/mlp_data.c. Otherwise it will default to static linkage in C++, resulting in an undefined symbol. Note that if compiled with a C++ compiler the symbols will be mangled, so don't do that if you want to be able to call it from C code or run the tests (which still require a C compiler).
2015-08-07Silence clang -Wcast-align warningsMark Harris
2015-08-04Eliminate signed division overhead in align()Mark Harris
Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2015-08-04Simplify and generalize implementation of align(). Should be very efficient ↵Jonathan Lennox
on sensible platforms, and correct everywhere.
2015-08-04Make align() work even on machines with 32-bit charsJean-Marc Valin
2015-08-03More conservative alignmentJean-Marc Valin
Based on max size of void*, opus_int32 and opus_val32, rounded up to the nearest power of two
2015-02-27Avoiding the term "mode" in opus_demoJean-Marc Valin
2015-02-24opus_demo: remove unused but set valuesTristan Matthews
2014-12-26Fix warnings in pedantic build.Timothy B. Terriberry
This should suppress our current issues with unused parameters, unused variables, and set-but-not-used variables.
2014-11-27multistream: improve arg checkMark Harris
Avoid undefined behavior (signed arithmetic overflow) or implementation-defined behavior (malloc(0)) on out-of-range arguments, e.g. opus_multistream_encoder_create(48000, 2, 2147483647, 1, ...) or opus_multistream_surround_encoder_create(48000, 3, 0, ...). Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2014-10-03There are no tabs in source code.Timothy B. Terriberry
There is also no trailing whitespace.
2014-10-03Cisco optimization for x86 & fixed pointxiangmingzhu
1. Only for fixed point on x86 platform (32bit and 64bit, uses SIMD intrinsics up to SSE4.2) 2. Use "configure --enable-fixed-point --enable-intrinsics" to enable optimization, default is disabled. 3. Official test cases are verified and passed. Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2014-09-30-DOPUS_WILL_BE_SLOW to disable the no-optimization warningJean-Marc Valin
2014-09-04Fixes commentsJean-Marc Valin
2014-09-04Takes into account a corner case with the multistream encoderJean-Marc Valin
Considers the case where one stream would eat up all the remaining bytes, including a 2-byte size that would then not leave enough for the even a PLC packet in the next streams.
2014-09-04Lowered the smallest packet that the multi-stream encoder can encodeJean-Marc Valin
Limit now at 2*streams-1 and anything below that returns OPUS_BUFFER_TOO_SMALL rather than OPUS_BAD_ARG
2014-06-21multi-stream fix when setting bitrate to AUTO, MAX, or small valuesJean-Marc Valin
OPUS_AUTO should now work fine, while using OPUS_BITRATE_MAX would still be a bad idea for controlling CBR rate for multistream. The encoder should now throw an error early on if max_data_bytes is just too small to do anything.
2014-05-14Fix type conversion warning.Ralph Giles
Use abs(sweep_bps) instead of fabs(). "sweep_bps" is an integer, and on some compilers this line generates a warning. Patch from Tina le Grand. Reviewed by Jean-Marc Valin
2014-01-30Moves opus_packet_get_samples_per_frame() to opus.cJean-Marc Valin
2014-01-26Fix surround encodingMark Harris
Broken by 306d7f5a308e30ce10ba1a1dcdbeeb81de3b2872
2014-01-07Fixes the decode_fec case for b76888dMark Harris
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2014-01-07Preventing unnecessary stack use when using a large decode bufferJean-Marc Valin
This was causing pseudostack builds to fail because opus_demo uses a 2-second buffer.
2014-01-06Reduces the decoder stack use by removing the pcm_silk buffer in fixed-pointJean-Marc Valin
We only keep when concealing less than 10ms with SILK.
2013-12-17Fixes a warning about "conversion from '__int64' to 'int'" on MSVCJean-Marc Valin
2013-12-10Fixes code that was doing arithmetic on a void pointer.Jean-Marc Valin
Thanks to Kevin O'Connor for reporting this.
2013-12-10More NaN hardening in the analysis codeJean-Marc Valin
2013-12-09Making NaN detection more robust to -ffast-math.Jean-Marc Valin
2013-12-09Using celt_inner_prod() for input sanity check.Jean-Marc Valin
2013-12-09Replaces inline copies and initialization with OPUS_*() macros.Jean-Marc Valin
This is a bit faster at -O2 because memcpy()/memmove()/memset() are vectorized. The code is also cleaner.
2013-12-09Optimizes encoder NaN detection and clipping by only running them when neededJean-Marc Valin
NaN detection should now be able to catch values that would create NaNs further down.
2013-11-25Makes SILK surround masking a bit more aggressive in both directionsJean-Marc Valin
This also splits the rate adjustment between SILK and CELT (previous code only changed SILK)
2013-11-24Using a more reasonably SILK surround calibration valueJean-Marc Valin
Still needs more tuning
2013-11-24Reducing the thresholds for enabling stereo and higher audio bandwidthsJean-Marc Valin
2013-11-24Surround low-passing thresholds set to much lower bitratesJean-Marc Valin
2013-11-22Minor opus_pcm_soft_clip API hardening and tests.Gregory Maxwell
2013-11-21Applies padding to all CBR packets, including PLC and CELT silenceJean-Marc Valin
2013-11-19Validate merge argument in repacketizer_demo.Gregory Maxwell