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

Simplifications to the code

parent 40fc6793
......@@ -500,7 +500,7 @@ void quant_bands_stereo(const CELTMode *m, celt_norm_t *_X, const celt_ener_t *b
{
int i, j, remaining_bits, balance;
const celt_int16_t * restrict eBands = m->eBands;
celt_norm_t * restrict norm, *X, *Y;
celt_norm_t * restrict norm;
VARDECL(celt_norm_t, _norm);
int B;
celt_word16_t mid, side;
......@@ -524,6 +524,7 @@ void quant_bands_stereo(const CELTMode *m, celt_norm_t *_X, const celt_ener_t *b
int imid, iside, itheta;
int mbits, sbits, delta;
int qalloc;
celt_norm_t * restrict X, * restrict Y;
X = _X+eBands[i];
Y = X+eBands[m->nbEBands+1];
......@@ -792,7 +793,7 @@ void unquant_bands_stereo(const CELTMode *m, celt_norm_t *_X, const celt_ener_t
{
int i, j, remaining_bits, balance;
const celt_int16_t * restrict eBands = m->eBands;
celt_norm_t * restrict norm, *X, *Y;
celt_norm_t * restrict norm;
VARDECL(celt_norm_t, _norm);
int B;
celt_word16_t mid, side;
......@@ -816,6 +817,7 @@ void unquant_bands_stereo(const CELTMode *m, celt_norm_t *_X, const celt_ener_t
int imid, iside, itheta;
int mbits, sbits, delta;
int qalloc;
celt_norm_t * restrict X, * restrict Y;
X = _X+eBands[i];
Y = X+eBands[m->nbEBands+1];
......
......@@ -292,40 +292,25 @@ static void compute_mdcts(const CELTMode *mode, int shortBlocks, celt_sig_t * re
const mdct_lookup *lookup = MDCT(mode);
const int overlap = OVERLAP(mode);
mdct_forward(lookup, in, out, mode->window, overlap);
} else if (!shortBlocks) {
} else {
const mdct_lookup *lookup = MDCT(mode);
const int overlap = OVERLAP(mode);
const int N = FRAMESIZE(mode);
int c;
int N = FRAMESIZE(mode);
int B = 1;
int b, c;
VARDECL(celt_word32_t, x);
VARDECL(celt_word32_t, tmp);
SAVE_STACK;
ALLOC(x, N+overlap, celt_word32_t);
ALLOC(tmp, N, celt_word32_t);
for (c=0;c<C;c++)
if (shortBlocks)
{
int j;
for (j=0;j<N+overlap;j++)
x[j] = in[C*j+c];
mdct_forward(lookup, x, tmp, mode->window, overlap);
/* Interleaving the sub-frames */
for (j=0;j<N;j++)
out[j+c*N] = tmp[j];
lookup = &mode->shortMdct;
N = mode->shortMdctSize;
B = mode->nbShortMdcts;
}
RESTORE_STACK;
} else {
const mdct_lookup *lookup = &mode->shortMdct;
const int overlap = mode->overlap;
const int N = mode->shortMdctSize;
int b, c;
VARDECL(celt_word32_t, x);
VARDECL(celt_word32_t, tmp);
SAVE_STACK;
ALLOC(x, N+overlap, celt_word32_t);
ALLOC(tmp, N, celt_word32_t);
for (c=0;c<C;c++)
{
int B = mode->nbShortMdcts;
for (b=0;b<B;b++)
{
int j;
......
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