Commit graph

63 commits

Author SHA1 Message Date
Gregory Maxwell
6cd4e2cd01 Fix dump_modes for the api change and move it into a subdirectory
with a trivial makefile.
2011-09-01 14:17:26 -04:00
Gregory Maxwell
11785e92c3 Make dump_modes.c include the arguments in the output. 2011-08-15 13:03:25 -04:00
Gregory Maxwell
5cfa0a0ea2 Respect the ANSI C89 maximum line length. 2011-08-15 12:35:10 -04:00
Gregory Maxwell
86dd98409f Rearrange mode structure to avoid wasting memory from padding. 2011-08-12 19:06:25 -04:00
Gregory Maxwell
63fd63d665 Rename libcelt/static_modes_(fixed|float).c to .h to better reflect
their usage and to make any toolchain that doesn't like to #include
.c file happy.
2011-08-02 17:13:06 -04:00
Gregory Maxwell
06d57b2165 Fix varrious splint warnings, C89 compatibility, and compilation with the
draft makefile. Increase precision of the static modes table.
2011-08-01 23:07:13 -04:00
Gregory Maxwell
662587d9c5 Remove many unused defines and convert some double constants to float. 2011-08-01 20:41:54 -04:00
Gregory Maxwell
71d39ad841 Correct many whitespace errors under libcelt/ and remove
non-ascii characters from the source.
2011-07-30 21:54:59 -04:00
Jean-Marc Valin
ff5f7228fd Renamed celt_word* to opus_val* 2011-07-29 18:59:12 -04:00
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
Timothy B. Terriberry
aa6fec669e Limit mode creation to supported modes.
We did no real error checking to see if a mode is supported when it
 is created.
This patch implements checks for Jean-Marc's rules:
1) A mode must have frames at least 1ms in length (no more than
    1000 per second).
2) A mode must have shorts of at most 3.33 ms (at least 300 per
    second).
It also adds error checking to dump_modes so we report the error
 instead of crashing when we fail to create a mode.
2011-02-01 18:58:07 -05:00
Jean-Marc Valin
665da0ba4d Merge branch 'exp_api_change' 2011-01-30 13:39:56 -05:00
Timothy B. Terriberry
c564307463 Use a smarter per-band bitrate cap.
The previous "dumb cap" of (64<<LM)*(C<<BITRES) was not actually
 achievable by many (most) bands, and did not take the cost of
 coding theta for splits into account, and so was too small for some
 bands.
This patch adds code to compute a fairly accurate estimate of the
 real maximum per-band rate (an estimate only because of rounding
 effects and the fact that the bit usage for theta is variable),
 which is then truncated and stored in an 8-bit table in the mode.

This gives improved quality at all rates over 160 kbps/channel,
 prevents bits from being wasted all the way up to 255 kbps/channel
 (the maximum rate allowed, and approximately the maximum number of
 bits that can usefully be used regardless of the allocation), and
 prevents dynalloc and trim from producing enormous waste
 (eliminating the need for encoder logic to prevent this).
2011-01-30 11:42:38 -05:00
Jean-Marc Valin
d9e4b1d72c Adding the auto-generated static modes for float and fixed 2011-01-28 22:24:40 -05:00
Timothy B. Terriberry
ef2e650592 Add coarse energy entropy model tuning.
This tunes the entropy model for coarse energy introduced in commit
 c1c40a76.
It uses a constant set of parameters, tuned from about an hour and a
 half of randomly selected test data encoded for each frame size,
 prediction type (inter/intra), and band number.
These will be slightly sub-optimal for different frame sizes, but
 should be better than what we were using.

For inter, this saves an average of 2.8, 5.2, 7.1, and 6.7 bits/frame
 for frame sizes of 120, 240, 480, and 960, respectively.
For intra, this saves an average of 1.5, 3.0, 4.5, and 5.3 bits/frame
 (for the same frame sizes, respectively).
