ref: e86fb268b029d68d07ede37d35cfe82e8db3e86d
parent: 8c23a3a0fd2dae1407a56e994485b0f9c57910cc
author: Timothy B. Terriberry <tterribe@xiph.org>
date: Fri Dec 17 09:50:19 EST 2010
Replace ec_{enc|dec}_bit_prob() with ec_{enc|dec}_bit_logp(). 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.