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

Added an option to implement iir_mem16() and fir_mem16() in terms of

filter_mem16()
parent 95fceab7
......@@ -320,7 +320,9 @@ spx_word16_t compute_rms16(const spx_word16_t *x, int len)
}
#endif
#ifdef MERGE_FILTERS
const spx_word16_t zeros[10] = {0,0,0,0,0,0,0,0,0,0};
#endif /* MERGE_FILTERS */
#if !defined(OVERRIDE_FILTER_MEM16) && !defined(DISABLE_ENCODER)
void filter_mem16(const spx_word16_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack)
......
......@@ -62,8 +62,19 @@ void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_word16_t *,
void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_t *a, spx_word16_t *y, int N, int M, spx_word16_t *mem1, spx_word16_t *mem2, char *stack);
void filter_mem16(const spx_word16_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
#ifdef MERGE_FILTERS
#define OVERRIDE_IIR_MEM16
#define OVERRIDE_FIR_MEM16
extern const spx_word16_t zeros[];
#define iir_mem16(x, den, y, N, ord, mem, stack) filter_mem16(x, zeros, den, y, N, ord, mem, stack)
#define fir_mem16(x, num, y, N, ord, mem, stack) filter_mem16(x, num, zeros, y, N, ord, mem, stack)
#else /* MERGE_FILTERS */
void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
void fir_mem16(const spx_word16_t *x, const spx_coef_t *num, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
#endif /* MERGE_FILTERS */
/* Apply bandwidth expansion on LPC coef */
void bw_lpc(spx_word16_t , const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
......
......@@ -78,7 +78,7 @@ spx_word32_t inner_prod(const spx_word16_t *x, const spx_word16_t *y, int len)
#ifndef OVERRIDE_PITCH_XCORR
#if 0 /* HINT: Enable this for machines with enough registers (i.e. not x86) */
void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack)
static void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack)
{
int i,j;
for (i=0;i<nb_pitch;i+=4)
......@@ -141,7 +141,7 @@ void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *c
}
#else
void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack)
static void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack)
{
int i;
for (i=0;i<nb_pitch;i++)
......
......@@ -52,7 +52,6 @@ typedef struct {
#endif
spx_word32_t inner_prod(const spx_word16_t *x, const spx_word16_t *y, int len);
void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack);
void open_loop_nbest_pitch(spx_word16_t *sw, int start, int end, int len, int *pitch, spx_word16_t *gain, int N, char *stack);
......
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