Commit graph

29 commits

Author SHA1 Message Date
Jean-Marc Valin
7e3352ef51
Converting some silk_assert()s into hardening celt_assert()s
Only converted the ones that are really sure (not signal-dependent)
and that shouldn't add much run-time complexity
2018-03-27 15:13:27 -04:00
xiangmingzhu
c95c9a048f Cisco optimization for x86 & fixed point
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-10-03 21:16:00 -04:00
Jean-Marc Valin
c25836205d Delaying allocation of the SILK temporary output buffer to reduce peak stack 2014-01-07 13:46:06 -05:00
Jean-Marc Valin
dce69d2b9b Store decoded SILK pulses as 16-bit vector
This saves 640 bytes on the peak stack usage.
2014-01-06 21:59:48 -05:00
Jean-Marc Valin
ca6fac041b Fixes some minor issues found by scan build 2013-11-09 18:28:40 -05:00
Ralph Giles
f2446c25c6 Remove trailing whitespace from the license headers. 2013-09-16 14:40:04 -07:00
Timothy B. Terriberry
80ad38370c Convert quotes in license headers to ASCII.
Since the last patch originally had them mangled (presumably by
 mailer, http server, or something else), let's just get rid of
 them.
2013-05-19 19:16:11 -07:00
Jean-Marc Valin
e51a3f33cf Fixes a minor CELT->SILK switching glitch in the decoder
By not reinitializing the stereo state during a switch, the old stereo
memory would create a false impulse (i.e. single sample) in the decoded audio.
This change affects the normative part of the decoder. Fortunately,
the modified decoder is still compliant with the specification because
it still easily passes the testvectors. For example, for the float decoder
at 48 kHz, the opus_compare (arbitrary) "quality score" changes from
from 99.9333% to 99.925%.
2013-02-06 23:48:09 -05:00
Philip Jägenstedt
b7b5872c9d Fix minor issues reported by scan-build 2012-10-11 09:21:44 -04:00
Timothy B. Terriberry
6f2d9f5068 Use dynamic stack allocations in SILK decoder.
This allows the decoder to be compiled with
 NONTHREADSAFE_PSEUDOSTACK to move the memory for large buffers off
 the stack for devices where it is very limited.
This patch only attempts to do this for the decoder.
The encoder still requires more than 10 kB of stack.
2012-09-08 02:35:38 -04:00
Gregory Maxwell
0d57a5dc28 Disable silk_get_TOC in the code, as it's not used or exposed. 2012-08-06 12:29:42 -04:00
Cyril Lashkevich
622046c1f1 Fixed sizeof param in silk_get_TOC. Size for memset was calculated wrong.
Signed-off-by: Gregory Maxwell <greg@xiph.org>
silk_get_TOC is unused, unreachable, and not useful without some
packet pre-processing, but until we remove it it should be correct.
This was also reported by Mozilla.
2012-08-06 12:29:42 -04:00
Jean-Marc Valin
ab5a049705 Merge commit '390c89225d' 2012-04-24 13:39:22 -04:00
Jean-Marc Valin
ae00e60d35 License update using the IETF Trust flavour of the BSD on the Silk code 2012-04-20 16:31:04 -04:00
Jean-Marc Valin
905197d750 Fixes a bunch of 16-bit issues that the C5X compiler warns about 2012-03-08 14:09:09 -05:00
Jean-Marc Valin
17c5966045 Last updates for draft -11
- Draft updates
- Updated code to produce and check test vectors
- Making sure that the test vectors pass at all rates as well as for mono and stereo
2012-02-17 16:18:08 -05:00
Jean-Marc Valin
ee8adbe701 Fixes a few minor issues (no bit-stream change)
- Safer gain clamping for PLC
- Makes opus_decoder_get_nb_samples() report an error on invalid ToC
- Giving a free license to the text ofthe draft (not just the code)
2012-01-24 14:47:54 +13:00
Koen Vos
bf75c8ec4d SILK fixes following last codec WG meeting
decoder:
- fixed incorrect scaling of filter states for the smallest quantization
  step sizes
- NLSF2A now limits the prediction gain of LPC filters

encoder:
- increased damping of LTP coefficients in LTP analysis
- increased white noise fraction in noise shaping LPC analysis
- introduced maximum total prediction gain.  Used by Burg's method to
  exit early if prediction gain is exceeded.  This improves packet
  loss robustness and numerical robustness in Burg's method
- Prefiltered signal is now in int32 Q10 domain, from int16 Q0
- Increased max number of iterations in CBR gain control loop from 5 to 6
- Removed useless code from LTP scaling control
- Optimization: smarter LPC loop unrolling
- Switched default win32 compile mode to be floating-point

resampler:
- made resampler have constant delay of 0.75 ms; removed delay
  compensation from silk code.
