opus.git
13 months agoImproves CELT bit allocation at very low bitrates v1.2-alpha
Jean-Marc Valin [Wed, 2 Nov 2016 21:59:32 +0000 (17:59 -0400)]
Improves CELT bit allocation at very low bitrates

We now try not to fold below band 17 since that produces a lot of harshness.
This mostly helps around 32-40 kb/s.

13 months agoEliminate trailing spaces
Mark Harris [Wed, 2 Nov 2016 13:56:57 +0000 (06:56 -0700)]
Eliminate trailing spaces

13 months agoReduce redundancy when SILK uses too many bits
Mark Harris [Wed, 2 Nov 2016 13:18:25 +0000 (06:18 -0700)]
Reduce redundancy when SILK uses too many bits

Fix Hybrid redundancy assertion failure in ec_enc_shrink(), even
if SILK produces more than maxBits, by reducing or eliminating
redundancy when necessary.  Don't reserve space for redundancy that
is too small to be used for redundancy.  When there is not enough
space for redundancy, allow the regular frame to use all the bits.

13 months agoFix redundancy on SILK 80+ms bandwidth switch
Mark Harris [Wed, 2 Nov 2016 13:16:50 +0000 (06:16 -0700)]
Fix redundancy on SILK 80+ms bandwidth switch

With packets of 80 ms or more, a SILK bandwidth switch was missing
the second half of the redundancy, because st->silk_bw_switch was
cleared too early before any recursive calls.

13 months agoAdd copyright notice to autogen.sh to make the Chromium people happy
Jean-Marc Valin [Tue, 1 Nov 2016 23:00:34 +0000 (19:00 -0400)]
Add copyright notice to autogen.sh to make the Chromium people happy

13 months agoFixes NE10 configure problem
Jean-Marc Valin [Tue, 1 Nov 2016 22:41:23 +0000 (18:41 -0400)]
Fixes NE10 configure problem

As reported by agatx in https://trac.xiph.org/ticket/2291

13 months agoTemporarily disable -Wnonnull around an opus_decode() call in test_opus_decode.c
Jean-Marc Valin [Tue, 1 Nov 2016 20:10:36 +0000 (16:10 -0400)]
Temporarily disable -Wnonnull around an opus_decode() call in test_opus_decode.c

Reported by wtchang in trac: https://trac.xiph.org/ticket/2160

13 months agoBump static PACKAGE_VERSION string in version.mk
Jean-Marc Valin [Tue, 1 Nov 2016 01:49:49 +0000 (21:49 -0400)]
Bump static PACKAGE_VERSION string in version.mk

13 months agoFix amount of extra bytes reserved for 100 ms
Felicia Lim [Mon, 31 Oct 2016 18:58:26 +0000 (11:58 -0700)]
Fix amount of extra bytes reserved for 100 ms

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
13 months agoDon't use hybrid "weak transients" on vowels
Jean-Marc Valin [Sat, 29 Oct 2016 21:02:36 +0000 (17:02 -0400)]
Don't use hybrid "weak transients" on vowels

13 months agoAdds opus_encode_regressions.c to the MIPS Makefile
Jean-Marc Valin [Sat, 29 Oct 2016 20:46:55 +0000 (16:46 -0400)]
Adds opus_encode_regressions.c to the MIPS Makefile

13 months agoAdds opus_encode_regressions.c to the UNIX Makefile
Jean-Marc Valin [Sat, 29 Oct 2016 20:10:57 +0000 (16:10 -0400)]
Adds opus_encode_regressions.c to the UNIX Makefile

13 months agoNew regression test from Mark's fuzzing test cases
Jean-Marc Valin [Sat, 29 Oct 2016 18:45:30 +0000 (14:45 -0400)]
New regression test from Mark's fuzzing test cases

13 months agoDefine "weak transients" for low bitrate hybrid
Jean-Marc Valin [Fri, 28 Oct 2016 20:44:38 +0000 (16:44 -0400)]
Define "weak transients" for low bitrate hybrid

These rely on TF rather than short windows to avoid partial collapse.

