Commit graph

62 commits

Author SHA1 Message Date
Niclas Olmenius
06a651547f
Fix celt decoder assertion when using OPUS_CUSTOM
When using OPUS_CUSTOM, `CELTDecoder->end` can be larger than 21.
Assert against 25 instead in OPUS_CUSTOM builds.

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2020-04-13 03:09:05 -04:00
Jean-Marc Valin
aebc9046f9
Renaming compute_allocation to clt_compute_allocation() to avoid symbol clashes
As suggested in https://github.com/xiph/opus/pull/83
2018-10-16 15:57:04 -04:00
Jean-Marc Valin
574d50cb57
Adding decoder state validation 2018-03-27 15:13:26 -04:00
Jean-Marc Valin
d8b1fd4ad0
Enable RFC 8251 changes by default 2017-10-29 01:01:35 -04:00
Jean-Marc Valin
072d133f78
Fixes CELT PLC
The regression was introduced in 783ad76766
by changes to celt_fir() that make it no longer in-place.
2017-10-06 18:24:57 -04:00
Linfeng Zhang
783ad76766 Revise celt_fir_c() to not pass in argument "mem"
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.
2017-01-17 14:04:37 -08:00
Jean-Marc Valin
18a380a7c2
Make it possible to ignore inverted phase stereo for downmix purposes 2016-09-01 01:23:06 -04:00
Jean-Marc Valin
11dba8d902 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
2016-08-14 17:56:45 -04:00
Jean-Marc Valin
9f7e502e06 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.
2016-08-12 23:49:35 -04:00
Jean-Marc Valin
35cf18e9d7 Making stereo theta decision based on minimizing distortion
No point in minimizing the rate too since it's almost constant.
2016-07-28 15:16:13 -04:00
Jean-Marc Valin
ee44ff86c6 Move PLC LPC bandwidth expansion before the FIR to avoid overflows in celt_fir() 2016-07-25 10:23:07 -04:00
Jean-Marc Valin
223657b51b Tighter bound in filter control in PLC
We can't use the attenuation since it doesn't apply to the memory
2016-07-24 21:35:24 -04:00
Jean-Marc Valin
52ded42ad9 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.
2016-07-24 21:35:24 -04:00
Jean-Marc Valin
1a37d4e15c Saturate MDCT output post-TDAC rather than pre-
Gives us a tighter bound on the pitch postfilter input to avoid overflows
2016-07-24 21:35:24 -04:00
Jean-Marc Valin
646fcc33d7 PLC overflow fix 2016-07-22 15:57:01 -04:00
Jean-Marc Valin
3c60bae2d7 Prevent overflows in PLC celt_iir() 2016-07-22 15:57:01 -04:00
Jean-Marc Valin
184a4767aa getting rid of a PLC overflow (I think) 2016-07-22 15:57:01 -04:00
Jean-Marc Valin
ae33218495 Reduce risk of overflowing in mono downsampling
Not observed yet (except when caused by a different bug), but "just in case"
2016-07-22 15:30:19 -04:00
Felicia Lim
787eee29b8 Turn on CELT's PLC only if there are >=2 packets received consecutively.
Avoids generating comfort noise with unwanted tones in DTX mode.
2016-04-15 21:32:46 -04:00
Jean-Marc Valin
cfaf14788e Make the CELT background noise estimator adapt more quickly on DTX update 2015-12-04 16:11:39 -05:00
Jean-Marc Valin
1970d5becd Always use the max of the decaying PLC energy and the background noise
Should no longer cause discontinuities in the noise after 5 packets
2015-12-04 13:46:09 -05:00
Viswanath Puttagunta
19c5406cde armv7(float): Optimize decode usecase using NE10 library
Optimize opus decode (float only) use case using ARM NE10.
Mainly effects opus_ifft and ctl_mdct_backward and related
functions.

