aboutsummaryrefslogtreecommitdiff
path: root/silk
AgeCommit message (Collapse)Author
2018-10-30Fixes misleading initialization with not enough zerosJean-Marc Valin
2018-09-26Prevent the SILK counter from overflowing after 2 years and 9 monthsJean-Marc Valin
or "just" 1 year and 4 months for 10-ms frames. The overflow can eventually cause a divide-by-zero when counter == -16 Thanks to Dmitry Malinin for reporting the bug.
2018-07-21Silence compiler warningsMark Harris
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-05-24Fixes a SILK bandwidth switching regressionJean-Marc Valin
The bug was triggered because f982b84d started using prefill for SILK bandwidth changes, which reinitialized the encoder state and prevented the variable lowpass from working properly. To fix the problem, we preserve the sampling rate and variable low-pass when prefilling.
2018-05-17Improving rate control for low bitrateJean-Marc Valin
Using a finer table for the rate to SNR curves in silk_control_SNR(). It's now possible to have an SNR that reaches 0, so we can lower bitrate down to ~5 kbps for narrowband and 5.5 kbps for wideband.
2018-05-14Silk makes use of Opus VADGustaf Ullberg
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2018-03-27two more asserts I forgotJean-Marc Valin
2018-03-27Harden SILK x86 codeJean-Marc Valin
2018-03-27Hardening silk/fixedJean-Marc Valin
2018-03-27Hardening asserts for SILK floatJean-Marc Valin
2018-03-27Converting some silk_assert()s into hardening celt_assert()sJean-Marc Valin
Only converted the ones that are really sure (not signal-dependent) and that shouldn't add much run-time complexity
2018-02-22Fixed off-by-one issue in Silk DTXGustaf Ullberg
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2018-02-18Fixes integer overflow in SILK VAD for 10-ms framesJean-Marc Valin
Reported by Chandrakala Madhira on the mailing list
2017-09-28Better rate allocation for stereo SILK in hybrid modeJean-Marc Valin
SILK was being allocated too few bits for stereo hybrid, often resulting in forced narrowing of the width. We now allocate more bits to SILK and reduce the threshold for narrowing. This improves quality enough that the bitrate threshold for switching to SILK can be increased to 44 kb/s.
2017-09-11Rename SSE 4.1 files to match their targets.Ralph Giles
Distinguish source files for the SSE 4.1 instruction set extension consistently by their filename. This makes it easier to check the correct flags are being set at build time. Signed-off-by: Jonathan Lennox <jonathan@vidyo.com>
2017-06-13Fix a duplicate symbol name.Ralph Giles
Both versions of silk/tables_NLSF_CB had symbols named silk_NLSF_CB1_Wght_Q9 which causes problems if both files are build as part of the same compilation unit. Rename the wideband version to include a 'WB' string to avoid the conflict. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-06-02Don't use MAY_HAVE_NEON in arm_silk_map.c.Jonathan Lennox
It's unnecessary, and isn't defined correctly on floating-point. This makes us correctly use Neon functions (in floating-point mode) on platforms where Neon is detected by RTCD. Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2017-05-30silk_LIMIT_32() should return an opus_int32 (not opus_int)Jean-Marc Valin
Thanks to petrufm for pointing that out: https://github.com/xiph/opus/issues/35
2017-05-23cosmetics,silk: correct input/output arg commentsLinfeng Zhang
Change-Id: I607a8b75b0711a485384d6f854cf6e2ec18b38b7 Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-05-17Optimize silk_biquad_alt_stride2() for ARM NEONLinfeng Zhang
The optimization is bit exact with C function. Change-Id: Ifb8f04b19f2d576e79ce5dcfa7e0fc374d71d6c8 Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-05-17Update silk_biquad_alt()Linfeng Zhang
Split to silk_biquad_alt_stride1() and silk_biquad_alt_stride2(), so that it can be optimized more efficiently when stride is 2. This change in C code is bit exact with the origin. Change-Id: Idaefe670397016ace2a489e3435ac61b7dbe79d5 Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-04-13Optimize silk_warped_autocorrelation_FIX() for ARM NEONLinfeng Zhang
The optimization is bit exact with C function. This optimization speeds up fixed-point SILK encoder on NEON about 5% to 8%. (Tested on Acer Chromebook, ARMv7 Processor rev 3 (v7l).) Change-Id: I582f6f3585b7946149e16a2ad3084ebc0ae79a4f Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
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
2017-02-18Fix stability testJean-Marc Valin
2017-02-18Speed up test_unit_LPC_inv_pred_gain by returning early on stable filtersJean-Marc Valin
2017-02-14Optimize silk_LPC_inverse_pred_gain() for ARM NEONLinfeng Zhang
The optimization is bit exact with C function. Change-Id: Ib3bdc26a5a4ebe02e7f24be85104e8e9a2a9a738 Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-02-14Adding a unit test for LPC_inv_pred_gain()Jean-Marc Valin
It checks that no clearly unstable filter passes the LPC_inv_pred_gain() test. Also, this will make it possible to check assembly for correctness. Modified from an original patch from Linfeng Zhang <linfengz@google.com>.
2017-02-09Remove silk_LPC_inverse_pred_gain_Q24() which is no longer used anywhereJean-Marc Valin
2017-02-04fix ARM build w/--disable-intrinsics --enable-asmJames Zern
and rtcd disabled (CFLAGS=-mfpu=neon) broken since: cfdaf365 Optimize silk_NSQ_del_dec() for ARM NEON Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-01-30Optimize silk_NSQ_del_dec() for ARM NEONLinfeng Zhang
The optimization is bit exact with C function. This optimization speeds up SILK encoder on NEON as following. Fixed-point: Complexity 0-5: 0% Complexity 6-7: 6% Complexity 8-9: 10% Complexity 10: 8% Got similar results on floating-point. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-01-25Avoids undefined behaviour in ARM-optimized codeJean-Marc Valin
Casting to unsigned to avoid shifting negative values left.
2017-01-23Update NSQ_LPC_BUF_LENGTH macroLinfeng Zhang
NSQ_LPC_BUF_LENGTH is independent of DECISION_DELAY. Signed-off-by: Felicia Lim <flim@google.com>
2017-01-17Add FIXED_POINT check if using celt_fir in SILK's LPC analysis filterFelicia Lim
Use of celt_fir remains off by default
2017-01-17Revise celt_fir_c() to not pass in argument "mem"Linfeng Zhang
The "mem" in celt_fir_c() either is contained in the head of input "x" in reverse order already, or can be easily attached to the head of "x" before calling the function. Removing argument "mem" can eliminate the redundant buffer copies inside. Update celt_fir_sse4_1() accordingly.
2016-12-22Fix some compiler warningsMark Harris
2016-11-16Correct SILK encoder gain limitMark Harris
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-10Remove SILK_DEBUG define when _WIN32 and _DEBUG are defined.Ralph Giles
This was just enabling commented-out code, setting a fixed default removes dead code.
2016-11-10Remove commented-out DEBUG_STORE_DATA calls. r=keonRalph Giles
Also remove the SILK_DEBUG_STORE_CLOSE_FILES flush call from opus_demo. This is debugging code which is no longer used, but defining the symbols for SILK_DEBUG_STORE_CLOSE_FILES and calling it from opus_demo causes linking problems on Microsoft Visual Studio where we have strict controls on public symbols and want to test the compiled DLL. Since the code isn't in active use, it's better to remove it to avoid clutter and address the linking issue.
2016-11-02Eliminate trailing spacesMark Harris
2016-10-05Fixing some opus_int vs opus_int32 mismatchesJean-Marc Valin
Reported by Mark Warner.
2016-08-17Fixes an overflow in LPC_inverse_pred_gain_QA()Jean-Marc Valin
We now declare that anything that would overflow is not stable enough
2016-08-06Speeding up PVQ using unlikely() and moving first position out of the loopJean-Marc Valin
Speeds up encoding by another ~1-2%
2016-08-05Making it clearer to Coverity that nStates cannot exceed ↵Jean-Marc Valin
NLSF_QUANT_DEL_DEC_STATES
2016-07-30Fixes overflow in CNGJean-Marc Valin
(found through fuzzing)
2016-07-28Ensure that NLSF cannot be negative when computing a min distance between themFelicia Lim
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2016-07-25Disabling the use of celt_fir() in silk_LPC_analysis_filter() by defaultJean-Marc Valin
2016-07-25Fixes an overflow in limit_warped_coefs()Jean-Marc Valin
For large values of maxabs_Q20, silk_MUL( maxabs_Q20, ind + 1 ) could overflow.
2016-07-22Avoiding an overflow in the LTP quantizationJean-Marc Valin
Reduces the XX values to avoid an overflow in silk_VQ_WMat_EC(), even in floating-point.
2016-07-22Disables MIPS silk_noise_shape_analysis_FIX() until it's updatedJean-Marc Valin
2016-07-22More headroom in fixed-point silk_burg_modified() to avoid an overflowJean-Marc Valin