aboutsummaryrefslogtreecommitdiff
path: root/src/analysis.c
AgeCommit message (Collapse)Author
2021-07-08libOpus: fix integer overflow in silk_resampler_down2_hpNeelkamal Semwal
Bug: 190882774 Test: poc in bug description Change-Id: Ib780a7d3e114ed29047c50459c01462c6b244f31
2020-06-11Build time improvement, for MSVC use intrin0.h instead of intrin.h and ↵Marcus Asteborg
remove usage of stdio.h in production code Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2019-02-13Improve silence handlingJean-Marc Valin
Copy the previous analysis data instead of flagging as invalid
2019-02-13Fixing initialization issues on small frame sizesJean-Marc Valin
2019-02-13Fixes analysis buffering for silence and complexity changesJean-Marc Valin
The previous code would go out of sync in those cases.
2019-02-12Avoiding problems with x87Jean-Marc Valin
logE[b] can end up slightly larger than tonal->highE[b] due to rounding
2018-09-25Retrain RNN classifier weights to include reverberated speechJean-Marc Valin
2018-06-14Make bandwidth detection more conservative to avoid low-passing framesJean-Marc Valin
2018-01-26Scaling back the pitch filter when most of the energy is above 3.2 kHzJean-Marc Valin
That corresponds to the fundamental for the shortest pitch period allowed
2017-11-16fix float constantsJean-Marc Valin
2017-11-09Retrained speech/music RNNJean-Marc Valin
Larger network, using 8-bit weights
2017-10-06Fixing (hopefully) bandwidth detection for 24 kHz analysisJean-Marc Valin
The masking term was previously completely broken (even in 1.1). The bandwidth detection relies mostly on the noise floor and can only use masking to cut one extra band. The 12-24 kHz energy is now normalized properly but uses a higher noise floor due to the leakage in the resampler. Bandwidth detection is still mostly useless at identifying SWB speech (it usually says FB).
2017-10-05Add RNN for VAD and speech/music classificationJean-Marc Valin
Based on two dense layers with a GRU layer in the middle
2017-06-26Working around misdetected audio bandwidthJean-Marc Valin
The new detector for SWB vs FB is unreliable due to the hack that was required to get 24 kHz analysis working. We're now err on the side of FB just to make sure.
2017-06-19Add "f" suffix to float constantsJean-Marc Valin
2017-06-10Improving tonality estimation with delayed decisionJean-Marc Valin
2017-06-04Initialize speech/music prob based on applicationJean-Marc Valin
2017-06-04Properly init speech/music confidence valuesJean-Marc Valin
This was sometimes causing the music probability to be stuck at zero at the beginning of files
2017-06-01fix commentsJean-Marc Valin
2017-06-01Avoid using log2() since it's not in C90Jean-Marc Valin
2017-06-01Adding leakage modelling to boost bandsJean-Marc Valin
We boost bands that either cause leakage or are filled with leakage
2017-06-01Analysis refactoring for fixed-point scalingJean-Marc Valin
Now scaling the energy to the same value is would be in floating-point
2017-02-26Fix compiler warningsMark Harris
- 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
2016-12-20Makes analysis run at 24 kHz, with 20-ms framesJean-Marc Valin
The change also makes the analysis run for sampling rates of 16 kHz and 24 kHz since the features are only computed on the 0-8 kHz band. The longer time window (20 ms instead of 10 ms) makes the tonality estimator more reliable for low-pitch harmonics.
2016-09-07Prevent tonality estimator from running too often with 2.5 and 5 ms framesJean-Marc Valin
2016-08-11Making stereo_itheta() use the same atan2() approximation as tonality_analysis()Jean-Marc Valin
2016-07-17New DTX that works in all modes (SILK/CELT/HYBRID)Felicia Lim
A frame is marked as valid for DTX if it contains noise or only digital silence. As before, there is an overhang period of 200 ms and a maximum consecutive DTX period of 400 ms. If the new DTX cannot be used because of the complexity setting and sampling frequency chosen, the SILK DTX will be used instead. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2016-07-17Simplifying fast_atan2f()Jean-Marc Valin
2016-07-17Quality: Retrained classifier MLP with better dataJean-Marc Valin
New MLP doesn't attempt to classify silence as speech/music
2016-06-29Address static analysis reports from scan-buildJean-Marc Valin
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-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-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).
2013-12-10More NaN hardening in the analysis codeJean-Marc Valin
2013-11-13Fixes MSVC conversion warningsJean-Marc Valin
2013-11-09Fixes some minor issues found by scan buildJean-Marc Valin
2013-10-28Replace "inline" with OPUS_INLINE.Gregory Maxwell
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-09-28Makes analysis work when encoding more than 20 ms at a timeJean-Marc Valin
2013-09-28run_analysis() doesn't need to return the frame size anymoreJean-Marc Valin
2013-09-16Moves frame size selection back out of opus_encode_native()Jean-Marc Valin
Should fix delayed decision on surround, but not well tested.
2013-09-09Analysis scaling fixesJean-Marc Valin
This should make the scaling the same for fixed and float. It changes the float scaling too by normalizing by the number of channels, which matters for bandwidth detection.
2013-09-06Makes speech/music detection work with FIXED_POINT (code still float)Jean-Marc Valin
2013-09-06First pass at making the analysis code run with FIXED_POINTJean-Marc Valin
Code is still float, but at least tonality esitmation seems to work. Speech/music analysis is still disabled.
2013-09-05Moves the analysis back to opus_encode_native() to it runs for all streams.Jean-Marc Valin
I checked that it's not *completely* busted, but it probably needs more testing.
2013-07-15Revert "Fixes a number of double promotions and missing casts."Gregory Maxwell
This reverts commit 43279728cd39947f95dbf77557a0a698f164fdd1.
2013-07-15Fixes a number of double promotions and missing casts.Gregory Maxwell
At a minimum MSVC warns on some of this stuff.
2013-07-01More speech/music detection comments (delayed decision)Jean-Marc Valin
2013-07-01Commenting the speech/music Markov codeJean-Marc Valin
2013-06-27Fixes more MSVC warningsJean-Marc Valin