13 months agoMultistream encoder: allocate an extra byte per stream for 100 ms
Felicia Lim [Fri, 28 Oct 2016 18:11:18 +0000 (11:11 -0700)]
Multistream encoder: allocate an extra byte per stream for 100 ms

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
13 months agoFix CBR packet sizes for 80 ms
Felicia Lim [Fri, 28 Oct 2016 16:34:51 +0000 (09:34 -0700)]
Fix CBR packet sizes for 80 ms

Also clean up comments from the last patches

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
13 months agoUpdate bandwidth and opusCanSwitch before generating SILK DTX ToC
Felicia Lim [Wed, 26 Oct 2016 23:48:38 +0000 (16:48 -0700)]
Update bandwidth and opusCanSwitch before generating SILK DTX ToC

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
13 months agoEncode correct headers when asking for very small output bytes and using long frames
Felicia Lim [Fri, 28 Oct 2016 00:00:05 +0000 (17:00 -0700)]
Encode correct headers when asking for very small output bytes and using long frames

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
13 months agoSupport encoding 80/100/120 ms frame lengths
Felicia Lim [Fri, 28 Oct 2016 00:03:36 +0000 (17:03 -0700)]
Support encoding 80/100/120 ms frame lengths

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
13 months agoMove multiframe encoding into a separate function
Felicia Lim [Thu, 22 Sep 2016 09:06:11 +0000 (11:06 +0200)]
Move multiframe encoding into a separate function

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
13 months agoFixes an unstable energy issue for low-bitrate hybrid
Jean-Marc Valin [Thu, 27 Oct 2016 18:14:28 +0000 (14:14 -0400)]
Fixes an unstable energy issue for low-bitrate hybrid

The transient detector would trigger on low-pitch vowels, but we didn't have
enough bits to properly code the high bands as a transient, resulting in
partial collapse and unstable energy.

13 months agoMake use of dot optional in generating documentation.
Ralph Giles [Thu, 27 Oct 2016 17:23:29 +0000 (10:23 -0700)]
Make use of dot optional in generating documentation.

Different distributions of doxygen have different default
values of HAVE_DOT setting, so we need to pick a specific
setting to avoid 'missing dot' warnings on some platforms.

Doxygen uses it to generate inclusion graphs for our various
header files, which is somewhat useful, but not essential.
We therefore enable dot if it's present (usually through
the parent graphviz package) but disable it if it's not
available, silencing the warning, but not giving uniform
results.

13 months agoAccount for redundancy signalling when computing st->silk_mode.maxBits
Jean-Marc Valin [Thu, 27 Oct 2016 04:11:26 +0000 (00:11 -0400)]
Account for redundancy signalling when computing st->silk_mode.maxBits

Without that, we could bust the budget and end up with the
if (ec_tell(&enc) <= 8*nb_compr_bytes)
being false, followed by an assert failure later.

13 months agoupdating update draft
Jean-Marc Valin [Fri, 21 Oct 2016 01:56:24 +0000 (21:56 -0400)]
updating update draft

14 months agoFixing some opus_int vs opus_int32 mismatches
Jean-Marc Valin [Wed, 5 Oct 2016 02:07:52 +0000 (22:07 -0400)]
Fixing some opus_int vs opus_int32 mismatches

Reported by Mark Warner.

14 months agoUsing OPUS_MOVE() instead of OPUS_COPY() to move redundancy bytes
Jean-Marc Valin [Tue, 20 Sep 2016 05:44:22 +0000 (01:44 -0400)]
Using OPUS_MOVE() instead of OPUS_COPY() to move redundancy bytes

memcpy() aliasing bug caught by Felicia's encoder fuzzing test

14 months agoConsider per-channel energy bits in surround_rate_allocation()
Jean-Marc Valin [Mon, 19 Sep 2016 21:18:58 +0000 (17:18 -0400)]
Consider per-channel energy bits in surround_rate_allocation()

This should also avoid cases where stereo streams receive fewer
bits than mono streams.

14 months agoFixes surround_analysis() for frame size > 20 ms
Jean-Marc Valin [Fri, 9 Sep 2016 20:13:43 +0000 (16:13 -0400)]
Fixes surround_analysis() for frame size > 20 ms

14 months agoRemove float ops from encoder settings fuzzer test
Felicia Lim [Fri, 16 Sep 2016 09:12:00 +0000 (11:12 +0200)]
Remove float ops from encoder settings fuzzer test

14 months agoFix mixed declarations and code
Jean-Marc Valin [Thu, 15 Sep 2016 19:02:00 +0000 (15:02 -0400)]
Fix mixed declarations and code

14 months agoFuzzer test for changing encoder settings online
Felicia Lim [Thu, 15 Sep 2016 09:23:54 +0000 (11:23 +0200)]
Fuzzer test for changing encoder settings online

14 months agoPrevents ridiculously large gains from causing inf/NaNs in float decoder
Jean-Marc Valin [Wed, 14 Sep 2016 15:38:15 +0000 (11:38 -0400)]
Prevents ridiculously large gains from causing inf/NaNs in float decoder

14 months agoFixing failure due to CBR allocating zero byte to a stream
Jean-Marc Valin [Fri, 9 Sep 2016 20:51:01 +0000 (16:51 -0400)]
Fixing failure due to CBR allocating zero byte to a stream

15 months agoFix ambisonics bitrate when bitrate_bps is OPUS_AUTO
Michael Graczyk [Wed, 7 Sep 2016 22:26:51 +0000 (15:26 -0700)]
Fix ambisonics bitrate when bitrate_bps is OPUS_AUTO

Change-Id: I16bd4cd990d8ad5888c9e30016218ac25242ecb5

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
15 months agoFixes an internal error in the Opus encoder
Jean-Marc Valin [Thu, 8 Sep 2016 02:04:49 +0000 (22:04 -0400)]
Fixes an internal error in the Opus encoder

The encoder would reserve bytes for redundancy and then decide to use
CELT, but not use those bytes.

15 months agoPrevent tonality estimator from running too often with 2.5 and 5 ms frames
Jean-Marc Valin [Wed, 7 Sep 2016 15:20:06 +0000 (11:20 -0400)]
Prevent tonality estimator from running too often with 2.5 and 5 ms frames

15 months agoPrevents an overflow in multi-stream encoder rate computation
Jean-Marc Valin [Wed, 7 Sep 2016 02:32:22 +0000 (22:32 -0400)]
Prevents an overflow in multi-stream encoder rate computation

Also avoids stupidly high/low rates

15 months agoAllow disabling phase inversion for multistream
Mark Harris [Sat, 3 Sep 2016 17:42:19 +0000 (10:42 -0700)]
Allow disabling phase inversion for multistream

Also clarify in doc that conformance issue relates to decoder only.

15 months agomisc fixes to update draft
Jean-Marc Valin [Fri, 2 Sep 2016 06:36:16 +0000 (02:36 -0400)]
misc fixes to update draft

15 months agominor fix to update draft
Jean-Marc Valin [Thu, 1 Sep 2016 18:33:54 +0000 (14:33 -0400)]
minor fix to update draft

15 months agovs2015: include files added in 76674fea
Ricardo Constantino (:RiCON) [Thu, 1 Sep 2016 18:21:03 +0000 (19:21 +0100)]
vs2015: include files added in 76674fea

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
15 months agoAdds two integer wrap-around issues to the update draft
Jean-Marc Valin [Thu, 1 Sep 2016 12:34:58 +0000 (08:34 -0400)]
Adds two integer wrap-around issues to the update draft

15 months agoMake it possible to ignore inverted phase stereo for downmix purposes exp_bitstream7
Jean-Marc Valin [Wed, 20 Apr 2016 17:27:06 +0000 (13:27 -0400)]
Make it possible to ignore inverted phase stereo for downmix purposes

15 months agoBitstream change: prevent noise injection in hybrid mode
Jean-Marc Valin [Mon, 6 Jun 2016 17:44:01 +0000 (13:44 -0400)]
Bitstream change: prevent noise injection in hybrid mode

