Commit graph

41 commits

Author SHA1 Message Date
Jean-Marc Valin
eb8b3c2b07 Adds note on monic filter 2012-04-23 16:24:45 -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
Koen Vos
a51ebd6831 Accuracy improvements to help float implementations
Also clamps the gain to avoid forcing a float decoder to emulate the
state rescaling.
2011-12-14 11:41:18 -05:00
Koen Vos
bbfc9c9ee5 Improves the accuracy such that it matches a float decoder much better 2011-12-13 14:50:12 -05: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
Jean-Marc Valin
e1be1920ba Some minor (non-bitstream-affecting) changes to help us have better test vectors
These fix corner cases discovered during the latest fuzzing tests.
2011-11-28 22:48:01 -05:00
Jean-Marc Valin
09a84c8e4b Fixes a minor issue on CELT->SILK switching 2011-10-31 19:51:47 -04:00
Jean-Marc Valin
acd3bce9b4 Removes "set but never used" variables 2011-10-29 17:46:18 -04:00
Koen Vos
acc7a6c78b Reformatting changes with an update to the MSVC project files 2011-10-28 19:44:26 -04:00
Koen Vos
7f3caf941e Fixes another minor bug introduced in 43a0de4af1 2011-10-26 08:03:31 -04:00
Koen Vos
d39bccb0e1 Fixes a minor bug introduced in 43a0de4af1 2011-10-25 01:19:29 -04:00
Koen Vos
43a0de4af1 Optimization of the CBR loop
Also some comment/warning fixes
2011-10-24 09:10:58 -04:00
Gregory Maxwell
3d28ee8020 Fix stack corruption with high rate SILK encoding added by the recent CBR changes and enable -fstack-protector-all on gcc autotools builds. 2011-10-21 13:00:21 -04:00
Jean-Marc Valin
4871fb9281 Silences some warnings in fixed-point 2011-10-21 11:17:18 -04:00
Jean-Marc Valin
bfc67b95e2 Same as 44a030deed but for fixed-point 2011-10-21 11:10:43 -04:00
Jean-Marc Valin
294bfec27b Implements hard CBR for SILK
This is achieved by running the encoding process in a loop and
padding when we don't reach the exact rate. It also implements
VBR-with-cap, which means we no longer need to artificially decrease
the SILK bandwidth when it's close to the cap.
2011-10-20 00:39:41 -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
88e5cdc5ad Fix fixed-point build bustage from 53cc1a03. 2011-10-17 16:19:28 -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
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
Gregory Maxwell
a355d74efb Move a number of files and functions which are only used by fixed point builds from silk/ to silk/fixed/.
I attempted to not break the msvc projects, but I can't test them.
2011-10-10 20:53:48 -04:00
Jean-Marc Valin
e4de8a9c76 Fixes a bug that was falsely triggering DTX for 60 ms stereo
There's still a range coder mismatch on the first frame when using FEC.
2011-09-28 14:23:01 -04:00
Gregory Maxwell
7152a9aa9a Fix some GCC warings in the silk/ directory. 2011-09-27 21:33:14 -04:00
Jean-Marc Valin
9f90e57a9b Fixes a glitch in SILK mono->stereo switching
For these transitions, we now start the left and right resamplers
from the same state.
2011-09-27 14:10:23 -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
Jean-Marc Valin
fb3a437c9d Renaming the SKP_ prefix to silk_ 2011-09-16 00:58:26 -07:00
Jean-Marc Valin
2ca6c5d2c6 more libcelt->celt renames 2011-09-14 00:06:47 -07:00
Gregory Maxwell
16b25e908a Eliminate the last non-static pointer from the LPC-mode encoder structures.
The API permits the caller to freely copy the codec state on their
own, but this can't work if there are any any position dependant pointers
in the codec state.
2011-09-06 23:22:01 -04:00
Jean-Marc Valin
43da5898a0 This should remove the last // comments 2011-08-29 00:00:25 -04:00
Jean-Marc Valin
4dc0b39705 Replacing SPK_INLINE by static inline
The config.h will take care of compat issues with "inline"
2011-08-15 11:24:37 -04:00
Jean-Marc Valin
5a48412fda Including config.h from all the SILK files 2011-08-15 10:49:53 -04:00
Jean-Marc Valin
3120e225c2 Fixes a stereo rate mismatch bug
This is a tentative fix for a bug found in fuzzing where the encoder
switched from mono to stereo while in the process of changing bandwidth.
The result was that the newly added side would use the new sampling
rate, while the mid hadn't switched yet, causing an encoder/decoder
mismatch. The fix is that the side rate selection gets overridden
to use the mid rate.
The bug would occur when compiling with fuzzing enabled and using:
./test_opus 0 48000 2 24000 input.sw output.sw
2011-08-12 16:22:29 -04:00
Gregory Maxwell
ae2311455b Convert all CRLF in the SILK code, tabs to spaces, and trailing
whitespace.
2011-07-30 21:55:16 -04:00
Jean-Marc Valin
f9d14f8d77 Renamed SKP_[u]int* to opus_[u]int* 2011-07-29 18:39:57 -04:00
Jean-Marc Valin
f6e781ab8b Addressing multiple LSF-related issues
- Merged the LPC stabilization from NLSF2A_stable.c into NLSF2A.c
- The bandwidth expansion in NLSF2A() now operates on int32 LPC coefficients in
Q17 domain (instead of int16 Q12 coefficients)
- The function bwexpander_32() has a more precise way of updating the chirp
variable (round to nearest, instead of round down)
- Changed a few variables in NLSF_stabilize() from int16 to int32 to avoid signed
wrap-around (no difference in results as the wrap-around would always be reversed
later)
- The LSF codebook for WB speech has a quantization stepsize of 0.15 (was 0.16).
This doesn't break the bitstream, although it slightly limits quality of signals
encoded with the old version and decoded with the new one (I can't really hear it
and PESQ gives high scores as well).  I does improve handling of tonal signals.
- As discussed: the Q-domain of the poly function is now in Q16 (was Q20)
- As discussed: limiting the LSFs in NLSF_decode() to 0...32767
- The silk_NLSF_DELTA_MIN values were lowered to deal with a possible future situation with less or no input HP filtering.
2011-06-11 08:18:03 -04:00
Koen Vos
be75f1d0fe Fixes a crash on fixed-point stereo voice and some valgrind uninitialized errors 2011-05-25 17:18:02 -04:00
Wessel Lubberhuizen
ea259d6747 Fixing silk fixed point 2011-05-20 10:41:48 -04:00
Jean-Marc Valin
103302b375 Squashed commit of the following:
commit 5b64cf7c4d67af9050bc959996ef976ce6326888
Author: Jean-Marc Valin <jean-marc.valin@octasic.com>
Date:   Thu May 19 16:40:35 2011 -0400

    Fixes a few bugs introduced in the latest update

