opus.git
2 years 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

2 years 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.

2 years 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()

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

2 years 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

2 years 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()

2 years 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

2 years 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

2 years 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.

2 years 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

2 years 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.

2 years 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).

2 years agoAvoiding an overflow in the LTP quantization
Jean-Marc Valin [Fri, 22 Jul 2016 19:58:30 +0000 (15:58 -0400)]
Avoiding an overflow in the LTP quantization

Reduces the XX values to avoid an overflow in silk_VQ_WMat_EC(), even in
floating-point.

2 years agoDisables MIPS silk_noise_shape_analysis_FIX() until it's updated
Jean-Marc Valin [Fri, 22 Jul 2016 19:40:40 +0000 (15:40 -0400)]
Disables MIPS silk_noise_shape_analysis_FIX() until it's updated

2 years agoMore headroom in fixed-point silk_burg_modified() to avoid an overflow
Jean-Marc Valin [Fri, 22 Jul 2016 19:14:34 +0000 (15:14 -0400)]
More headroom in fixed-point silk_burg_modified() to avoid an overflow

2 years agoIncrease headroom in silk_warped_autocorrelation_FIX()
Jean-Marc Valin [Fri, 22 Jul 2016 18:29:52 +0000 (14:29 -0400)]
Increase headroom in silk_warped_autocorrelation_FIX()

2 years agoIncrease headroom to avoid overflow in silk_pitch_analysis_core()
Jean-Marc Valin [Fri, 22 Jul 2016 18:25:03 +0000 (14:25 -0400)]
Increase headroom to avoid overflow in silk_pitch_analysis_core()

2 years agoPLC overflow fix
Jean-Marc Valin [Fri, 22 Jul 2016 15:47:01 +0000 (11:47 -0400)]
PLC overflow fix

2 years agoPrevent overflows in PLC celt_iir()
Jean-Marc Valin [Fri, 22 Jul 2016 15:05:19 +0000 (11:05 -0400)]
Prevent overflows in PLC celt_iir()

2 years agofixes overflows in celt_iir() by doing proper saturation
Jean-Marc Valin [Fri, 22 Jul 2016 13:13:00 +0000 (09:13 -0400)]
fixes overflows in celt_iir() by doing proper saturation

2 years agogetting rid of a PLC overflow (I think)
Jean-Marc Valin [Fri, 22 Jul 2016 01:56:55 +0000 (21:56 -0400)]
getting rid of a PLC overflow (I think)

2 years agopost-filter saturation
Jean-Marc Valin [Fri, 22 Jul 2016 01:56:44 +0000 (21:56 -0400)]
post-filter saturation

2 years agosaturate MDCT output
Jean-Marc Valin [Thu, 21 Jul 2016 23:48:55 +0000 (19:48 -0400)]
saturate MDCT output

2 years agosilencing overflows in MDCT and FFT
Jean-Marc Valin [Thu, 21 Jul 2016 23:40:23 +0000 (19:40 -0400)]
silencing overflows in MDCT and FFT

2 years agoReduce risk of overflowing in mono downsampling
Jean-Marc Valin [Fri, 22 Jul 2016 18:44:24 +0000 (14:44 -0400)]
Reduce risk of overflowing in mono downsampling

Not observed yet (except when caused by a different bug), but "just in case"

2 years agoAvoid overflowing on ridiculously large energy
Jean-Marc Valin [Fri, 22 Jul 2016 18:21:26 +0000 (14:21 -0400)]
Avoid overflowing on ridiculously large energy

2 years agoFixes shift<-2 case for denormalise_bands()
Jean-Marc Valin [Fri, 22 Jul 2016 18:42:29 +0000 (14:42 -0400)]
Fixes shift<-2 case for denormalise_bands()

2 years agoSilence fixed point unused parameter warning
Mark Harris [Fri, 22 Jul 2016 05:05:21 +0000 (22:05 -0700)]
Silence fixed point unused parameter warning

2 years agotest_opus_decode: Check all soft clip samples
Mark Harris [Fri, 22 Jul 2016 04:39:41 +0000 (21:39 -0700)]
test_opus_decode: Check all soft clip samples

2 years agotests: Avoid shift into sign undefined behavior
Mark Harris [Fri, 22 Jul 2016 04:22:22 +0000 (21:22 -0700)]
tests: Avoid shift into sign undefined behavior