2010-11-09 17:54:41 +08:00
Jean-Marc Valin
8f6d12beec Adding float|fixed suffixes to static mode files 2010-11-06 12:11:18 -04:00
Jean-Marc Valin
9e72ae2128 Fixes an index bug in dump_modes 2010-09-03 15:12:35 -04:00
Jean-Marc Valin
5c559ede28 More sharing across different static modes 2010-09-03 14:27:52 -04:00
Jean-Marc Valin
e0c25452e8 static modes simplifications for std mode 2010-09-03 11:52:38 -04:00
Jean-Marc Valin
f9950e0624 Remove model markers 2010-08-27 16:15:20 -04:00
Jean-Marc Valin
ae035a540b Fixes an off-by-one bug in the static mode's MDCT twiddles 2010-08-25 22:41:00 -04:00
Jean-Marc Valin
bb5288174d coarse probability model in static modes too 2010-08-25 22:12:18 -04:00
Jean-Marc Valin
31b189b419 static modes update for MDCT 2010-08-25 21:21:43 -04:00
Jean-Marc Valin
24eef1493e Updating dump_modes to include the MDCT and FFT. More work needed. 2010-08-25 18:01:50 -04:00
Jean-Marc Valin
3fc0aada01 FFT cleanup 2010-08-25 17:15:05 -04:00
Jean-Marc Valin
732ea38810 Updated static modes for new pulse cache.
Fixed a few minor bugs in the process.
2010-08-25 13:52:27 -04:00
Jean-Marc Valin
3ad8db49c5 New pulse cache 2010-08-25 13:11:09 -04:00
Timothy B. Terriberry
245c9af59d Fix dump_modes when requesting multiple modes.
dump_modes() was re-using a loop index for a loop nested inside
 the main one, so it would only output the struct for the first
 one.
2010-08-05 20:11:26 -04:00
Jean-Marc Valin
8cbea177ba Removing pitch prediction code 2010-08-05 15:28:27 -04:00
Jean-Marc Valin
1b0bc2d257 Updated static mode generation for latest changes 2010-07-24 07:59:08 -04:00
Jean-Marc Valin
ca6533cd88 Energy quantization tuning.
Prediction coefficient now depends on the frame size. Also, the pdfs and means
have been adjusted and better quantized. This breaks compatibility of course.
2010-07-23 16:10:36 -04:00
Jean-Marc Valin
71ae6d4714 Some C90-ication 2010-06-27 21:55:08 -04:00
Jean-Marc Valin
60ff999118 Mode cleanup (removed redundant mdctSize field) 2010-06-27 13:49:38 -04:00
Jean-Marc Valin
aadaafdfcf Updating static modes (not done yet) 2010-06-27 09:51:20 -04:00
Jean-Marc Valin
5f633543c7 shortWindow hadn't been used for a while 2010-05-07 21:20:21 -04:00
Jean-Marc Valin
f400a3c573 Caching log2_frac(N, BITRES) in the more data to save some CPU 2010-04-06 20:33:50 -04:00
Jean-Marc Valin
9319e3e6df Removing original freq-domain pitch code 2009-11-09 13:51:54 +09: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
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
4834c92e2b More simplifications from denorm pitch 2009-09-28 19:17:34 -04:00
Jean-Marc Valin
d27e6e34a5 Cleanup: getting rid of some old bits of stereo code that are no longer useful 2009-03-29 22:29:52 -04:00
Wessel Lubberhuizen
7bf550ead4 fix STATIC_MODES for stereo (with a few fixes by JMV) 2008-10-06 07:12:08 -04:00
Jean-Marc Valin
25ec9ac39a Fixed support for STATIC_MODES 2008-10-04 22:37:11 -04:00
Jean-Marc Valin
16ca18b9b0 Automatically choosing the overlap based on the frame size. 2008-06-18 23:44:48 +10:00
Jean-Marc Valin
bf2d648bbd Implemented intensity stereo, which required changes all over the place
to make sure that stereo coupling is done at the band level. Previously
the stereo coupling was done all at once, but there were all kinds of
interactions with the prediction and folding.
2008-05-23 16:57:34 +10:00
Jean-Marc Valin
ad6371906a Implemented rate-dependant allocation for the fine energy quantisation. 2008-05-07 13:44:39 +10:00
Jean-Marc Valin
24c9cdaca1 Fixed a bug in the PLC and added code to estimate the pitch from the synthesis
instead of relying on the one previously transmitted by the encoder.
2008-05-02 10:34:07 +10:00