commit b91eb86025d2de3c4cf04f4fb1aa48a28ad676a3
Author: Timothy B. Terriberry <tterribe@xiph.org>
Date:   Thu May 19 16:12:02 2011 -0400

    build_draft.sh fixes

commit 0b10c30db7ad60ff7d4bfc1139bdb86e0543c035
Author: Jean-Marc Valin <jean-marc.valin@octasic.com>
Date:   Thu May 19 15:30:21 2011 -0400

    Fixes the draft build

commit 164424cded5978e657105104e171ac202dde5e5b
Author: Jean-Marc Valin <jean-marc.valin@octasic.com>
Date:   Thu May 19 15:00:23 2011 -0400

    Updated build system

commit 188d9fcba8c3a1b1ad67c67c430e1b37e3658a40
Author: Koen Vos <koen.vos@skype.net>
Date:   Thu May 19 17:14:57 2011 -0400

    SILK/Opus update
2011-05-19 17:17:44 -04:00
Koen Vos
494ce976e2 Squashed commit of the following:
commit dfe4d46f9abf6b0e96e66370d428da4e283204ce
Author: Jean-Marc Valin <jean-marc.valin@octasic.com>
Date:   Mon May 2 09:59:45 2011 -0400

    SILK file list update

commit 5faf541d86445eb8ce1775ea206e88afe83c7107
Author: Jean-Marc Valin <jean-marc.valin@octasic.com>
Date:   Mon May 2 09:51:29 2011 -0400

    Makefiles update

commit f5d70b3ccbe209cc07a1a604fffca93ea34bc64b
Author: Koen Vos <koen.vos@skype.net>
Date:   Mon May 2 09:50:33 2011 -0400

    SILK stereo update and MSVC build update
2011-05-02 10:01:10 -04:00
Jean-Marc Valin
b57996eeb8 Moving the SILK fixed-point and float files
to silk/fixed and silk/float, respectively
2011-04-29 15:27:43 -04:00