2 years agoAvoids undefined behaviour from left-shifting negative values
Jean-Marc Valin [Thu, 21 Jul 2016 03:15:16 +0000 (23:15 -0400)]
Avoids undefined behaviour from left-shifting negative values

2 years agoFix use_dtx for DISABLE_FLOAT_API
Felicia Lim [Wed, 20 Jul 2016 11:37:13 +0000 (13:37 +0200)]
Fix use_dtx for DISABLE_FLOAT_API

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2 years agoFix include warning
Tristan Matthews [Wed, 20 Jul 2016 03:12:13 +0000 (23:12 -0400)]
Fix include warning

2 years agoFix include warning
Tristan Matthews [Wed, 20 Jul 2016 02:58:35 +0000 (22:58 -0400)]
Fix include warning

2 years agoAdds some smoothing to the energy quantization exp_lbr_tune
Jean-Marc Valin [Mon, 4 Jul 2016 05:06:11 +0000 (01:06 -0400)]
Adds some smoothing to the energy quantization

When the energy is stable, we slightly bias energy quantization towards
the previous error to make the gain more stable (a constant offset is
better than fluctuations).

We reduce the bitrate by about 0.2% to 1% at low bitrate for the same quality.

2 years agoTune SILK rate for hybrid with FEC enabled
Jean-Marc Valin [Tue, 21 Jun 2016 17:37:29 +0000 (13:37 -0400)]
Tune SILK rate for hybrid with FEC enabled

2 years agoMoving FEC decision to the Opus encoder level (from SILK level)
Jean-Marc Valin [Tue, 21 Jun 2016 16:38:25 +0000 (12:38 -0400)]
Moving FEC decision to the Opus encoder level (from SILK level)

2 years agoTaking loss rate into account in compute_equiv_rate()
Jean-Marc Valin [Mon, 20 Jun 2016 22:54:06 +0000 (18:54 -0400)]
Taking loss rate into account in compute_equiv_rate()

2 years agoRetuning the tf_analysis() lambda
Jean-Marc Valin [Wed, 8 Jun 2016 19:19:03 +0000 (15:19 -0400)]
Retuning the tf_analysis() lambda

Increasing the value at low rate seems to help a bit.

2 years agoFixes equiv_rate for CBR
Jean-Marc Valin [Wed, 8 Jun 2016 06:33:56 +0000 (02:33 -0400)]
Fixes equiv_rate for CBR

2 years agoMinor TF cleanup (tf_sum was useless), plus comments
Jean-Marc Valin [Wed, 8 Jun 2016 06:15:21 +0000 (02:15 -0400)]
Minor TF cleanup (tf_sum was useless), plus comments

2 years agoUse SPREAD_AGGRESSIVE on non-transient hybrid frames
Jean-Marc Valin [Mon, 6 Jun 2016 17:43:13 +0000 (13:43 -0400)]
Use SPREAD_AGGRESSIVE on non-transient hybrid frames

2 years agoDon't use too much temporal resolution on hybrid frames at low rate
Jean-Marc Valin [Mon, 6 Jun 2016 20:54:29 +0000 (16:54 -0400)]
Don't use too much temporal resolution on hybrid frames at low rate

Otherwise, we risk having "temporal holes" in the HF that anti-collapse
can't always fill in.

2 years agoDisable patch_transient_decision() on hybrid since it's causing artifacts
Jean-Marc Valin [Mon, 6 Jun 2016 20:52:50 +0000 (16:52 -0400)]
Disable patch_transient_decision() on hybrid since it's causing artifacts

It would trigger on the second frame of "S"s, causing holes in the spectrum

2 years agoCBR: set gains to their previons values where we're busting the budget
Jean-Marc Valin [Fri, 3 Jun 2016 20:27:48 +0000 (16:27 -0400)]
CBR: set gains to their previons values where we're busting the budget

2 years agoSet pulses to zero if we can't meet rate target
Jean-Marc Valin [Fri, 3 Jun 2016 19:49:11 +0000 (15:49 -0400)]
Set pulses to zero if we can't meet rate target

2 years agoNow that we're preventing huge gains, we no longer need to pretend there's
Jean-Marc Valin [Fri, 3 Jun 2016 19:20:28 +0000 (15:20 -0400)]
Now that we're preventing huge gains, we no longer need to pretend there's
no dither

