diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-07-20 07:33:33 +0100 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-07-20 08:24:46 +0100 |
commit | 3aca16e857a1e12c566cd416dd14ecee24aba184 (patch) | |
tree | c02a443a3868f352740c6e702feeb8bb744a3c4a | |
parent | 0a813ca091c804ae83d53c881fd361548ccfc4f8 (diff) | |
download | ffmpeg-3aca16e857a1e12c566cd416dd14ecee24aba184.tar.gz |
opus_rc: fix CDF encoding of zeroes
0th CDF value is where probabilities are.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
-rw-r--r-- | libavcodec/opus_rc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/opus_rc.c b/libavcodec/opus_rc.c index c5cccd6cd2..3972bb0b02 100644 --- a/libavcodec/opus_rc.c +++ b/libavcodec/opus_rc.c @@ -108,7 +108,7 @@ uint32_t ff_opus_rc_dec_cdf(OpusRangeCoder *rc, const uint16_t *cdf) void ff_opus_rc_enc_cdf(OpusRangeCoder *rc, int val, const uint16_t *cdf) { - opus_rc_enc_update(rc, cdf[val], cdf[val + 1], cdf[0], 1); + opus_rc_enc_update(rc, (!!val)*cdf[val], cdf[val + 1], cdf[0], 1); } uint32_t ff_opus_rc_dec_log(OpusRangeCoder *rc, uint32_t bits) |