Commit graph

82 commits

Author SHA1 Message Date
Jean-Marc Valin
6d584acd95 Renamed MDCT functions to avoid symbol clashes with Vorbis 2009-11-21 21:57:44 -05:00
Jean-Marc Valin
c2f7dff55a Added a SMALL_FOOTPRINT option 2009-10-24 11:44:07 -04:00
Jean-Marc Valin
789fc14163 Removing unused code in the entropy coder 2009-10-23 21:44:54 -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
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
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
80ed147663 The number of channels is now set when creating the states rather than when
creating the mode. This means that the same mode can be shared for mono and
stereo.
2009-10-15 21:45:32 -04:00
Jean-Marc Valin
1e3263a267 Fix for some test program compat and an assertion that didn't make sense anymore 2009-10-02 17:48:25 -04:00
Jean-Marc Valin
c08be4485b Implemented "raw bits"
Making it so all the information encoded directly with ec_enc_bits() gets
stored at the end of the stream, without going through the range coder. This
should be both faster and reduce the effects of bit errors.

Conflicts:

	tests/ectest.c
2009-07-23 07:33:24 -04:00
Gregory Maxwell
7c422653f3 Fix compilation of test cases with fixed-debug enabled 2009-07-01 03:50:44 -04:00
Gregory Maxwell
b92dce3270 Additional mathops.h tests. 2009-06-28 19:51:30 -04:00
Gregory Maxwell
083883e6c0 Fixes for the tests in pseudo-stack mode. 2009-06-04 21:42:47 -04:00
Gregory Maxwell
7aa0ed40c1 Make ectest use random random numbers. Add a new test
"tandem-test" which tests the encoder and decoder in
many modes.
2009-05-26 22:44:04 -04:00
Timothy B. Terriberry
d98d8ae087 CWRS clean-ups and optimizations.
Adds specialized O(N*log(K)) versions of cwrsi() and O(N) versions of icwrs()
 for N={3,4,5}, which allows them to operate all the way up to the theoretical
 pulse limit without serious performance degredation.
Also substantially reduces the computation time and stack usage of
 get_required_bits().
On x86-64, this gives a 2% speed-up for 256 sample frames, and almost a 16%
 speed-up for 64 sample frames.
2009-05-26 19:07:41 -04:00
Jean-Marc Valin
4d108fc37a Unit tests now #include the relevant source files to prevent symbol visibility
problems when building shared libraries only.
2008-12-23 09:31:39 -05:00
Timothy B. Terriberry
0268a99676 Fix ectest to not check a case which isn't guaranteed to work, and which we don't use.
When I removed the special case for EC_ILOG(0) in commit
 06390d082d, it broke ec_dec_uint() with _ft=1
 (which should encode the value 0 using 0 bits).
This feature was tested by ectest.c, but not actually used by libcelt.
An assert has been added to ec_dec_uint() to ensure that we don't try to use
 this feature by accident.
ec_enc_uint() was actually correct, but support for this feature has been
 removed and the assert put in its place.
2008-12-20 23:19:56 -05:00
Jean-Marc Valin
05acb73e36 fixed test for cases where M_PI isn't defined 2008-11-10 20:59:38 -05:00
Jean-Marc Valin
2b08d7a210 Removing the 64-bit part of the range coder. 2008-10-04 21:10:26 -04:00
Jean-Marc Valin
b155bb8860 Merge branch 'cwrs_speedup'
Conflicts:
	libcelt/cwrs.c
	tests/cwrs32-test.c
2008-09-21 22:38:43 -04:00
Timothy B.B Terriberry
5ee9715c5c Change cwrsi() to operate on rows of U instead of columns.
It is no slower with a large number of pulses, and as much as 30% faster with
 a large number of dimensions.
