Lines Matching refs:fir

71 static inline const int16_t *fir16_create(struct fir16_state_t *fir,  in fir16_create()  argument
74 fir->taps = taps; in fir16_create()
75 fir->curr_pos = taps - 1; in fir16_create()
76 fir->coeffs = coeffs; in fir16_create()
77 fir->history = kcalloc(taps, sizeof(int16_t), GFP_KERNEL); in fir16_create()
78 return fir->history; in fir16_create()
81 static inline void fir16_flush(struct fir16_state_t *fir) in fir16_flush() argument
83 memset(fir->history, 0, fir->taps * sizeof(int16_t)); in fir16_flush()
86 static inline void fir16_free(struct fir16_state_t *fir) in fir16_free() argument
88 kfree(fir->history); in fir16_free()
91 static inline int16_t fir16(struct fir16_state_t *fir, int16_t sample) in fir16() argument
98 fir->history[fir->curr_pos] = sample; in fir16()
100 offset2 = fir->curr_pos; in fir16()
101 offset1 = fir->taps - offset2; in fir16()
103 for (i = fir->taps - 1; i >= offset1; i--) in fir16()
104 y += fir->coeffs[i] * fir->history[i - offset1]; in fir16()
106 y += fir->coeffs[i] * fir->history[i + offset2]; in fir16()
107 if (fir->curr_pos <= 0) in fir16()
108 fir->curr_pos = fir->taps; in fir16()
109 fir->curr_pos--; in fir16()
113 static inline const int16_t *fir32_create(struct fir32_state_t *fir, in fir32_create() argument
116 fir->taps = taps; in fir32_create()
117 fir->curr_pos = taps - 1; in fir32_create()
118 fir->coeffs = coeffs; in fir32_create()
119 fir->history = kcalloc(taps, sizeof(int16_t), GFP_KERNEL); in fir32_create()
120 return fir->history; in fir32_create()
123 static inline void fir32_flush(struct fir32_state_t *fir) in fir32_flush() argument
125 memset(fir->history, 0, fir->taps * sizeof(int16_t)); in fir32_flush()
128 static inline void fir32_free(struct fir32_state_t *fir) in fir32_free() argument
130 kfree(fir->history); in fir32_free()
133 static inline int16_t fir32(struct fir32_state_t *fir, int16_t sample) in fir32() argument
140 fir->history[fir->curr_pos] = sample; in fir32()
141 offset2 = fir->curr_pos; in fir32()
142 offset1 = fir->taps - offset2; in fir32()
144 for (i = fir->taps - 1; i >= offset1; i--) in fir32()
145 y += fir->coeffs[i] * fir->history[i - offset1]; in fir32()
147 y += fir->coeffs[i] * fir->history[i + offset2]; in fir32()
148 if (fir->curr_pos <= 0) in fir32()
149 fir->curr_pos = fir->taps; in fir32()
150 fir->curr_pos--; in fir32()