Commit graph

22 commits

Author SHA1 Message Date
Timothy B. Terriberry
8fcde379ec Clean up some type usage.
ec_byte_read() ec_byte_read_from_end() had different return types.
ec_dec_bits() was storing its return value as int instead of
 ec_uint32, which will break if int is only 16 bits.
2010-12-23 14:33:32 -05:00
Timothy B. Terriberry
30df6cf3f8 Entropy coder clean-up.
This simplifies a good bit of the error handling, and should make it
 impossible to overrun the buffer in the encoder or decoder, while
 still allowing tell() to operate correctly after a bust.
The encoder now tries to keep the range coder data intact after a
 bust instead of corrupting it with extra bits data, though this is
 not a guarantee (too many extra bits may have already been flushed).
It also now correctly reports errors when the bust occurs merging the
 last byte of range coder and extra bits.

A number of abstraction barrier violations were cleaned up, as well.
This patch also includes a number of minor performance improvements:
 ec_{enc|dec}_bits() in particular should be much faster.

Finally, tf_select was changed to be coded with the range coder
 rather than extra bits, so that it is at the front of the packet
 (for unequal error protection robustness).
2010-12-21 14:23:45 -05:00
Jean-Marc Valin
e0aa9d185a Removing dead code found by LLVM's static analysis 2010-10-17 16:25:56 -04:00
Jean-Marc Valin
aaedf1711c Simplifies convoluted raw bits calls. 2010-09-10 20:20:04 -04:00
Jean-Marc Valin
6d3829f266 CELT no longer prints to stderr (unless assertions are enabled) 2010-08-27 17:52:38 -04:00
Jean-Marc Valin
531f2ae7e3 Remove useless use of "long", remove useless prototypes 2010-08-02 09:01:28 -04:00
Jean-Marc Valin
b1e017f58d Error checking on the decoder side 2010-07-18 21:20:35 -04:00
Timothy B. Terriberry
299747ee24 Provide direct implementations ec_{enc|dec}_bit_prob() that do not require a division instead of using the normal entropy coder path. This should be exactly equivalent to the existing code. 2010-05-29 23:45:18 -04:00
Jean-Marc Valin
8035b6589d Adds a range coder call to encode a single bit with arbitrary probability 2010-05-27 16:25:07 -04:00
Jean-Marc Valin
a3803a98af misc minor changes 2009-10-24 11:24:34 -04:00
Jean-Marc Valin
789fc14163 Removing unused code in the entropy coder 2009-10-23 21:44:54 -04:00
Jean-Marc Valin
8b2ff0da5a Updated copyright notices 2009-10-17 21:40:10 -04:00
Jean-Marc Valin
949a29bf0c Raw bits encoding/decoding functions renamed to *_raw() and re-introducing
original ec_encode_bin()/ec_decode_bin() to optimize performance when ft is
a power of two.
2009-07-25 20:16:01 -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
f40bbf751d Include missing copyright information in various files, for signoff.
Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
2009-02-03 23:08:31 -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
2b08d7a210 Removing the 64-bit part of the range coder. 2008-10-04 21:10:26 -04:00
Jean-Marc Valin
a1bb9c707f Error detection in uint decoding (can no longer return an int that's out
of range.
2008-04-28 17:30:26 +10:00
Jean-Marc Valin
c2decd39a6 Made a second version of ec_{en|de}code optimised for encoding bits (no div
required) and using it in ec_{en|de}c_bits()
2008-03-22 22:58:45 +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
02fa913c32 More C89 fixes, making sure to include config.h from all source files. 2008-02-20 12:09:29 +11:00
Jean-Marc Valin
6238bc0ece Moved the content of libentcode into libcelt to reduce dependencies,
especially now that we have a custom version of that code anyway. Moved
the test code to tests/
2008-01-28 22:28:54 +11:00
Renamed from libentcode/entdec.c (Browse further)