diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-12-29 13:34:17 -0500 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-12-29 13:34:17 -0500 |
commit | e1dc1e22384e6b632d7a8f9d54a0e693ebc77624 (patch) | |
tree | 0d30e721c2c1967968d605454580f9a4765dfd07 /celt/mdct.c | |
parent | dbb96ab5cc42491167e063cadc90e420c53b08be (diff) | |
download | opus-e1dc1e22384e6b632d7a8f9d54a0e693ebc77624.tar.gz |
Unifying scaling of fixed-point and float FFT
Diffstat (limited to 'celt/mdct.c')
-rw-r--r-- | celt/mdct.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/celt/mdct.c b/celt/mdct.c index 39ebfcba..1634e8e0 100644 --- a/celt/mdct.c +++ b/celt/mdct.c @@ -121,22 +121,12 @@ void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar const kiss_twiddle_scalar *trig; opus_val16 scale; #ifdef FIXED_POINT - int scale_shift; -#endif - SAVE_STACK; -#ifdef FIXED_POINT - /* FIXME: This should eventually just go in the state. */ - scale_shift = celt_ilog2(st->nfft); - if (st->nfft == 1<<scale_shift) - scale = Q15ONE; - else - scale = (1073741824+st->nfft/2)/st->nfft>>(15-scale_shift); /* Allows us to scale with MULT16_32_Q16(), which is faster than MULT16_32_Q15() on ARM. */ - scale_shift--; -#else - scale = st->scale; + int scale_shift = st->scale_shift-1; #endif + SAVE_STACK; + scale = st->scale; N = l->n; trig = l->trig; |