diff --git a/libcelt/vq.c b/libcelt/vq.c index e9836555..aff50e43 100644 --- a/libcelt/vq.c +++ b/libcelt/vq.c @@ -138,20 +138,30 @@ void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, celt_norm_t *P, ec_ xy = yy = yp = 0; pulsesLeft = K; -#if 0 + + /* Do a pre-search by projecting on the pyramid */ if (K > (N>>1)) { celt_word32_t sum=0; + celt_word16_t rcp; j=0; do { sum += X[j]; } while (++j N+2) + printf ("%d / %d (%d)\n", pulsesLeft, K, N);*/ celt_assert2(pulsesLeft>=1, "Allocated too many pulses in the quick pass"); -#endif + while (pulsesLeft > 1) { int pulsesAtOnce=1; @@ -230,6 +241,7 @@ void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, celt_norm_t *P, ec_ pulsesLeft -= pulsesAtOnce; } + if (pulsesLeft > 0) { celt_word16_t g; celt_word16_t best_num = -VERY_LARGE16;