1. 21 Dec, 2010 1 commit
    • Timothy B. Terriberry's avatar
      Entropy coder clean-up. · 30df6cf3
      Timothy B. Terriberry authored
      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).
      30df6cf3
  2. 18 Dec, 2010 2 commits
    • Timothy B. Terriberry's avatar
      Replace ec_{enc|dec}_bit_prob() with ec_{enc|dec}_bit_logp(). · e86fb268
      Timothy B. Terriberry authored
      All of our usage of ec_{enc|dec}_bit_prob had the probability of a
       "one" being a power of two.
      This adds a new ec_{enc|dec}_bit_logp() function that takes this
       explicitly into account.
      It introduces less rounding error than the bit_prob version, does not
       require 17-bit integers to be emulated by ec_{encode|decode}_bin(),
       and does not require any multiplies or divisions at all.
      It is exactly equivalent to
       ec_encode_bin(enc,_val?0:(1<<_logp)-1,(1<<_logp)-(_val?1:0),1<<_logp)
      
      The old ec_{enc|dec}_bit_prob functions are left in place for now,
       because I am not sure if SILK is still using them or not when
       combined in Opus.
      e86fb268
    • Timothy B. Terriberry's avatar
      Subtract one from dif in the range decoder. · 8c23a3a0
      Timothy B. Terriberry authored
      It turns out to be more convenient to store dif=low+rng-code-1
       instead of dif=low+rng-code.
      This gets rid of a decrement in the normal decode path, replaces a
       decrement and an "and" in the normalization loop with a single
       add, and makes it clear that the new ec_dec_cdf() will not result
       in an infinite loop.
      This does not change the bitstream.
      8c23a3a0
  3. 17 Dec, 2010 1 commit
    • Timothy B. Terriberry's avatar
      Add a generic CDF decoding routine. · a0b664df
      Timothy B. Terriberry authored
      This decodes a value encoded with ec_encode_bin() without using any
       divisions.
      It is only meant for small alphabets.
      If a symbol can take on a large number of possible values, a binary
       search would be better.
      
      This patch also converts spread_decision to use it, since it is
       faster and introduces less rounding error to encode a single
       decision for the entire value than to encode it a bit at a time.
      a0b664df
  4. 11 Sep, 2010 1 commit
  5. 02 Aug, 2010 1 commit
  6. 19 Jul, 2010 1 commit
  7. 05 Jul, 2010 1 commit
  8. 30 May, 2010 2 commits
  9. 27 May, 2010 1 commit
  10. 18 Oct, 2009 1 commit
  11. 17 Oct, 2009 1 commit
  12. 26 Jul, 2009 1 commit
  13. 23 Jul, 2009 1 commit
    • Jean-Marc Valin's avatar
      Implemented "raw bits" · c08be448
      Jean-Marc Valin authored
      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
      c08be448
  14. 04 Feb, 2009 1 commit
  15. 22 Mar, 2008 1 commit
  16. 28 Jan, 2008 1 commit
  17. 11 Jan, 2008 1 commit
  18. 11 Dec, 2007 2 commits
  19. 06 Dec, 2007 1 commit