Changeset 5282:efca34f07bfc in roaraudio for libroardsp/filter_quantify.c
- Timestamp:
- 11/22/11 12:46:06 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroardsp/filter_quantify.c
r5270 r5282 45 45 } 46 46 47 #define _calcX(bits,rshift,lshift ) \47 #define _calcX(bits,rshift,lshift,ibits) \ 48 48 /* this code is buggy for 8 bit filters */ \ 49 49 int roardsp_quantify_calc##bits (struct roardsp_filter * filter, void * data, size_t samples) { \ … … 52 52 \ 53 53 for (i = 0; i < samples; i++) { \ 54 samp[i] = _calc(samp[i] rshift, filter->inst) lshift; \54 samp[i] = (int##ibits##_t)_calc((int##ibits##_t)samp[i] rshift, filter->inst) lshift; \ 55 55 } \ 56 56 \ … … 60 60 61 61 /* look at our nice parameters ;) */ 62 _calcX(8,<< 8,>> 8 )63 _calcX(16,, )64 _calcX(32,>> 16,<< 16 )62 _calcX(8,<< 8,>> 8,16) 63 _calcX(16,,,16) 64 _calcX(32,>> 16,<< 16,32) 65 65 66 66 int roardsp_quantify_ctl (struct roardsp_filter * filter, int cmd, void * data) {
Note: See TracChangeset
for help on using the changeset viewer.