Changes to ec_dec_cdf() to support 8-bit tables.
This renames ec_dec_cdf() to ec_dec_icdf(), and changes the functionality to use an "inverse" CDF table, where icdf[i]=ft-cdf[i+1]. The first entry is omitted entirely. It also adds a corresonding ec_enc_icdf() to the encoder, which uses the same table. One could use ec_encode_bin() by converting the values in the tables back to normal CDF values, but the icdf[] table already has them in the form ec_encode_bin() wants to use them, so there's no reason to translate them and then translate them back. This is done primarily to allow SILK to use the range coder with 8-bit probability tables containing cumulative frequencies that span the full range 0...256. With an 8-bit table, the final 256 of a normal CDF becomes 0 in the "inverse" CDF. It's the 0 at the start of a normal CDF which would become 256, but this is the value we omit, as it already has to be special-cased in the encoder, and is not used at all in the decoder.
Showing
- libcelt/celt.c 7 additions, 8 deletionslibcelt/celt.c
- libcelt/entdec.h 7 additions, 7 deletionslibcelt/entdec.h
- libcelt/entenc.h 9 additions, 0 deletionslibcelt/entenc.h
- libcelt/rangedec.c 2 additions, 2 deletionslibcelt/rangedec.c
- libcelt/rangeenc.c 11 additions, 0 deletionslibcelt/rangeenc.c
- tests/ectest.c 11 additions, 6 deletionstests/ectest.c
Loading
Please register or sign in to comment