fixed-point: changed find_spectral_pitch() to use single-precision (16-bit) FFT.
This involved adding kfft_single.[ch] that redefines kiss_fft a second time with a different prefix. All this is still a bit of a mess now. The mask had to be converted to 16-bit input, but we're still using floats to apply it.
This commit is contained in:
parent
4024444811
commit
f93747c44a
12 changed files with 166 additions and 28 deletions
|
@ -126,7 +126,7 @@ static void spreading_func(struct PsyDecay *d, celt_word32_t *psd, celt_mask_t *
|
|||
}
|
||||
|
||||
/* Compute a marking threshold from the spectrum X. */
|
||||
void compute_masking(struct PsyDecay *decay, celt_word32_t *X, celt_mask_t *mask, int len)
|
||||
void compute_masking(struct PsyDecay *decay, celt_word16_t *X, celt_mask_t *mask, int len)
|
||||
{
|
||||
int i;
|
||||
VARDECL(celt_word32_t *psd);
|
||||
|
@ -134,10 +134,10 @@ void compute_masking(struct PsyDecay *decay, celt_word32_t *X, celt_mask_t *mask
|
|||
SAVE_STACK;
|
||||
N=len/2;
|
||||
ALLOC(psd, N, celt_word32_t);
|
||||
psd[0] = MULT16_16(ROUND(X[0],SIG_SHIFT), ROUND(X[0],SIG_SHIFT));
|
||||
psd[0] = MULT16_16(X[0], X[0]);
|
||||
for (i=1;i<N;i++)
|
||||
psd[i] = ADD32(MULT16_16(ROUND(X[i*2],SIG_SHIFT), ROUND(X[i*2],SIG_SHIFT)),
|
||||
MULT16_16(ROUND(X[i*2+1],SIG_SHIFT), ROUND(X[i*2+1],SIG_SHIFT)));
|
||||
psd[i] = ADD32(MULT16_16(X[i*2], X[i*2]),
|
||||
MULT16_16(X[i*2+1], X[i*2+1]));
|
||||
/* TODO: Do tone masking */
|
||||
/* Noise masking */
|
||||
spreading_func(decay, psd, mask, N);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue