Commit 97252d03 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Spreading function inside quant_bands()

parent e84962bc
......@@ -209,8 +209,13 @@ void quant_bands(const CELTMode *m, float *X, float *P, float *W, ec_enc *enc)
int q;
q = m->nbPulses[i];
if (q>0) {
float n = sqrt(B*(eBands[i+1]-eBands[i]));
float theta, n;
n = sqrt(B*(eBands[i+1]-eBands[i]));
theta = .007*(B*(eBands[i+1]-eBands[i]))/(.1f+abs(m->nbPulses[i]));
exp_rotation(P+B*eBands[i], B*(eBands[i+1]-eBands[i]), theta, -1, B, 8);
exp_rotation(X+B*eBands[i], B*(eBands[i+1]-eBands[i]), theta, -1, B, 8);
alg_quant(X+B*eBands[i], W+B*eBands[i], B*(eBands[i+1]-eBands[i]), q, P+B*eBands[i], 0.7, enc);
exp_rotation(X+B*eBands[i], B*(eBands[i+1]-eBands[i]), theta, 1, B, 8);
for (j=B*eBands[i];j<B*eBands[i+1];j++)
norm[j] = X[j] * n;
//printf ("%f ", log2(ncwrs64(B*(eBands[i+1]-eBands[i]), q))/(B*(eBands[i+1]-eBands[i])));
......@@ -241,8 +246,12 @@ void unquant_bands(const CELTMode *m, float *X, float *P, ec_dec *dec)
int q;
q = m->nbPulses[i];
if (q>0) {
float n = sqrt(B*(eBands[i+1]-eBands[i]));
float theta, n;
n = sqrt(B*(eBands[i+1]-eBands[i]));
theta = .007*(B*(eBands[i+1]-eBands[i]))/(.1f+abs(m->nbPulses[i]));
exp_rotation(P+B*eBands[i], B*(eBands[i+1]-eBands[i]), theta, -1, B, 8);
alg_unquant(X+B*eBands[i], B*(eBands[i+1]-eBands[i]), q, P+B*eBands[i], 0.7, dec);
exp_rotation(X+B*eBands[i], B*(eBands[i+1]-eBands[i]), theta, 1, B, 8);
for (j=B*eBands[i];j<B*eBands[i+1];j++)
norm[j] = X[j] * n;
} else {
......@@ -260,6 +269,7 @@ void unquant_bands(const CELTMode *m, float *X, float *P, ec_dec *dec)
void band_rotation(const CELTMode *m, float *X, int dir)
{
return;
int i, B;
const int *eBands = m->eBands;
B = m->nbMdctBlocks*m->nbChannels;
......
......@@ -296,8 +296,8 @@ int celt_encode(CELTEncoder *st, short *pcm)
normalise_bands(st->mode, P, bandEp);
}
band_rotation(st->mode, X, -1);
band_rotation(st->mode, P, -1);
//band_rotation(st->mode, X, -1);
//band_rotation(st->mode, P, -1);
quant_energy(st->mode, bandE, st->oldBandE, &st->enc);
......@@ -328,7 +328,7 @@ int celt_encode(CELTEncoder *st, short *pcm)
//printf ("\n");
}
band_rotation(st->mode, X, 1);
//band_rotation(st->mode, X, 1);
/* Synthesis */
denormalise_bands(st->mode, X, bandE);
......@@ -532,7 +532,7 @@ int celt_decode(CELTDecoder *st, char *data, int len, short *pcm)
compute_band_energies(st->mode, P, bandEp);
normalise_bands(st->mode, P, bandEp);
}
band_rotation(st->mode, P, -1);
//band_rotation(st->mode, P, -1);
/* Get the pitch gains */
unquant_pitch(gains, st->mode->nbPBands, &dec);
......@@ -543,7 +543,7 @@ int celt_decode(CELTDecoder *st, char *data, int len, short *pcm)
/* Decode fixed codebook and merge with pitch */
unquant_bands(st->mode, X, P, &dec);
band_rotation(st->mode, X, 1);
//band_rotation(st->mode, X, 1);
/* Synthesis */
denormalise_bands(st->mode, X, bandE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment