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.
Showing
- libcelt/bands.c 2 additions, 2 deletionslibcelt/bands.c
- libcelt/celt.c 18 additions, 18 deletionslibcelt/celt.c
- libcelt/entdec.h 3 additions, 0 deletionslibcelt/entdec.h
- libcelt/entenc.h 3 additions, 0 deletionslibcelt/entenc.h
- libcelt/quant_bands.c 1 addition, 1 deletionlibcelt/quant_bands.c
- libcelt/rangedec.c 17 additions, 1 deletionlibcelt/rangedec.c
- libcelt/rangeenc.c 14 additions, 0 deletionslibcelt/rangeenc.c
- libcelt/rate.c 3 additions, 3 deletionslibcelt/rate.c
Loading
Please register or sign in to comment