Work based on previous Encode optimization using ARM NE10
library. See previous commit for details on how to enable
this.

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2015-10-07 18:09:20 -04:00
Jonathan Lennox
43120f0075 Reorganize x86 SSE intrinsics code.
Enable x86 intrinsics when building in floating-point mode.
Support SSE as an arch value.
Use RTCD to conditionally enable existing floating-point Celt SSE code.
Call functions directly (without RTCD) when their architecture can be presumed.
Use SSE4.1 intrinsics optimized code for Silk even in floating-point mode.
2015-09-01 17:21:31 -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
2e6876c07a Using SSAT in SIG2WORD16() on ARMv6 2014-01-22 19:22:05 -05:00
Jean-Marc Valin
9134e96cb2 Fixes SMALL_FOOTPRINT for float 2014-01-07 17:50:46 -05:00
Jean-Marc Valin
e17ca25617 Don't allocate pulses on the stack when calling the SILK PLC.
Also minor C89 fix for the previous commit
2014-01-07 15:27:02 -05:00
Jean-Marc Valin
b63e7110cb Moves CELT PLC pitch search to a separate function to reduce peak stack 2014-01-07 15:02:43 -05:00
Jean-Marc Valin
5f807c176f Adds SMALL_FOOTPRINT hack to the CELT PLC too 2014-01-07 04:48:42 -05:00
Jean-Marc Valin
9d1b6fef2a Moves deemphasis() call out of celt_decode_lost() to reduce peak stack 2014-01-07 04:32:41 -05:00
Jean-Marc Valin
ad8371d172 Cleaning up leftovers of "freq" in celt_decode_with_ec() 2014-01-06 17:45:57 -05:00
Jean-Marc Valin
4d07b1357e Reduces the decoder stack use by removing the pcm_silk buffer in fixed-point
We only keep when concealing less than 10ms with SILK.
2014-01-06 17:43:20 -05:00
Jean-Marc Valin
14ca4ed682 Moves the remains of compute_inv_mdcts() to celt_synthesis() 2014-01-06 09:31:09 -05:00
Jean-Marc Valin
32454dcadc Hack that makes the SMALL_FOOTPRINT CELT decoder use only 4.25 kB of stack. 2014-01-06 09:11:52 -05:00
Jean-Marc Valin
bdc7b93358 Reduces decoder stack usage by only storing one channel of denormalized MDCT 2014-01-06 08:58:38 -05:00
Jean-Marc Valin
4a6744a446 Some cleaning up of the synthesis code. 2014-01-05 21:40:02 -05:00
Jean-Marc Valin
e1f846208e Minor cleanup -- nothing to see here 2013-12-29 18:45:49 -05:00
Jean-Marc Valin
91f8010108 Removing indirections 2013-12-10 22:09:33 -05:00
Jean-Marc Valin
d5553e8aca Using OPUS_COPY()/OPUS_CLEAR() in the decoder too 2013-12-10 02:32:26 -05:00
Jean-Marc Valin
96408b6295 Fixes Opus-custom preemphasis
Also adds denorm avoidance for non-48 kHz rates
2013-12-02 20:02:37 -05:00
Timothy B. Terriberry
39386e0b85 Adds Neon assembly for correlation/convolution
Optimizing celt_pitch_xcorr()/xcorr_kernel() which also speeds up
FIRs, IIRs and auto-correlations

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2013-11-18 13:41:17 -05:00
Gregory Maxwell
60429d366f Avoid a bogus uninitialized warning and simplify some code. 2013-10-28 12:55:41 -07:00
Gregory Maxwell
7830cf1bd2 Replace "inline" with OPUS_INLINE.
Newer versions of MSVC are unhappy with the strategy of the build
 environment redefining "inline" (even though they don't support the
 actual keyword). Instead we define OPUS_INLINE to the right thing
 in opus_defines.h.

This is the same approach we use for restrict.
2013-10-28 10:18:54 -07:00
Jean-Marc Valin
260474fb81 Fixes a denorm problem when the input goes silent after active audio 2013-07-12 01:22:09 -04:00
Jean-Marc Valin
ee2506b2c7 Moves log2Amp inside denormalise_bands() and get rid of bandE[]
Also get rid of the MSE measurement code which is outdated and no longer useful
2013-06-16 20:24:52 -04:00
Jean-Marc Valin
3afc6ffff0 Don't call denormalise_bands() on silence 2013-06-16 15:40:10 -04:00
Aurélien Zanelli
cd4c8249bc Add run-time CPU detection and support for ARM architecture
Run-time CPU detection (RTCD) is enabled by default if target platform support
it.
It can be disable at compile time with --disable-rtcd option.

Add RTCD support for ARM architecture.

Thanks to Timothy B. Terriberry for help and code review

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2013-06-04 16:23:22 -07:00
Jean-Marc Valin
2fe4700f76 Skip down-sampling in deemphasis() when not needed. 2013-05-26 18:54:25 -04:00
Jean-Marc Valin
efdd314305 Fixes fixed-point PLC issue reported in trac ticket #1954
A fixed shift factor was insufficient to properly estimate the decay
factor, resulting in extreme attenuation of the PLC excitation.
2013-05-18 02:18:42 -04:00
Timothy B. Terriberry
c152d602aa Use dynamic stack allocation in the SILK encoder.
This makes all remaining large stack allocations use the vararray
 macros.
This continues the work of 6f2d9f50 to allow compiling with
 NONTHREADSAFE_PSEUDOSTACK to move the memory for large buffers
 off the stack for devices where it is very limited.

It also does this for some additional large buffers used by the
 PLC in the decoder.
2013-05-08 10:37:17 -07:00