Commit graph

46 commits

Author SHA1 Message Date
Jean-Marc Valin
ef203135b4
Adding ENABLE_HARDENING
Enables "safes" assertions even with ENABLE_ASSERTIONS isn't set
2018-03-27 15:13:25 -04:00
Jean-Marc Valin
2da3721b16
Simplifying celt_fir5() since x==y and mem[]={0}
Addresses issue https://github.com/xiph/opus/issues/58
2017-10-08 03:21:38 -04:00
Linfeng Zhang
85fb8a1d17
Replace call of celt_inner_prod_c() (step 2)
Should call celt_inner_prod().
This requires the API change of celt_pitch_xcorr() by passing in
"arch".

We tested on x86 and arm, and got bit exact results as original.

Change-Id: I606915da6a196f327ce81f4a5ae32811f4c1fabb

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-06-06 17:12:20 -04:00
Linfeng Zhang
a1ae821c96
Replace call of celt_inner_prod_c() (step 1)
Should call celt_inner_prod().

This change is bit exact as original, except for x86 floating-point.
In x86 floating-point, it calls celt_inner_prod_sse() which may have
different output with the change of floating-point operations' orders.

Change-Id: Ia2381e2e198a84296ac28305183f15be842b3454

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2017-06-06 17:12:20 -04:00
Jean-Marc Valin
3609a2218e
Fixes some fixed-point 16-bit int overflows
The code would have run fine on 32-bit archs, but would have overflowed
on a 16-bit arch
2017-05-24 01:21:51 -04:00
Jean-Marc Valin
b66080a879 Fixes minor code quality issues in CELT
Reported by Durandal.
2016-06-20 12:11:05 -04:00
Jean-Marc Valin
ddea3a6fbf Fixes a fixed-point precision issue in remove_doubling()
This could lead to an integer overflow. Also, refactored the code a bit
2016-06-18 11:15:25 -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
Timothy B. Terriberry
aad281878d Fix celt_pitch_xcorr_c signature.
This should not take an arch parameter, so it can properly be used
 as a fallback for accelerated versions which do not.
This patch instead provides a separate version which can call
 accelerated helpers for platforms that have taken that approach.
2014-12-01 14:25:52 -08: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
29354ff6e0 Save more integer divisions on ARM when we know the operands are positive 2014-01-21 10:39:33 -05:00
Gregory Maxwell
a65db56e54 Fix declaration after statement in fixed point. 2014-01-08 11:48:38 -08:00
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)