This makes it possible to use folding rather than LCG noise in the second CELT
band (9.6 to 12 kHz) in hybrid mode.

15 months agoAdd configure option --enable-update-draft
Jean-Marc Valin [Wed, 31 Aug 2016 05:57:18 +0000 (01:57 -0400)]
Add configure option --enable-update-draft

15 months agoCorrect multistream variable frame size stride
Mark Harris [Sat, 27 Aug 2016 14:10:15 +0000 (07:10 -0700)]
Correct multistream variable frame size stride

The multistream encoder input has st->layout.nb_channels channels.
The number of channels actually encoded is st->layout.nb_streams +
st->layout.nb_coupled_streams, which may be fewer, so ideally it
would only analyze those when computing the optimal frame size, but
there is no code to do that currently.

15 months agoCorrect analysis downmix scaling factor
Mark Harris [Sat, 27 Aug 2016 14:03:02 +0000 (07:03 -0700)]
Correct analysis downmix scaling factor

Divide by the actual number of channels mixed

15 months agoProperly process both channels for DTX
Jean-Marc Valin [Thu, 25 Aug 2016 18:24:38 +0000 (14:24 -0400)]
Properly process both channels for DTX

Adding a "channels" argument to compute_frame_energy() and is_digital_silence()

15 months agoMake the DC rejection filter Q14 instead of Q15
Jean-Marc Valin [Sun, 21 Aug 2016 19:53:35 +0000 (15:53 -0400)]
Make the DC rejection filter Q14 instead of Q15

This avoids an overflow on extreme signals

15 months agoFixes an overflow in LPC_inverse_pred_gain_QA()
Jean-Marc Valin [Sun, 31 Jul 2016 02:40:48 +0000 (22:40 -0400)]
Fixes an overflow in LPC_inverse_pred_gain_QA()

We now declare that anything that would overflow is not stable enough

15 months agoRemoved a float operation that sneaked in in the fixed-point code
Jean-Marc Valin [Mon, 15 Aug 2016 23:50:45 +0000 (19:50 -0400)]
Removed a float operation that sneaked in in the fixed-point code

15 months agoOops, fixes the sign in dc_reject()
Jean-Marc Valin [Mon, 15 Aug 2016 23:19:47 +0000 (19:19 -0400)]
Oops, fixes the sign in dc_reject()

Thanks to Mark Harris for pointing it out.

15 months agoImplementing compute_frame_energy() from celt_inner_prod() for float
Jean-Marc Valin [Mon, 15 Aug 2016 22:24:30 +0000 (18:24 -0400)]
Implementing compute_frame_energy() from celt_inner_prod() for float

15 months agoSpeeding up PVQ search by allocating even more pulses in the projection.
Jean-Marc Valin [Mon, 15 Aug 2016 21:30:00 +0000 (17:30 -0400)]
Speeding up PVQ search by allocating even more pulses in the projection.

15 months agoReducing the overhead due to dependency chains in dc_reject() for stereo
Jean-Marc Valin [Mon, 15 Aug 2016 21:26:20 +0000 (17:26 -0400)]
Reducing the overhead due to dependency chains in dc_reject() for stereo

Gives another ~2% speedup

15 months agoReducing the dependency chain in dc_reject()
Jean-Marc Valin [Mon, 15 Aug 2016 20:46:05 +0000 (16:46 -0400)]
Reducing the dependency chain in dc_reject()

Speeds up the encoder by about 1%

15 months agoApply deemphasis to both channels in the same loop for the simple case
Jean-Marc Valin [Sun, 14 Aug 2016 21:56:45 +0000 (17:56 -0400)]
Apply deemphasis to both channels in the same loop for the simple case

This makes the decoder ~2.5% faster on x86 because the stereo loop
takes the same processing time as one mono loop due to the dependency chain

15 months agoMaking gcc use SSE directly for float->int conversion when available
Jean-Marc Valin [Sat, 13 Aug 2016 06:53:12 +0000 (02:53 -0400)]
Making gcc use SSE directly for float->int conversion when available

