Lines Matching +full:dsp +full:- +full:based

5  *			based on different decoders such as ISDN4Linux
15 #include "dsp.h"
24 /* k << 15 (source: hfc-4s/8s documentation (www.colognechip.de)) */
40 void dsp_dtmf_goertzel_init(struct dsp *dsp) in dsp_dtmf_goertzel_init() argument
42 dsp->dtmf.size = 0; in dsp_dtmf_goertzel_init()
43 dsp->dtmf.lastwhat = '\0'; in dsp_dtmf_goertzel_init()
44 dsp->dtmf.lastdigit = '\0'; in dsp_dtmf_goertzel_init()
45 dsp->dtmf.count = 0; in dsp_dtmf_goertzel_init()
50 void dsp_dtmf_hardware(struct dsp *dsp) in dsp_dtmf_hardware() argument
54 if (!dsp->dtmf.enable) in dsp_dtmf_hardware()
57 if (!dsp->features.hfc_dtmf) in dsp_dtmf_hardware()
61 if (dsp->tx_volume) { in dsp_dtmf_hardware()
63 printk(KERN_DEBUG "%s dsp %s cannot do hardware DTMF, " in dsp_dtmf_hardware()
65 __func__, dsp->name); in dsp_dtmf_hardware()
68 if (dsp->rx_volume) { in dsp_dtmf_hardware()
70 printk(KERN_DEBUG "%s dsp %s cannot do hardware DTMF, " in dsp_dtmf_hardware()
72 __func__, dsp->name); in dsp_dtmf_hardware()
76 if (dsp->bf_enable) { in dsp_dtmf_hardware()
78 printk(KERN_DEBUG "%s dsp %s cannot do hardware DTMF, " in dsp_dtmf_hardware()
80 __func__, dsp->name); in dsp_dtmf_hardware()
84 if (dsp->pipeline.inuse) { in dsp_dtmf_hardware()
86 printk(KERN_DEBUG "%s dsp %s cannot do hardware DTMF, " in dsp_dtmf_hardware()
88 __func__, dsp->name); in dsp_dtmf_hardware()
92 dsp->dtmf.hardware = hardware; in dsp_dtmf_hardware()
93 dsp->dtmf.software = !hardware; in dsp_dtmf_hardware()
112 * dtmf - points to a structure of the current dtmf state
113 * spl and len - the sample
114 * fmt - 0 = alaw, 1 = ulaw, 2 = coefficients from HFC DTMF hw-decoder
118 *dsp_dtmf_goertzel_decode(struct dsp *dsp, u8 *data, int len, int fmt) in dsp_dtmf_goertzel_decode() argument
130 dsp->dtmf.digits[0] = '\0'; in dsp_dtmf_goertzel_decode()
137 size = dsp->dtmf.size; in dsp_dtmf_goertzel_decode()
138 buf = dsp->dtmf.buffer; in dsp_dtmf_goertzel_decode()
144 len--; in dsp_dtmf_goertzel_decode()
155 return dsp->dtmf.digits; in dsp_dtmf_goertzel_decode()
161 if (sk > 32767 || sk < -32767 || sk2 > 32767 in dsp_dtmf_goertzel_decode()
162 || sk2 < -32767) in dsp_dtmf_goertzel_decode()
164 "DTMF-Detection overflow\n"); in dsp_dtmf_goertzel_decode()
167 (sk * sk) - in dsp_dtmf_goertzel_decode()
172 len -= 64; in dsp_dtmf_goertzel_decode()
176 dsp->dtmf.size = size; in dsp_dtmf_goertzel_decode()
179 return dsp->dtmf.digits; in dsp_dtmf_goertzel_decode()
181 dsp->dtmf.size = 0; in dsp_dtmf_goertzel_decode()
183 /* now we have a full buffer of signed long samples - we do goertzel */ in dsp_dtmf_goertzel_decode()
188 buf = dsp->dtmf.buffer; in dsp_dtmf_goertzel_decode()
191 sk = ((cos2pik_ * sk1) >> 15) - sk2 + (*buf++); in dsp_dtmf_goertzel_decode()
197 if (sk > 32767 || sk < -32767 || sk2 > 32767 || sk2 < -32767) in dsp_dtmf_goertzel_decode()
198 printk(KERN_WARNING "DTMF-Detection overflow\n"); in dsp_dtmf_goertzel_decode()
201 (sk * sk) - in dsp_dtmf_goertzel_decode()
214 if (result[i] > dsp->dtmf.treshold) { in dsp_dtmf_goertzel_decode()
246 lowgroup = -1; in dsp_dtmf_goertzel_decode()
247 highgroup = -1; in dsp_dtmf_goertzel_decode()
254 lowgroup = -1; in dsp_dtmf_goertzel_decode()
255 highgroup = -1; in dsp_dtmf_goertzel_decode()
263 lowgroup = -1; in dsp_dtmf_goertzel_decode()
271 highgroup = -1; in dsp_dtmf_goertzel_decode()
274 highgroup = i - (NCOEFF / 2); in dsp_dtmf_goertzel_decode()
287 if (dsp->dtmf.lastwhat != what) in dsp_dtmf_goertzel_decode()
288 dsp->dtmf.count = 0; in dsp_dtmf_goertzel_decode()
291 if (dsp->dtmf.count == 2) { in dsp_dtmf_goertzel_decode()
292 if (dsp->dtmf.lastdigit != what) { in dsp_dtmf_goertzel_decode()
293 dsp->dtmf.lastdigit = what; in dsp_dtmf_goertzel_decode()
298 if ((strlen(dsp->dtmf.digits) + 1) in dsp_dtmf_goertzel_decode()
299 < sizeof(dsp->dtmf.digits)) { in dsp_dtmf_goertzel_decode()
300 dsp->dtmf.digits[strlen( in dsp_dtmf_goertzel_decode()
301 dsp->dtmf.digits) + 1] = '\0'; in dsp_dtmf_goertzel_decode()
302 dsp->dtmf.digits[strlen( in dsp_dtmf_goertzel_decode()
303 dsp->dtmf.digits)] = what; in dsp_dtmf_goertzel_decode()
308 dsp->dtmf.count++; in dsp_dtmf_goertzel_decode()
310 dsp->dtmf.lastwhat = what; in dsp_dtmf_goertzel_decode()