Commit graph

46 commits

Author SHA1 Message Date
Jean-Marc Valin
d77d6a58fc Renamed celt_[u]int* to opus_[u]int* 2011-07-29 17:33:06 -04:00
Jean-Marc Valin
3806c1d738 Relicensing under the simplified (2-clause) BSD license
Got authorization from all copyright holders
2011-02-09 22:37:41 -05:00
Jean-Marc Valin
79afa9c605 Fixes fixed-point overflow on really low energy
Makes celt_exp2() use Q10 input to avoid problems on very low energy.
Also makes the pitch downsampling more conservative on gain to avoid
problems later.
2011-01-27 10:46:01 -05:00
Jean-Marc Valin
736efd6909 Fixes some MSVC warnings 2010-08-31 11:52:45 -04:00
Timothy B. Terriberry
68242ac58c Eliminate the loop when decoding the split angle.
Use a closed-form formula for the search instead.
This requires an integer sqrt, so it is not actually closed-form,
 but the number of iterations is O(qb) instead of O(2**qb).
2010-07-28 00:20:16 +02:00
Jean-Marc Valin
48923ae996 Cleanup, de-inlining some math functions 2010-07-23 17:28:50 -04:00
Jean-Marc Valin
c239bd64dc removing some warnings 2010-06-21 01:01:17 -04:00
Jean-Marc Valin
6c3788cb53 Removing old PCL, added plc.h 2010-06-20 23:01:33 -04:00
Jean-Marc Valin
dc68eb231f Comments, code cleanup 2010-06-19 10:27:28 -04:00
Timothy B. Terriberry
dc8a6eee43 Update the log2 approximation to accomodate the increased bit precision from bd0610d21b. This requires another term in the power series to reduce the error to the level of truncation (peak absolute error 0.621785). Also refactor the rounding bias term so that further changes to DB_SHIFT will leave the result unbiased. 2010-03-16 00:17:38 -04:00
Jean-Marc Valin
bd0610d21b Increasing log energy resolution 2010-03-13 10:04:19 -05:00
Jean-Marc Valin
5ed24f8155 celt_ilog2() is only used in fixed-point mode 2009-10-31 13:43:43 -04:00
Timothy Terriberry
8c7bb4c9c7 Expose the normalized range for reciprocal square roots in fixed-point mode. This allows subsequnt calculations to use the full precision of the result. 2009-10-31 13:35:40 -04:00
Timothy B. Terriberry
a9ffc14ab7 Enhancements the fixed-point approximations of non-linear functions.
Accuracy for rsqrt, rcp, cos, and log2 is now at the level of truncation error
 for the current output resolution of these functions.
sqrt and exp2 still have non-trivial algebraic error, but this cannot be
 reduced much further using the current method without additional computation.
Also updates the fast float approximations for log2 and exp2 with coefficients
 that give slightly lower maximum relative error.

Patch modified by Jean-Marc Valin to leave the cos approximation as is and
leave the check for x<-15 in exp2 as is.
2009-10-21 20:30:46 -04:00
Timothy B. Terriberry
4a275d4d8f Accuracy improvements to the fixed-point celt_rsqrt(). 2009-10-20 07:14:24 -04:00
Jean-Marc Valin
234969c903 Removed the _t from all the celt*_t types to avoid clashing with POSIX 2009-10-17 22:12:42 -04:00
Jean-Marc Valin
8b2ff0da5a Updated copyright notices 2009-10-17 21:40:10 -04:00
Jean-Marc Valin
30f7f813ea Changed all the celt*int*_t types to remove the _t suffix, which is reserved
by POSIX. The other _t types that are not part of the API are still there
for now. Also, got rid of all that was left of the 64-bit types.
2009-10-17 14:35:13 -04:00
Jean-Marc Valin
ece2cfa2d2 removed useless comments 2009-07-04 22:46:38 -04:00
Gregory Maxwell
b92dce3270 Additional mathops.h tests. 2009-06-28 19:51:30 -04:00
Jean-Marc Valin
9dff02188c Minor stuff: preventing float underflow in celt_exp2(), preventing the use of
intra energy for low bitrates, and a bit of very high bitrate tuning
2009-06-15 22:40:06 -04:00
Jean-Marc Valin
f1ce900717 float approximations for log2() and exp2() 2009-06-13 22:30:46 -04:00
Jean-Marc Valin
d8dcd244ab This simplifies the energy quantisation by converting to the log2() scale
directly instead of converting to dB and later dividing by 6.
2009-06-07 13:01:25 -04:00
Jean-Marc Valin
ca53b7c919 Squashed commit of the following:
commit ea807b68678dd76175def2c5eb006c6bdb16679e
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Wed Mar 25 23:24:41 2009 -0400

    cleanup before merge

commit 73ad1a0202641be6a23903e464ece21fe332a131
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sat Mar 21 00:02:16 2009 -0400

    Some tuning of the new stereo

commit c05057eb57a7723045214a2f830fd561388ae48a
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sun Mar 15 19:56:11 2009 -0400

    fixed-point: atan2() converted

commit a8476cf8be55b0612d42df98d9807ca1335adfe3
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sat Mar 14 23:10:04 2009 -0400

    fixed-point: Getting the new stereo code working in fixed-point (still more
    work left)