15 months agoReducing dependencies in deemphasis()
Jean-Marc Valin [Sat, 13 Aug 2016 03:49:35 +0000 (23:49 -0400)]
Reducing dependencies in deemphasis()

Reordering the add with VERY_SMALL changes the dependencies cycle from 2 add + 1 mul
(11 cycles on haswell) to 1 add + 1 mul (8 cycles). This makes the entire decoder about
1.5% faster.

16 months agoFixes problem with M_PI
Jean-Marc Valin [Fri, 12 Aug 2016 03:23:46 +0000 (23:23 -0400)]
Fixes problem with M_PI

16 months agoMaking stereo_itheta() use the same atan2() approximation as tonality_analysis()
Jean-Marc Valin [Thu, 11 Aug 2016 15:05:51 +0000 (11:05 -0400)]
Making stereo_itheta() use the same atan2() approximation as tonality_analysis()

16 months agoSSE2 implementation of the PVQ search
Jean-Marc Valin [Wed, 10 Aug 2016 03:22:27 +0000 (23:22 -0400)]
SSE2 implementation of the PVQ search

We used the SSE reciprocal square root instruction to vectorize the serch rather
than compare one at a time with multiplies. Speeds up the entire encoder by 8-10%.

16 months agoMaking signx[] an int in alg_quant() and removes unnecessary sign copying
Jean-Marc Valin [Sat, 6 Aug 2016 19:49:55 +0000 (15:49 -0400)]
Making signx[] an int in alg_quant() and removes unnecessary sign copying

No measurable speed change.

16 months agoSpeeding up PVQ using unlikely() and moving first position out of the loop
Jean-Marc Valin [Sat, 6 Aug 2016 05:01:13 +0000 (01:01 -0400)]
Speeding up PVQ using unlikely() and moving first position out of the loop

Speeds up encoding by another ~1-2%

16 months agoGetting gcc to use cmovs rather than branches in alg_quant()
Jean-Marc Valin [Sat, 6 Aug 2016 04:06:48 +0000 (00:06 -0400)]
Getting gcc to use cmovs rather than branches in alg_quant()

Speeds up CELT encoding by around 5% on x86

16 months agobiasing quantization
Jean-Marc Valin [Fri, 29 Jul 2016 17:47:07 +0000 (13:47 -0400)]
biasing quantization

16 months agoFixes "mixed declarations and code"
Jean-Marc Valin [Fri, 5 Aug 2016 21:34:04 +0000 (17:34 -0400)]
Fixes "mixed declarations and code"

16 months agoMaking it clearer to Coverity that nStates cannot exceed NLSF_QUANT_DEL_DEC_STATES
Jean-Marc Valin [Fri, 5 Aug 2016 21:15:14 +0000 (17:15 -0400)]
Making it clearer to Coverity that nStates cannot exceed NLSF_QUANT_DEL_DEC_STATES

16 months agoWeighting theta rdo based on channel energy
Jean-Marc Valin [Fri, 29 Jul 2016 03:26:29 +0000 (23:26 -0400)]
Weighting theta rdo based on channel energy

16 months agoFixes overflow in CNG
Jean-Marc Valin [Sat, 30 Jul 2016 15:38:28 +0000 (11:38 -0400)]
Fixes overflow in CNG

(found through fuzzing)

16 months agoDon't do theta RDO on intensity-stereo-coded bands
Jean-Marc Valin [Thu, 28 Jul 2016 19:05:36 +0000 (15:05 -0400)]
Don't do theta RDO on intensity-stereo-coded bands

16 months agoSaving the state rather than re-compute the best option
Jean-Marc Valin [Wed, 27 Jul 2016 13:24:26 +0000 (09:24 -0400)]
Saving the state rather than re-compute the best option

16 months agoMaking stereo theta decision based on minimizing distortion
Jean-Marc Valin [Wed, 6 Jan 2016 07:02:16 +0000 (02:02 -0500)]
Making stereo theta decision based on minimizing distortion

No point in minimizing the rate too since it's almost constant.

