diff --git a/libcelt/bands.c b/libcelt/bands.c index a6ddc01e..719617d9 100644 --- a/libcelt/bands.c +++ b/libcelt/bands.c @@ -160,7 +160,7 @@ void quant_bands(const CELTMode *m, float *X, float *P, ec_enc *enc) q = m->nbPulses[i]; if (q>0) { float n = sqrt(B*(eBands[i+1]-eBands[i])); - alg_quant2(X+B*eBands[i], B*(eBands[i+1]-eBands[i]), q, P+B*eBands[i], enc); + alg_quant(X+B*eBands[i], B*(eBands[i+1]-eBands[i]), q, P+B*eBands[i], enc); for (j=B*eBands[i];jblock_size; diff --git a/libcelt/celt.h b/libcelt/celt.h index 76ca56a1..fc4a8e7c 100644 --- a/libcelt/celt.h +++ b/libcelt/celt.h @@ -54,6 +54,6 @@ CELTDecoder *celt_decoder_new(const CELTMode *mode); void celt_decoder_destroy(CELTDecoder *st); -int celt_decode(CELTDecoder *st, short *pcm); +int celt_decode(CELTDecoder *st, char *data, int len, short *pcm); #endif /*CELT_H */ diff --git a/libcelt/vq.c b/libcelt/vq.c index 18e2df98..a896274d 100644 --- a/libcelt/vq.c +++ b/libcelt/vq.c @@ -34,69 +34,11 @@ #include "cwrs.h" #include "vq.h" -/* Algebraic pulse-base quantiser. The signal x is replaced by the sum of the pitch - a combination of pulses such that its norm is still equal to 1 */ -void alg_quant(float *x, int N, int K, float *p) -{ - float y[N]; - int i,j; - float xy = 0; - float yy = 0; - float yp = 0; - float Rpp=0; - float gain=0; - for (j=0;j0) - tmp_yp = yp + p[j]; - else - tmp_yp = yp - p[j]; - g = (sqrt(tmp_yp*tmp_yp + tmp_yy - tmp_yy*Rpp) - tmp_yp)/tmp_yy; - score = 2*g*tmp_xy - g*g*tmp_yy; - if (score>max_val) - { - max_val = score; - best_id = j; - best_xy = tmp_xy; - best_yy = tmp_yy; - best_yp = tmp_yp; - gain = g; - } - } - - xy = best_xy; - yy = best_yy; - yp = best_yp; - if (x[best_id]>0) - y[best_id] += 1; - else - y[best_id] -= 1; - } - - for (i=0;i.01) + // alpha = (1-sqrt(1-Rpp))/Rpp; for (j=0;j