Commit graph

34 commits

Author SHA1 Message Date
Jean-Marc Valin
57cd849cf7 Defining celt_inner_prod() and using it instead of explicit loops.
Also adds an SSE-optimized celt_inner_prod().
2013-12-09 15:26:58 -05:00
Timothy B. Terriberry
5c02c5ffb5 Make celt_pitch_xcorr_edsp() work on ARMv5TE.
We were assuming that LDR, LDRD, and STRD could be used on
 unaligned addresses, but this turns out not to be true on really
 old hardware.
2013-11-26 21:58:35 -08: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
Jean-Marc Valin
a156c5ece7 Makes the SILK pitch search use celt_pitch_xcorr()
Should gives us ARM/SSE optimizations for free.
2013-08-26 19:27:46 -04:00
Jean-Marc Valin
b9176a4c3e Makes dual_inner_prod() more generic to increase its use 2013-06-17 16:37:41 -04:00
Jean-Marc Valin
71766ef7a4 Avoids symbol clashes with Speex (pitch_xcorr) and libm (y1) 2013-06-17 00:44:12 -04:00
Jean-Marc Valin
4e018b22bb SSE optimization of remove_doubling()
Should be trivial to adapt for Neon.
2013-06-13 23:51:58 -04:00
Jean-Marc Valin
068cbd89bf Creates xcorr_kernel() that gets used by pitch_xcorr, celt_fir and celt_iir. 2013-05-26 20:11:44 -04:00
Jean-Marc Valin
319fe445e3 oops (again) 2013-05-25 21:07:48 -04:00
Jean-Marc Valin
1cdc3f5a2d oops 2013-05-25 20:32:45 -04:00
Jean-Marc Valin
64ba502e2c Optimizes remove_doubling() by avoiding redundant calculations of yy
Using a sliding window to pre-compute all yy values.
2013-05-25 20:13:49 -04:00
Jean-Marc Valin
319df9a836 Fixes two warnings in pitch_xcorr()
Rename y0 and y1 because of the name clash with Bessel functions.
Initialize y_3 to zero because gcc is too dumb to realize it can't
be used uninitialized.
2013-05-25 02:51:56 -04:00
Jean-Marc Valin
e8e57a32f6 Optimizes _celt_autocorr() by using pitch_xcorr()
Computes most of the auto-correlation by reusing pitch_xcorr(). We only
need lag*(lag-1)/2 MACs to complete the calculations.
To do this, pitch_xcorr() was modified so that it no longer truncates the
length to a multiple of 4. Also, the xcorr didn't need the floor at -1.
As a side benefit, this speeds up the PLC, which uses a higher order LPC
filter.
2013-05-25 02:14:25 -04:00
Jean-Marc Valin
fbf99981a6 Merges the 4th order FIR with the first order FIR in pitch_downsample()
Also creates a new hardcoded 5th order fir.
2013-05-24 17:20:08 -04:00
Jean-Marc Valin
85a6618af8 Make pitch_xcorr() work when len and max_pitch aren't multiples of 4. 2013-05-24 03:41:04 -04:00
Jean-Marc Valin
088929d1f1 oops, removed a minus sign that should never have appeared 2013-05-24 01:38:06 -04:00
Jean-Marc Valin
559fbe8b16 Unrolled version of the pitch correlation
About 30% faster on x86.
2013-05-24 01:09:31 -04:00
Jean-Marc Valin
b7bd4c20ac celt_maxabs16() now returns an opus_val32 to avoid problems with -32768 2013-05-18 23:52:18 -04:00
Ralph Giles
027ec51bfe Fix MSVC format conversion warnings.
The Microsoft compiler warns about precision reduction from
default double literals to the floats we generally use outside
the fixed-point build. Avoid these by qualifying the literals
as floats.

Thanks to derf for review.
2012-10-23 10:49:18 -07:00
Jean-Marc Valin
7315b35e13 Merge branch 'exp_analysis7'
Conflicts:
	celt/celt.c
	celt/mdct.c
	include/opus_defines.h
	src/opus_encoder.c
2012-10-09 03:07:06 -04:00
Gregory Maxwell
de0b5324b6 Replace C99 restrict keyword with OPUS_RESTRICT.
We had previously advised people to -Drestrict on
non-C99 compilers, but this creates problems for
some of the MSVC headers. Instead this just
uses a macro and defines it sanely.
2012-07-18 12:12:35 -04:00
Jean-Marc Valin
0892c169c6 Tonality and pitch tuning
Tuned the tonality estimator to trigger on signals where only part of the
spectrum is tonal. Also tuned the pitch detector not to be confused
by short-term correlation.
2012-07-13 14:50:36 -04:00
Jean-Marc Valin
66ac10210c Fixes some cases where MIN/MAX macros result in duplicated function calls
Also enforces an upper bound of 510 kb/s even for frames that are
smaller than 20 ms. This reduces waste for high bitrate VBR.
2012-05-30 14:04:51 -04:00
Jean-Marc Valin
6ae5101fb4 Fixes a fixed-point overflow by scaling pitch search more conservatively 2012-05-11 12:09:05 -04:00
Jean-Marc Valin
9faea25d29 Fixes a (harmless) float overflow in the pitch search 2012-05-08 13:58:57 -04:00
Jean-Marc Valin
b3deb5342f Prevents remove_doubling() from considering negative pitch gains 2012-04-24 17:00:54 -04:00
Jean-Marc Valin
ab5a049705 Merge commit '390c89225d' 2012-04-24 13:39:22 -04:00
Jean-Marc Valin
cb05e7cd96 s/FOUNDATION/COPYRIGHT OWNER/ in CELT code and "glue code"
Also added 3rd clause to "master" COPYING file
2012-04-20 16:41:42 -04:00
Jean-Marc Valin
7aecadda2f Fixes a bug introduced by the previous commit
celt_ilog2() could be called with 0 which is undefined.
2012-04-07 23:03:24 -04:00
Jean-Marc Valin
178758b81a Fixes some overflows in the fixed-point pitch code
The overflows reported were:
- Syy in find_best_pitch() in pitch.c
- xy, xx and yy in remove_doubling() in pitch.c

The fixes are:
- Adaptive scaling in pitch_downsample() which also improves quality
- Adding a missing downshift in find_best_pitch()
- More conservative yshift when calling find_best_pitch()
2012-04-06 23:32:11 -04:00
Ralph Giles
120800f8fa Rename '_FOO' to avoid potentional collisions with reserved identifiers.
C reserves identifiers of the from _[A-Z]+ and we have a number of
those in the code. This patch renames the various function arguments,
MACROS and preprocessor symbols to avoid the reserved form.

It also removes the CHANNELS() macro altogether. This was a
minor optimization for TI DSP to force a mono-only build,
as were the associated local 'const' versions. Since stereo
support is manditory, it wasn't worth keeping.

Thanks to John Ridges for raising the issue, and Jean-Marc Valin
and Greg Maxwell for reviewing the changes.
2011-12-02 12:31:36 -05:00
Jean-Marc Valin
2779df7ff6 Renaming the CELT plc.c file to celt_lpc.c to avoid MSVC conflicts with Skype's PLC.c 2011-10-04 13:31:54 -04:00
Gregory Maxwell
5d5875a93a Add the noreturn attribute on the assert functions to aid static analysis, improve test_repacketizer error handling, and silence 19 clang static analysis errors with additional assertions. 2011-10-03 21:38:21 -04:00
Jean-Marc Valin
c37499090b renames the libcelt/ directory to celt/ 2011-09-13 18:21:18 -07:00
Renamed from libcelt/pitch.c (Browse further)