16 months agocontrolling rounding
Jean-Marc Valin [Tue, 5 Jan 2016 03:35:13 +0000 (22:35 -0500)]
controlling rounding

16 months agoProperly allocation scratch space for resynth encoder
Jean-Marc Valin [Tue, 26 Jul 2016 00:44:17 +0000 (20:44 -0400)]
Properly allocation scratch space for resynth encoder

16 months agocleanup: putting resynth flag in the context
Jean-Marc Valin [Tue, 5 Jan 2016 04:29:36 +0000 (23:29 -0500)]
cleanup: putting resynth flag in the context

16 months agocleanup: line wrapping
Jean-Marc Valin [Tue, 5 Jan 2016 03:09:54 +0000 (22:09 -0500)]
cleanup: line wrapping

16 months agoEnsure that NLSF cannot be negative when computing a min distance between them
Felicia Lim [Thu, 28 Jul 2016 13:21:19 +0000 (15:21 +0200)]
Ensure that NLSF cannot be negative when computing a min distance between them

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
16 months agoappveyor: Package includes and opus.lib as an artifact.
Ricardo Constantino (:RiCON) [Tue, 26 Jul 2016 22:18:38 +0000 (23:18 +0100)]
appveyor: Package includes and opus.lib as an artifact.

This lets projects which depend on opus build against our
test results.

Signed-off-by: Ralph Giles <giles@mozilla.com>
16 months agoVS2015: Ignore warning 4146 in celt/kiss_fft.c.
Ricardo Constantino (:RiCON) [Tue, 26 Jul 2016 19:35:42 +0000 (20:35 +0100)]
VS2015: Ignore warning 4146 in celt/kiss_fft.c.

Warning 4146 is "unary minus operator applied to unsigned type,
result still unsigned"

Signed-off-by: Ralph Giles <giles@mozilla.com>
16 months agowin32/.gitignore: Add DebugDLL_fixed.
Ricardo Constantino (:RiCON) [Tue, 26 Jul 2016 19:34:51 +0000 (20:34 +0100)]
win32/.gitignore: Add DebugDLL_fixed.

Signed-off-by: Ralph Giles <giles@mozilla.com>
16 months agoVS2015: Disable building DebugDLL opus_demo.
Ricardo Constantino (:RiCON) [Tue, 26 Jul 2016 18:35:58 +0000 (19:35 +0100)]
VS2015: Disable building DebugDLL opus_demo.

This works around the issue with using private symbols.

Signed-off-by: Ralph Giles <giles@mozilla.com>
16 months agovs2015: Merge opus dependencies into its project.
Ricardo Constantino (:RiCON) [Sat, 16 Jul 2016 00:55:28 +0000 (01:55 +0100)]
vs2015: Merge opus dependencies into its project.

Since DLL builds can't include both fixed and float, separate DLL_fixed
configurations added that include fixed silk code and also set FIXED_POINT.

Signed-off-by: Ralph Giles <giles@mozilla.com>
16 months agoVS2015: Mirror changes in *.mk files from exp_lbr_tune merge.
Ricardo Constantino (:RiCON) [Wed, 20 Jul 2016 14:26:19 +0000 (15:26 +0100)]
VS2015: Mirror changes in *.mk files from exp_lbr_tune merge.

Signed-off-by: Ralph Giles <giles@mozilla.com>
16 months agoTrim appveyor config.
Ralph Giles [Thu, 14 Jul 2016 05:23:58 +0000 (22:23 -0700)]
Trim appveyor config.

16 months agoAdd appveyor.yml to test VS2015 builds.
Ricardo Constantino (:RiCON) [Thu, 14 Jul 2016 01:41:46 +0000 (02:41 +0100)]
Add appveyor.yml to test VS2015 builds.

Signed-off-by: Ralph Giles <giles@mozilla.com>
16 months agoVS2015: Suppress a few warnings.
Ricardo Constantino (:RiCON) [Fri, 8 Jul 2016 22:28:49 +0000 (23:28 +0100)]
VS2015: Suppress a few warnings.