- removed obsolete table entries (~850 Bytes)
- increased downsampling filter order from 16 to 18/24/36 (depending on
  frequency ratio)
- reoptimized filter coefficients
2011-12-13 14:47:31 -05:00
Koen Vos
acc7a6c78b Reformatting changes with an update to the MSVC project files 2011-10-28 19:44:26 -04:00
Jean-Marc Valin
ec1ebf8ad7 Fixes a bug on FEC+stereo
When FEC is enabled in the decoder but not included in the bit-stream
we could end up applying the PLC on a non-existant side.
2011-10-24 20:07:00 -04:00
Gregory Maxwell
52de536fed Correct encoder/decoder state mismatch and spurious state resetting in the encoder when side is reset.
Patch from Tim which corrects a glitch during mode switching tests.
2011-10-19 00:20:46 -04:00
Timothy B. Terriberry
6559d36a46 Remove redundant mid-only flag when side VAD flag is set.
If there is activity in a regular, side SILK frame, then it must
 be coded, so we don't need to send a mid-only flag.
2011-10-17 23:31:20 -04:00
Timothy B. Terriberry
1e03a6eb04 Fix side-channel index for VAD/LBRR flags.
Neither the encoder nor decoder were incrementing the side-channel
 index for a mid-only frame.
Unfortunately, they used that index to index the VAD flags and LBRR
 flags.
This made the VAD flags for the side channel particularly useless,
 as you couldn't tell which frame a flag belonged to without
 decoding most of the packet.
It also desynched the LBRR information, as look at the wrong LBRR
 flags to decide when it had to code a mid-only flag.
If some frames were skipped in the side channel, then the last few
 VAD flags and LBRR flags would be garbage, but still get encoded.

This patch fixes this by continuing to increment nFramesDecoded or
 nFramesEncoded, even when skipping a frame in the side channel.
This makes the side-channel VAD and LBRR flags correspond to the
 correct time periods for frames greater than 20 ms.
It also fixes a bug where if DTX was not used on the packet where
 the side channel got turned off, it would never get used again
 until the encoder attempted to encode something in the side
 channel again.
2011-10-17 16:03:41 -04:00
Timothy B. Terriberry
53cc1a033a Fix the side frame conditional coding rules.
b24e5746 introduced changes to LastGainIndex which broke
 conditional coding for side frames after a mid-only frame (i.e.,
 in a 60 ms frame where the side is coded, not coded, then coded
 again).
These rules were a mess in general, however, because the side
 channel state kept a different nFramesDecoded count from the mid
 channel state, and had no way to tell if the prior side frame was
 coded.

This patch attempts to rationalize them by moving the conditional
 coding decision up to the top level, where all this information is
 available.
The first coded side frame after an uncoded side frame now always
 uses independent coding.
If such a frame is also not the first side frame in an Opus frame,
 then it doesn't include an LTP scaling parameter (because the LTP
 state is well-defined).
2011-10-17 16:03:41 -04:00
Jean-Marc Valin
4f1b7dac7e Fixes a case where PLC was called on the side when no side was ever coded 2011-10-12 15:09:13 -04:00
Jean-Marc Valin
b24e574627 Misc bug fixes
- There was a bug where the decoder resampler was not properly initialized
when fs_kHz == API_fs_kHz. In that case the resampler would continue to
upsample, and the output was corrupt.

- The delay value in the decoder was taken from the state before it was
potentially updated. This caused the decoder to apply the new dalay value one
frame late

- The encoder and decoder states are now updated more consistently, when
the sampling rate changes (pesq liked these changes)

- Properly resetting the side channel encoder and decoder for the first
frame with side coding active again

- Faster updating the "ratio" value in the LR_to_MS() code for large
prediction values means that for certain extreme/artificial input
signals the output looks better
2011-10-11 21:09:14 -04:00
Koen Vos
3195f6cdb9 Misc SILK fixes:
- compile warning in opus_decoder.c
- decoder state reduced by ~3 kB (by merging buffers, as Tim suggested)
- some minor decoder optimizations (only the PLC is non-bit exact, so should be ok)
2011-10-10 20:46:32 -04:00
Jean-Marc Valin
b5972388d7 Proper SILK delay compensation for resampling
Adds SILK delay compensation that depends on encode and decode sampling
rate, as well as SILK internal coding rate. This ensures that the SILK
part of Opus is always in sync with the CELT part no matter what the
sampling rates are. It also increases the resampling delay to 1.15 ms
(was previously 0.48 ms).
2011-10-07 11:46:01 -04:00
Jean-Marc Valin
1c2f5633d1 Removed all the silk_ prefixes in source file names (not symbols) 2011-09-16 01:16:53 -07:00
Renamed from silk/silk_dec_API.c (Browse further)