commit 70a452761a5ce15700664e7167886dce5914cbd0
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Mon Mar 2 23:36:25 2009 -0500

    Coding left and right independently for lower bands

commit 4efd1e6385c7d036749080265a8d26668312b91b
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sun Mar 1 23:56:46 2009 -0500

    Removed the sqrt(C) from the normalisation, which simplifies a lot of things.

commit a4f3c5c60bc396bf644afa49b49e6b24ccf144f8
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Fri Feb 20 20:49:38 2009 -0500

    Better point stereo calculation when we don't encode the side anyway

commit f08525de4739f4017d19ec2e2022883deda8f826
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Thu Feb 19 19:43:09 2009 -0500

    Apparently, Timothy's calculations for fine energy allocation also apply
    to the quantisation of theta.

commit 6548cffc9d3f996b8a8dbfab982f0da0bc6c2dc2
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Thu Feb 19 07:35:24 2009 -0500

    Better handling of the "theta bits" and disabling the orthogonalize()

commit 7aa82c694967afa85dd30be8cc670663f98829fe
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Wed Feb 18 08:01:07 2009 -0500

    tuning the new stereo

commit c2b780a773de66fd9613c7cd54c09b705fe9ce45
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sun Feb 15 22:24:52 2009 -0500

    The new stereo coupling actually decodes properly now.

commit 85513c203d773bebcf0a6055f953170d563d890c
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sun Feb 15 21:31:16 2009 -0500

    First attempt at a new "constrained" MS stereo scheme
2009-03-26 20:23:14 -04:00
Jean-Marc Valin
5c3bc67959 Fixed a bunch of fixed-point overflows on insanely hot signals by changing
the time-domain representation from Q14 to Q12 (Q29 to Q27 using the
standard convention).
2008-08-28 23:34:24 -04:00
Jean-Marc Valin
558c50eb3d optimisation: Making it clear to the compiler that many of the loops in cwrs
need to iterate at least once.
2008-04-16 14:15:07 +10:00
Jean-Marc Valin
d568303134 optimisation: simplified the "full gain" case of alg_quant() to remove some
32-bit muls.
2008-04-15 18:04:33 +10:00
Jean-Marc Valin
98c86c7885 Trying to clean up celt_ilog2() vs. EC_ILOG a bit. 2008-03-27 08:40:45 +11:00
Jean-Marc Valin
189acec5d3 optimisation: defined a reciprocal square root (celt_rsqrt) for use in
find_spectral_pitch instead of using celt_rcp(celt_sqrt(x))
2008-03-26 16:42:42 +11:00
Jean-Marc Valin
ac72c2821a oops. find_max32() now uses VERY_LARGE32 (instead of VERY_LARGE16) 2008-03-25 21:31:12 +11:00
Jean-Marc Valin
44c63350d1 optimisations: Another bunch of simplifications to alg_quant(), mainly to
remove unnecessary copying and some conditional branches.
2008-03-25 21:28:40 +11:00
Jean-Marc Valin
49134381d0 optimisations: caching sign of x in alg_quant(), changed celt_div()/celt_rcp()
to assume denominator is positive.
2008-03-25 16:07:05 +11:00
Jean-Marc Valin
17ad401c2c defined find_max16 and overrode it for C55x 2008-03-23 08:06:29 +11:00
Jean-Marc Valin
dc767f67f9 No longer trying to save bits when encoding integers near the upper limit
(and fix for celt_div with 16-bit numerator on a 16-bit CPU)
2008-03-22 22:23:58 +11:00
Jean-Marc Valin
2282383434 fixed-point: added cheap celt_div() division using a reciprocal 2008-03-22 21:17:45 +11:00
Jean-Marc Valin
9901cb9e82 fixed-point: defined celt_maxabs16() as basic operator 2008-03-21 11:13:51 +11:00
Jean-Marc Valin
83006eec60 fixed-point: using TI intrinsic for celt_ilog2() if available. 2008-03-21 10:40:43 +11:00
Jean-Marc Valin
4ff068e670 Some work on assertions. 2008-03-15 23:34:39 +11:00
Jean-Marc Valin
15b9be3a29 fixed-point: playing it safe. SHL32() now automatically casts input to 32-bit
to prevent surprises. Also, a few comments.
2008-03-14 17:58:33 +11:00
Jean-Marc Valin
19ae9fc944 fixed-point: simplifying the arithmetic in alg_quant() 2008-03-13 11:18:15 +11:00
Jean-Marc Valin
3ec78b173b More accurate sqrt approximation using MULT16_16_Q15() instead of Q14. 2008-03-12 23:00:42 +11:00
Jean-Marc Valin
887ad9ff29 Increased accuracy of the reciprocal approximation and made it use
MULT16_16_Q15() instead of Q14 (should be faster).
2008-03-12 21:34:50 +11:00
Jean-Marc Valin
931db72e75 Defined the celt_rcp() reciprocal approximation 2008-03-12 11:28:26 +11:00
Jean-Marc Valin
68b02b1025 fixed-point: copied the exp2 implementation from Speex, using it for dB2Amp() 2008-02-28 23:37:26 +11:00
Jean-Marc Valin
2eaba8ac1f fixed-point: log approximation 2008-02-28 22:14:54 +11:00
Jean-Marc Valin
3ca9b1d295 fixed-point: Moved sqrt and cos approximations to mathops.h 2008-02-27 23:50:31 +11:00