SDLCheck is a superset of BufferSecurityCheck and is off by default.
If it's set, it complains that it's overriden by BufferSecurityCheck.

Warning 4996 is already ignored in other binaries (fopen being deprecated and
suggesting fopen_s).

NoExtensions isn't a valid value for EnableEnhancedInstructionSet in x64 builds.

16 months agoCreate a simple project to create version.h.
Ricardo Constantino (:RiCON) [Fri, 15 Jul 2016 19:15:51 +0000 (20:15 +0100)]
Create a simple project to create version.h.

Run before any other project.

Avoids trying to create and replace version.h more than once which
led to file-locking errors with multicore builds.

Signed-off-by: Ralph Giles <giles@mozilla.com>
16 months agoDisabling the use of celt_fir() in silk_LPC_analysis_filter() by default
Jean-Marc Valin [Mon, 25 Jul 2016 16:08:08 +0000 (12:08 -0400)]
Disabling the use of celt_fir() in silk_LPC_analysis_filter() by default

16 months agoFixes an overflow in limit_warped_coefs()
Jean-Marc Valin [Mon, 25 Jul 2016 15:05:00 +0000 (11:05 -0400)]
Fixes an overflow in limit_warped_coefs()

For large values of maxabs_Q20, silk_MUL( maxabs_Q20, ind + 1 ) could
overflow.

16 months agoMove PLC LPC bandwidth expansion before the FIR to avoid overflows in celt_fir()
Jean-Marc Valin [Mon, 25 Jul 2016 14:23:07 +0000 (10:23 -0400)]
Move PLC LPC bandwidth expansion before the FIR to avoid overflows in celt_fir()

16 months agoFixes comment
Jean-Marc Valin [Mon, 25 Jul 2016 02:16:29 +0000 (22:16 -0400)]
Fixes comment

16 months agoFixes an overflow in amp2Log2() for very large encoder input
Jean-Marc Valin [Mon, 25 Jul 2016 02:06:08 +0000 (22:06 -0400)]
Fixes an overflow in amp2Log2() for very large encoder input

16 months agoFixes cap on gain in denormalise_bands()
Jean-Marc Valin [Sun, 24 Jul 2016 22:02:37 +0000 (18:02 -0400)]
Fixes cap on gain in denormalise_bands()

16 months agoFixes a shift<0 issue in transient_analysis()
Jean-Marc Valin [Sun, 24 Jul 2016 21:54:56 +0000 (17:54 -0400)]
Fixes a shift<0 issue in transient_analysis()

Fixes a potential overflow in high-passed signal for transient detection
and ensures that the shift can never go negative

16 months agoTighter bound in filter control in PLC
Jean-Marc Valin [Sun, 24 Jul 2016 21:49:58 +0000 (17:49 -0400)]
Tighter bound in filter control in PLC

We can't use the attenuation since it doesn't apply to the memory

16 months agoMore headroom in PLC code
Jean-Marc Valin [Sun, 24 Jul 2016 21:48:40 +0000 (17:48 -0400)]
More headroom in PLC code

extrapolation_len can be up to 960+120, so we we need a shift of 10
if the values are very large.

16 months agoSaturate MDCT output post-TDAC rather than pre-
Jean-Marc Valin [Sun, 24 Jul 2016 21:40:44 +0000 (17:40 -0400)]
Saturate MDCT output post-TDAC rather than pre-

Gives us a tighter bound on the pitch postfilter input to avoid overflows

16 months agoAvoids reading beyond the current buffer in comb_filter()
Jean-Marc Valin [Sun, 24 Jul 2016 19:37:27 +0000 (15:37 -0400)]
Avoids reading beyond the current buffer in comb_filter()

This could cause overflows when processing non-saturated TDAC values.

16 months agoDirectly saturate the comb filter output
Jean-Marc Valin [Sun, 24 Jul 2016 19:30:40 +0000 (15:30 -0400)]
Directly saturate the comb filter output

Otherwise, the output can grow as large as SIG_SAT/(1-0.75), which can cause
an overflow when adding two values (before multiplying by the filter tap).