2008-09-21 21:37:41 -04:00
Jean-Marc Valin
b4ce40cb55 Fixing the manual stack handling code 2008-09-19 11:50:50 -04:00
Jean-Marc Valin
abf5c8ed64 Merge branch 'cwrs_speedup' (derf's cwrs changes)
Conflicts:
	libcelt/cwrs.c
2008-09-19 08:02:50 -04:00
Timothy B.B Terriberry
d910274f79 Change CWRS indexing to use Pyramid VQ's magnitude ordering.
This lets us encode and decode directly from the pulse vector without an
 intermediate transformation.
This makes old streams undecodable.
Additionally, ncwrs_u32() has been sped up for large N by using the sliding
 recurrence from Mohorko et al.
ncwrs_u64 could be sped up in a similar manner, but would require a larger
 table of multiplicative inverses (or several 32x32->64 bit multiplies).
Note that U(N,M) is now everywhere 1/2 the value it used to be.
2008-09-19 07:38:24 -04:00
Jean-Marc Valin
b781877e80 Converted everything to 32-bit CWRS (using split after that) 2008-09-12 21:27:35 -04:00
Jean-Marc Valin
45e358f696 Making the Laplace test case pass again 2008-05-28 00:58:42 +10:00
Jean-Marc Valin
2de66199b2 Disabled pulse spreading until I can show it actually helps 2008-05-05 16:05:34 +10:00
Jean-Marc Valin
cb1cf2f169 Brought the mdct test-case with the recent changes to the mdct semantic 2008-04-25 22:39:46 +10:00
Jean-Marc Valin
4989c1212a Moved the windowing from compute_inv_mdcts() to mdct_backward() 2008-04-22 12:18:36 +10:00
Jean-Marc Valin
30e1b4d36c Moved the windowing operation from compute_mdcts() to mdct_forward() in an
attempt to reduce copying.
2008-04-22 00:10:52 +10:00
Jean-Marc Valin
d7291d2430 Further simplifications to comb2pulses() to remove all conditional branches. 2008-04-21 07:53:40 +10:00
Jean-Marc Valin
f7cec83c59 pseudo-stack no longer checks on every function entry whether it has been
allocated
2008-04-18 17:29:56 +10:00
Jean-Marc Valin
e6ce0c6a22 optimisation: Removed a bunch of conditional branches from comb2pulse() 2008-04-18 16:46:39 +10: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
766257109e fixed a few warnings, no real change 2008-04-11 07:23:53 +10:00
Jean-Marc Valin
5a7d9b2c62 Fixed rsqrt testcase for float 2008-04-05 14:36:05 +10:00
Timothy B. Terriberry
d883670bf7 Rework CWRS code.
This eliminates an extra O(nm) lookups on decode, and reduces the rate control
 from O(nm^2) to O(nm), in addition to eliminating O(m) lookups on both encode
 and decode.
Although the interface is slightly more complex, the internal code is also
 simpler.
2008-04-05 14:31:35 +10: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
385795ed7b Fixed the rcp() testcase for new assumptions (x is positive) 2008-03-26 15:56:07 +11:00
Jean-Marc Valin
104c218c9b Random numbers should work on 16-bit archs. 2008-03-19 09:33:49 +11:00
Jean-Marc Valin
a82dfdd240 Adjusting/fixing warnings 2008-03-13 23:01:55 +11:00
Jean-Marc Valin
92518982cc Added mathops-test 2008-03-13 17:20:08 +11:00
Jean-Marc Valin
0ac437b82d Testcases should now work even when symbols aren't visible in the dso 2008-03-12 18:04:27 +11:00
Jean-Marc Valin
f8eb420a09 Changed the pulse spreading rotations so that the number of iterations is
variable instead of the angle. Should now be both less CPU-intensive and
makes fixed-point code simpler.
2008-03-07 14:44:56 +11:00
Jean-Marc Valin
9d312b9756 Defining RADIX_TWO_ONLY removes all butterflies, except for radix 2 and 4. 2008-03-05 17:34:45 +11:00
Jean-Marc Valin
7137c26e4f fixed-point: exp_rotation() now fully converted, using an approximation of the
cos() and sin() functions.
2008-03-04 17:43:09 +11:00
Jean-Marc Valin
227ad2f82d cwrs32-test should be 16-bit clean now. 2008-03-03 10:07:19 +11:00
Jean-Marc Valin
4c2787a45c Laplace encoder now works with 16-bit frequencies 2008-03-03 10:04:48 +11:00
Jean-Marc Valin
7ff2cbc1bd oops, fixed the Laplace testcase 2008-03-02 21:25:22 +11:00
Jean-Marc Valin
7cdc5a34a4 Making it easier to debug laplace testcase 2008-03-01 20:56:17 +11:00
Jean-Marc Valin
387a20d740 fixed-point: exp_rotation() mostly converted (still need to convert the cos/sin) 2008-02-27 13:49:54 +11:00