From 2146e649c84ff7a96ac17d5e07d7828ee5d0a118 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Mon, 21 Apr 2008 15:08:57 +1000 Subject: [PATCH] Disabling pitch when gain is very small. --- libcelt/celt.c | 2 +- libcelt/quant_pitch.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libcelt/celt.c b/libcelt/celt.c index d683667f..cb68520a 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -346,7 +346,7 @@ int EXPORT celt_encode(CELTEncoder * restrict st, celt_int16_t * restrict pcm, u /* No pitch, so we just pretend we found a gain of zero */ for (i=0;imode->nbPBands;i++) gains[i] = 0; - ec_enc_uint(&st->enc, 0, 128); + ec_enc_bits(&st->enc, 0, 7); for (i=0;i QCONST32(.3f,15)) + { + id = vq_index(gains, pgain_table, len, 128); + } else { + id = 0; + } ec_enc_bits(enc, id, 7); /*for (i=0;i