Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117139
b: refs/heads/master
c: f07639a
h: refs/heads/master
i:
  117137: 3586206
  117135: d3bf799
v: v3
  • Loading branch information
Pekka Enberg authored and Greg Kroah-Hartman committed Oct 22, 2008
1 parent 9c2cf9d commit e0d3dd4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 46 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db2af149bd0c798ce599365ee4320dd30dda852c
refs/heads/master: f07639adebd573709ea0d6b67bec9b620fe3083e
45 changes: 0 additions & 45 deletions trunk/drivers/staging/echo/fir.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,51 +312,6 @@ static __inline__ int16_t fir32(fir32_state_t *fir, int16_t sample)
}
/*- End of function --------------------------------------------------------*/

#ifndef __KERNEL__
static __inline__ const float *fir_float_create(fir_float_state_t *fir,
const float *coeffs,
int taps)
{
fir->taps = taps;
fir->curr_pos = taps - 1;
fir->coeffs = coeffs;
fir->history = (float *) malloc(taps*sizeof(float));
if (fir->history)
memset(fir->history, '\0', taps*sizeof(float));
return fir->history;
}
/*- End of function --------------------------------------------------------*/

static __inline__ void fir_float_free(fir_float_state_t *fir)
{
free(fir->history);
}
/*- End of function --------------------------------------------------------*/

static __inline__ int16_t fir_float(fir_float_state_t *fir, int16_t sample)
{
int i;
float y;
int offset1;
int offset2;

fir->history[fir->curr_pos] = sample;

offset2 = fir->curr_pos;
offset1 = fir->taps - offset2;
y = 0;
for (i = fir->taps - 1; i >= offset1; i--)
y += fir->coeffs[i]*fir->history[i - offset1];
for ( ; i >= 0; i--)
y += fir->coeffs[i]*fir->history[i + offset2];
if (fir->curr_pos <= 0)
fir->curr_pos = fir->taps;
fir->curr_pos--;
return (int16_t) y;
}
/*- End of function --------------------------------------------------------*/
#endif

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit e0d3dd4

Please sign in to comment.