2 years agoCBR: lock the gain on a subframe when the number of pulses stops going down
Jean-Marc Valin [Fri, 3 Jun 2016 18:53:06 +0000 (14:53 -0400)]
CBR: lock the gain on a subframe when the number of pulses stops going down

2 years agomerge back in the LTP gain safety limiter
Koen Vos [Fri, 3 Jun 2016 06:18:03 +0000 (14:18 +0800)]
merge back in the LTP gain safety limiter

2 years agoCBR: Using the same gain increase for fixed-point as for float
Jean-Marc Valin [Fri, 3 Jun 2016 19:26:47 +0000 (15:26 -0400)]
CBR: Using the same gain increase for fixed-point as for float

2 years agoOops, edited the wrong comment in the previous commit
Jean-Marc Valin [Thu, 2 Jun 2016 23:08:01 +0000 (19:08 -0400)]
Oops, edited the wrong comment in the previous commit

2 years agoRe-tuning compute_equiv_rate()
Jean-Marc Valin [Thu, 2 Jun 2016 22:15:00 +0000 (18:15 -0400)]
Re-tuning compute_equiv_rate()

2 years agoGetting rid of the SILK penalty for hybrid CBR.
Jean-Marc Valin [Thu, 2 Jun 2016 22:11:33 +0000 (18:11 -0400)]
Getting rid of the SILK penalty for hybrid CBR.

That was likely a mistake from a misunderstanding on the SILK bit allocation

2 years agoImproving CBR for hybrid mode
Jean-Marc Valin [Thu, 2 Jun 2016 21:54:14 +0000 (17:54 -0400)]
Improving CBR for hybrid mode

Hybrid CBR now simply forces the SILK CBR rate to the "target" value. Also,
we're getting rid of the -2 kb/s offset for CBR, which appeared to be harmful.
In the case of hybrid constrained VBR, the cap is computed in the same way
as the target.

2 years agoMaking the encoder more aggressive at using wider bandwidths
Jean-Marc Valin [Thu, 2 Jun 2016 19:50:22 +0000 (15:50 -0400)]
Making the encoder more aggressive at using wider bandwidths

2 years agocomment about reduced codelength component in LTP quantizer error metric
Koen Vos [Thu, 2 Jun 2016 15:03:27 +0000 (23:03 +0800)]
comment about reduced codelength component in LTP quantizer error metric

2 years agoavoid double if statement for finding best quantized LTP coefs
Koen Vos [Thu, 2 Jun 2016 14:35:58 +0000 (22:35 +0800)]
avoid double if statement for finding best quantized LTP coefs

2 years agoincrease NSQ decision delay from 32 to 40
Koen Vos [Wed, 1 Jun 2016 13:49:11 +0000 (21:49 +0800)]
increase NSQ decision delay from 32 to 40

2 years agoreduced noise floor in noise shaping analysis by 2 dB
Koen Vos [Wed, 1 Jun 2016 08:29:47 +0000 (16:29 +0800)]
reduced noise floor in noise shaping analysis by 2 dB

2 years agoincrease order of noise shaping filter
Koen Vos [Wed, 1 Jun 2016 08:10:57 +0000 (16:10 +0800)]
increase order of noise shaping filter

2 years agomore conservative scaling of LTP corrs; remove assert that checks for negative residu...
Koen Vos [Wed, 1 Jun 2016 05:14:32 +0000 (13:14 +0800)]
more conservative scaling of LTP corrs; remove assert that checks for negative residual energy; discard CB entries leading to such negative energies

2 years agoClean up: alignment of comments
Koen Vos [Sun, 21 Feb 2016 15:10:46 +0000 (23:10 +0800)]
Clean up: alignment of comments

2 years agoClean up: replace tabs by spaces
Koen Vos [Sun, 21 Feb 2016 08:21:03 +0000 (16:21 +0800)]
Clean up: replace tabs by spaces

2 years agoremoved prefilter
Koen Vos [Sun, 21 Feb 2016 03:34:11 +0000 (11:34 +0800)]
removed prefilter

The NSQ SSE optimizations are disabled for now because they need to be updated

2 years agoslight clean up
Koen Vos [Sat, 20 Feb 2016 13:29:03 +0000 (21:29 +0800)]
slight clean up

2 years agoundo some loop unrolling
Koen Vos [Fri, 19 Feb 2016 07:38:31 +0000 (15:38 +0800)]
undo some loop unrolling

