#include "quant_bands.h"
#include "psy.h"
#include "rate.h"
+#include "stack_alloc.h"
static const celt_word16_t preemph = QCONST16(0.8f,15);
}
/** Apply window and compute the MDCT for all sub-frames and all channels in a frame */
-static celt_word32_t compute_mdcts(const mdct_lookup *lookup, const celt_word16_t *window, celt_sig_t *in, celt_sig_t *out, int N, int overlap, int B, int C)
+static celt_word32_t compute_mdcts(const mdct_lookup *lookup, const celt_word16_t * restrict window, celt_sig_t *in, celt_sig_t *out, int N, int overlap, int B, int C)
{
int i, c, N4;
celt_word32_t E = 0;
VARDECL(celt_word32_t, x);
VARDECL(celt_word32_t, tmp);
SAVE_STACK;
- N4 = (N-overlap)/2;
+ N4 = (N-overlap)>>1;
ALLOC(x, 2*N, celt_word32_t);
ALLOC(tmp, N, celt_word32_t);
for (c=0;c<C;c++)
}
/** Compute the IMDCT and apply window for all sub-frames and all channels in a frame */
-static void compute_inv_mdcts(const mdct_lookup *lookup, const celt_word16_t *window, celt_sig_t *X, celt_sig_t *out_mem, celt_sig_t *mdct_overlap, int N, int overlap, int B, int C)
+static void compute_inv_mdcts(const mdct_lookup *lookup, const celt_word16_t * restrict window, celt_sig_t *X, celt_sig_t *out_mem, celt_sig_t *mdct_overlap, int N, int overlap, int B, int C)
{
int i, c, N4;
VARDECL(celt_word32_t, x);
SAVE_STACK;
ALLOC(x, 2*N, celt_word32_t);
ALLOC(tmp, N, celt_word32_t);
- N4 = (N-overlap)/2;
+ N4 = (N-overlap)>>1;
for (c=0;c<C;c++)
{
for (i=0;i<B;i++)
N = st->block_size;
B = st->nb_blocks;
C = st->mode->nbChannels;
- N4 = (N-st->overlap)/2;
+ N4 = (N-st->overlap)>>1;
ALLOC(in, (B+1)*C*N-2*N4, celt_sig_t);
N = st->block_size;
B = st->nb_blocks;
C = st->mode->nbChannels;
- N4 = (N-st->overlap)/2;
+ N4 = (N-st->overlap)>>1;
ALLOC(freq, C*B*N, celt_sig_t); /**< Interleaved signal MDCTs */
ALLOC(X, C*B*N, celt_norm_t); /**< Interleaved normalised MDCTs */