Changeset 5269:b914e5b61703 in roaraudio
- Timestamp:
- 11/17/11 00:32:28 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroardsp/filter.h
r4953 r5269 39 39 #include "libroardsp.h" 40 40 41 #define ROARDSP_FILTER_NONE 0 42 #define ROARDSP_FILTER_AMP 1 43 #define ROARDSP_FILTER_LOWP 2 44 #define ROARDSP_FILTER_HIGHP 3 45 #define ROARDSP_FILTER_MODULATE 4 46 #define ROARDSP_FILTER_QUANTIFY 5 47 #define ROARDSP_FILTER_CLIP 6 48 #define ROARDSP_FILTER_ADD 7 49 #define ROARDSP_FILTER_DOWNMIX 8 50 #define ROARDSP_FILTER_DCBLOCK 9 51 #define ROARDSP_FILTER_SWAP 10 52 #define ROARDSP_FILTER_SPEEX_PREP 11 53 #define ROARDSP_FILTER_AGC 12 41 /* implemented? */ 42 #define ROARDSP_FILTER_NONE 0 43 #define ROARDSP_FILTER_AMP 1 /* yes */ 44 #define ROARDSP_FILTER_LOWP 2 /* yes */ 45 #define ROARDSP_FILTER_HIGHP 3 /* yes */ 46 #define ROARDSP_FILTER_MODULATE 4 47 #define ROARDSP_FILTER_QUANTIFY 5 /* yes */ 48 #define ROARDSP_FILTER_CLIP 6 /* yes */ 49 #define ROARDSP_FILTER_ADD 7 /* yes */ 50 #define ROARDSP_FILTER_DOWNMIX 8 /* yes */ 51 #define ROARDSP_FILTER_DCBLOCK 9 52 #define ROARDSP_FILTER_SWAP 10 /* yes */ 53 #define ROARDSP_FILTER_SPEEX_PREP 11 /* yes */ 54 #define ROARDSP_FILTER_AGC 12 55 #define ROARDSP_FILTER_NOISEGATE 13 56 #define ROARDSP_FILTER_RESPONSE_CURVE 14 54 57 55 58 // filter CTLs: … … 120 123 121 124 // funcs: 122 int roardsp_filter_str2id(char * str);123 c har * roardsp_filter_id2str(int id);125 int roardsp_filter_str2id(const char * str); 126 const char * roardsp_filter_id2str(const int id); 124 127 int roardsp_filter_new (struct roardsp_filter ** filter, struct roar_stream * stream, int id); 125 128 #define roardsp_filter_free(x) roardsp_filter_uninit((x)) -
include/libroardsp/filters.h
r5181 r5269 68 68 ROARDSP_CLIP_MODE_ZERO = 1, 69 69 ROARDSP_CLIP_MODE_WARP = 2, 70 ROARDSP_CLIP_MODE_NOISE = 3,70 ROARDSP_CLIP_MODE_NOISE = 3 71 71 }; 72 72 … … 94 94 }; 95 95 96 enum roardsp_responsecurve_mode { 97 ROARDSP_RESPONSECURVE_MODE_PASS = 0, /* pass: o = i */ 98 ROARDSP_RESPONSECURVE_MODE_LIN = 1, /* linear: o = -(1-i)^(N+1) + 1 */ 99 ROARDSP_RESPONSECURVE_MODE_ILIN = 2, /* inverse linear: o = i**(N+1) */ 100 ROARDSP_RESPONSECURVE_MODE_SIN = 3, /* sin: o = sin(pi/2 * i)^N */ 101 ROARDSP_RESPONSECURVE_MODE_ISIN = 4, /* inverse sin: o = 1-sin((1-i)*pi/2)^N */ 102 ROARDSP_RESPONSECURVE_MODE_COS = 5, /* cos: o = 0.5-cos(i*pi)/2 */ 103 ROARDSP_RESPONSECURVE_MODE_ICOS = 6, /* inverse cos: o = 2*i-0.5+cos(i*pi)/2 */ 104 }; 105 106 struct roardsp_responsecurve { 107 enum roardsp_responsecurve_mode mode_pos, mode_neg; 108 int32_t N; 109 }; 96 110 97 111 // filter: … … 176 190 #endif 177 191 192 int roardsp_responsecurve_init (struct roardsp_filter * filter, struct roar_stream * stream, int id); 193 int roardsp_responsecurve_uninit(struct roardsp_filter * filter); 194 int roardsp_responsecurve_calc32(struct roardsp_filter * filter, void * data, size_t samples); 195 int roardsp_responsecurve_calc16(struct roardsp_filter * filter, void * data, size_t samples); 196 int roardsp_responsecurve_calc8 (struct roardsp_filter * filter, void * data, size_t samples); 197 int roardsp_responsecurve_ctl (struct roardsp_filter * filter, int cmd, void * data); 198 int roardsp_responsecurve_reset (struct roardsp_filter * filter, int what); 178 199 179 200 #endif -
libroardsp/Makefile
r4748 r5269 7 7 OBJS=libroardsp.o convert.o midside.o poly.o filter.o filterchain.o remove.o transcode.o vio_transcode.o rms.o fader.o mixer.o amp.o interleave.o channels.o resampler_poly3.o float.o 8 8 OLDROAR=midi.o 9 FILTER=filter_lowp.o filter_highp.o filter_amp.o filter_quantify.o filter_add.o filter_clip.o filter_downmix.o filter_dcblock.o filter_swap.o filter_agc.o filter_speex_prep.o 9 FILTER=filter_lowp.o filter_highp.o filter_amp.o filter_quantify.o filter_add.o filter_clip.o filter_downmix.o filter_dcblock.o filter_swap.o filter_agc.o filter_speex_prep.o filter_responsecurve.o 10 10 MIDI=synth.o 11 11 CODECS=alaw.o mulaw.o -
libroardsp/filter.c
r5181 r5269 69 69 {NULL, NULL, NULL},{NULL, NULL, NULL},{NULL, roardsp_speex_prep_calc161, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}}, 70 70 #endif 71 {ROARDSP_FILTER_RESPONSE_CURVE, "ResponseCurve", roardsp_responsecurve_init, roardsp_responsecurve_uninit, 72 roardsp_responsecurve_ctl, roardsp_responsecurve_reset, { 73 {NULL, NULL, NULL},{roardsp_responsecurve_calc8, NULL, NULL},{roardsp_responsecurve_calc16, NULL, NULL}, 74 {NULL, NULL, NULL},{roardsp_responsecurve_calc32, NULL, NULL} 75 }}, 71 76 {-1, NULL, NULL, NULL, NULL, NULL, { 72 77 // ? 8Bit 16Bit 24Bit 32Bit … … 75 80 }; 76 81 77 int roardsp_filter_str2id(c har * str) {82 int roardsp_filter_str2id(const char * str) { 78 83 struct _roardsp_filterlist * l = _roardsp_filterlist; 79 84 … … 88 93 } 89 94 90 c har * roardsp_filter_id2str(int id) {95 const char * roardsp_filter_id2str(const int id) { 91 96 struct _roardsp_filterlist * l = _roardsp_filterlist; 92 97 … … 170 175 filter->reset = l->reset; 171 176 177 ROAR_DBG("roardsp_filter_init(filter=%p, stream=%p, id=%i): bytes=%i", filter, stream, id, bytes); 178 172 179 if ( filter->channels < 3 ) 173 180 calc = l->calc[bytes][filter->channels];
Note: See TracChangeset
for help on using the changeset viewer.