2 years agopitch analysis (in FIX) now scales the input down at the start, instead of at every...
Koen Vos [Fri, 19 Feb 2016 03:11:20 +0000 (11:11 +0800)]
pitch analysis (in FIX) now scales the input down at the start, instead of at every stage

2 years agominor clean up of pointer offsets
Koen Vos [Fri, 19 Feb 2016 03:04:14 +0000 (11:04 +0800)]
minor clean up of pointer offsets

2 years agosimplified computation of LTP coefs
Koen Vos [Thu, 18 Feb 2016 13:01:43 +0000 (21:01 +0800)]
simplified computation of LTP coefs

2 years agoAttenuate SILK PLC gain only for unvoiced speech
Felicia Lim [Wed, 30 Mar 2016 13:46:59 +0000 (15:46 +0200)]
Attenuate SILK PLC gain only for unvoiced speech

2 years agoWe should now be able to be less conservative when using CBR
Jean-Marc Valin [Sun, 17 Apr 2016 07:20:46 +0000 (03:20 -0400)]
We should now be able to be less conservative when using CBR

2 years agoMakes the encoder more aggressive about meeting the rate target
Jean-Marc Valin [Wed, 20 Apr 2016 07:37:32 +0000 (03:37 -0400)]
Makes the encoder more aggressive about meeting the rate target

2 years agoUsing more fine-grained complexity settings for SILK
Jean-Marc Valin [Mon, 18 Apr 2016 17:39:41 +0000 (13:39 -0400)]
Using more fine-grained complexity settings for SILK

Only complexity 0-1 now uses the plain non-delayed-decision NSQ since its
quality is pretty bad. Previously 0-3 were using that plain NSQ.

2 years agoFixing bandwidth selection hysteresis
Jean-Marc Valin [Wed, 1 Jun 2016 00:49:41 +0000 (20:49 -0400)]
Fixing bandwidth selection hysteresis

Previously, the bandwidth detection could (e.g.) change the bandwidth
from fullband to superwideband, and the hysteresis would then cause
bandwidth to be stuck in superwideband.

2 years agoBoosting the high-band bitrate on transients for hybrid mode
Jean-Marc Valin [Tue, 31 May 2016 21:54:20 +0000 (17:54 -0400)]
Boosting the high-band bitrate on transients for hybrid mode

2 years agoFixes signed integer overlof in silk_ADD_POS_SAT32()
Jean-Marc Valin [Tue, 19 Apr 2016 20:21:08 +0000 (16:21 -0400)]
Fixes signed integer overlof in silk_ADD_POS_SAT32()

Removes unused 64-bit version

2 years agoTurn on DTX only when the noise is sufficiently quiet
Felicia Lim [Mon, 16 May 2016 13:52:44 +0000 (15:52 +0200)]
Turn on DTX only when the noise is sufficiently quiet

Computes a pseudo SNR as the ratio between the running peak signal
energy to instantaneous noise energy. DTX is turned on only if this is
higher than a pre-determined threshold.

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2 years agoNew DTX that works in all modes (SILK/CELT/HYBRID)
Felicia Lim [Mon, 16 May 2016 13:29:53 +0000 (15:29 +0200)]
New DTX that works in all modes (SILK/CELT/HYBRID)

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>
2 years agoSkip analysis if the frame contains only digital silence
Felicia Lim [Mon, 16 May 2016 13:11:10 +0000 (15:11 +0200)]
Skip analysis if the frame contains only digital silence

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2 years agoNLSF_VQ_MAX_SURVIVORS is no longer useful
Jean-Marc Valin [Sun, 22 May 2016 04:52:59 +0000 (00:52 -0400)]
NLSF_VQ_MAX_SURVIVORS is no longer useful

2 years agotake advantage of more efficient NLSF quantization by reducing number of survivors...
Koen Vos [Sun, 21 Feb 2016 06:27:11 +0000 (14:27 +0800)]
take advantage of more efficient NLSF quantization by reducing number of survivors in search

JMV: edited to be a little more conservative

2 years agoNLSF_del_dec_quant minor clean up
Koen Vos [Sun, 21 Feb 2016 05:52:21 +0000 (13:52 +0800)]
NLSF_del_dec_quant minor clean up

2 years agoNLSF_encode now also uses NLSF weights from table
Koen Vos [Sun, 21 Feb 2016 05:47:20 +0000 (13:47 +0800)]
NLSF_encode now also uses NLSF weights from table

