Changeset 979:2d5a48c15b5f in roaraudio


Ignore:
Timestamp:
12/17/08 21:10:55 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added new filter: Add, Quantifier, Clip

Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • include/libroardsp/libroardsp.h

    r922 r979  
    3939#define ROARDSP_FILTER_LOWP           2 
    4040#define ROARDSP_FILTER_HIGHP          3 
     41#define ROARDSP_FILTER_MODULATE       4 
     42#define ROARDSP_FILTER_QUANTIFY       5 
     43#define ROARDSP_FILTER_CLIP           6 
     44#define ROARDSP_FILTER_ADD            7 
    4145 
    4246// filter CTLs: 
     
    4650#define ROARDSP_FCTL_MUL              3 
    4751#define ROARDSP_FCTL_DIV              4 
     52#define ROARDSP_FCTL_N                5 
     53#define ROARDSP_FCTL_LIMIT            6 
     54#define ROARDSP_FCTL_PHASE            7 
    4855 
    4956// types: 
     
    114121int roardsp_amp_ctl   (struct roardsp_filter * filter, int cmd, void * data); 
    115122 
     123int roardsp_add_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id); 
     124int roardsp_add_calc16(struct roardsp_filter * filter, void * data, size_t samples); 
     125 
     126int roardsp_quantify_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id); 
     127int roardsp_quantify_uninit(struct roardsp_filter * filter); 
     128int roardsp_quantify_calc16(struct roardsp_filter * filter, void * data, size_t samples); 
     129int roardsp_quantify_ctl   (struct roardsp_filter * filter, int cmd, void * data); 
     130 
     131int roardsp_clip_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id); 
     132int roardsp_clip_calc16(struct roardsp_filter * filter, void * data, size_t samples); 
     133int roardsp_clip_ctl   (struct roardsp_filter * filter, int cmd, void * data); 
     134 
    116135// codecs: 
    117136int roardsp_conv_alaw2pcm16 (int16_t * out, char * in, size_t len); 
  • libroardsp/Makefile

    r922 r979  
    44OBJS=libroardsp.o filter.o filterchain.o alaw.o mulaw.o 
    55OLDROAR=midi.o 
    6 FILTER=lowp.o highp.o amp.o 
     6FILTER=lowp.o highp.o amp.o quantify.o add.o clip.o 
    77 
    88#DEFINES        = -DDEBUG 
  • libroardsp/filter.c

    r882 r979  
    3535 {ROARDSP_FILTER_AMP, "AMP", roardsp_amp_init, roardsp_amp_uninit, roardsp_amp_ctl, { 
    3636           {NULL, NULL, NULL},{roardsp_amp_calc8, NULL, NULL},{roardsp_amp_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}}, 
     37 {ROARDSP_FILTER_ADD, "Add", roardsp_add_init, roardsp_amp_uninit, roardsp_amp_ctl, { 
     38           {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_add_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}}, 
    3739 {ROARDSP_FILTER_LOWP, "Lowpass", roardsp_lowp_init, roardsp_lowp_uninit, roardsp_lowp_ctl, { 
    3840           {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_lowp_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}}, 
    3941 {ROARDSP_FILTER_HIGHP, "Highpass", roardsp_highp_init, roardsp_highp_uninit, roardsp_highp_ctl, { 
    4042           {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_highp_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}}, 
     43 {ROARDSP_FILTER_QUANTIFY, "Quantifier", roardsp_quantify_init, NULL, roardsp_quantify_ctl, { 
     44           {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_quantify_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}}, 
     45 {ROARDSP_FILTER_CLIP, "Clip", roardsp_clip_init, NULL, roardsp_clip_ctl, { 
     46           {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_clip_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}}, 
    4147 {-1, NULL, NULL, NULL, NULL, { 
    4248      // ?                  8Bit               16Bit              24Bit              32Bit 
Note: See TracChangeset for help on using the changeset viewer.