2 years agoNLSF VQ now uses absolute error, and prediction
Koen Vos [Sun, 21 Feb 2016 05:31:19 +0000 (13:31 +0800)]
NLSF VQ now uses absolute error, and prediction

2 years agoNLSF decoding now uses tables for NLSF weights
Koen Vos [Sun, 21 Feb 2016 05:16:46 +0000 (13:16 +0800)]
NLSF decoding now uses tables for NLSF weights

2 years agoImplement sum_sqr_shift() using two passes with no branch inside the loops
Jean-Marc Valin [Fri, 19 Feb 2016 02:44:09 +0000 (10:44 +0800)]
Implement sum_sqr_shift() using two passes with no branch inside the loops

Slightly slower on x86, about the same speed on ARMv7, should be faster on
DSPs.

2 years agoSimplifying fast_atan2f()
Jean-Marc Valin [Wed, 11 May 2016 23:17:50 +0000 (19:17 -0400)]
Simplifying fast_atan2f()

2 years agoQuality: Increase CELT rate for voiced frames in hybrid mode
Jean-Marc Valin [Sat, 23 Apr 2016 04:34:53 +0000 (00:34 -0400)]
Quality: Increase CELT rate for voiced frames in hybrid mode

2 years agoBetter modeling of the effect of CBR and complexity
Jean-Marc Valin [Wed, 27 Apr 2016 08:04:50 +0000 (04:04 -0400)]
Better modeling of the effect of CBR and complexity

Should be able to make better mode/bandwidth decisions when CBR/complexity
are involved.

2 years agoRe-enabling high-band attenuation for hybrid mode
Jean-Marc Valin [Fri, 22 Apr 2016 20:13:46 +0000 (16:13 -0400)]
Re-enabling high-band attenuation for hybrid mode

The new attenuation is much smaller than previously.

2 years agoQuality: Retrained classifier MLP with better data
Jean-Marc Valin [Thu, 7 Jan 2016 20:49:36 +0000 (15:49 -0500)]
Quality: Retrained classifier MLP with better data

New MLP doesn't attempt to classify silence as speech/music

2 years agoUsing "hybrid" flag instead of "start!=0"
Jean-Marc Valin [Fri, 25 Dec 2015 18:12:58 +0000 (13:12 -0500)]
Using "hybrid" flag instead of "start!=0"

2 years agoQuality: Making the encoder more aggressive at using wider bandwidths
Jean-Marc Valin [Thu, 24 Dec 2015 19:45:53 +0000 (14:45 -0500)]
Quality: Making the encoder more aggressive at using wider bandwidths

2 years agoQuality: Removes high-band attenuation in hybrid mode -- at least for now
Jean-Marc Valin [Fri, 25 Dec 2015 18:40:54 +0000 (13:40 -0500)]
Quality: Removes high-band attenuation in hybrid mode -- at least for now

2 years agoQuality: Adds SILK rate interpolation function
Jean-Marc Valin [Thu, 24 Dec 2015 18:03:28 +0000 (13:03 -0500)]
Quality: Adds SILK rate interpolation function

2 years agoQuality: Makes real CELT VBR work for hybrid too
Jean-Marc Valin [Sun, 6 Dec 2015 15:50:15 +0000 (10:50 -0500)]
Quality: Makes real CELT VBR work for hybrid too

2 years agoQuality: Forces trim to 5 on hybrid mode
Jean-Marc Valin [Sat, 5 Dec 2015 19:31:54 +0000 (14:31 -0500)]
Quality: Forces trim to 5 on hybrid mode

This saves bits and makes more sense since alloc_trim_analysis()
mostly looks at the lower bands that are coded with SILK

2 years agoQuality: Encoding music in full-band stereo from 32 kb/s
Jean-Marc Valin [Sat, 28 Nov 2015 00:10:24 +0000 (19:10 -0500)]
Quality: Encoding music in full-band stereo from 32 kb/s

Gradual downmix now happens in the 24 kb/s to 32 kb/s range

2 years agoQuality: removes VBR attenuation at low bitrate
Jean-Marc Valin [Tue, 17 Nov 2015 04:03:17 +0000 (23:03 -0500)]
Quality: removes VBR attenuation at low bitrate

Turns out that even low bitrates benefit from VBR

2 years agoAdds checksum for 1.1.3
Jean-Marc Valin [Fri, 15 Jul 2016 20:03:47 +0000 (16:03 -0400)]
Adds checksum for 1.1.3