Changeset 5270:e25346c13638 in roaraudio for libroardsp
- Timestamp:
- 11/17/11 18:20:12 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libroardsp
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
libroardsp/Makefile
r5269 r5270 17 17 INCLUDE = -I../include -I../include/libroardsp 18 18 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 19 LDFLAGS+= -g $(SHARED) -L../lib/ $(LDPATH)19 LDFLAGS+= -g -Wall $(SHARED) -L../lib/ $(LDPATH) 20 20 21 21 LIBS = $(LIBROARDSP_NS) -
libroardsp/alaw.c
r5210 r5270 58 58 59 59 #ifdef ROAR_SUPPORT_ALAW 60 int16_t _roardsp_alaw2pcm16[] = {60 static const int16_t _roardsp_alaw2pcm16[] = { 61 61 /* -------- SUN -------- */ 62 62 -5504, -5248, -6016, -5760, -4480, -4224, -4992, … … 101 101 102 102 #ifdef ROAR_SUPPORT_ALAW_RW 103 int8_t _roardsp_pcm132alaw[] = {103 static const int8_t _roardsp_pcm132alaw[] = { 104 104 /* -------- SUN -------- */ 105 105 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, -
libroardsp/amp.c
r4708 r5270 30 30 case 8: return roar_amp_pcm_8bit (output, input, samples, channels, set); break; 31 31 case 16: return roar_amp_pcm_16bit(output, input, samples, channels, set); break; 32 case 24: return roar_amp_pcm_24bit(output, input, samples, channels, set); break;33 32 case 32: return roar_amp_pcm_32bit(output, input, samples, channels, set); break; 34 33 default: return -1; … … 88 87 } 89 88 90 int roar_amp_pcm_24bit (void * output, void * input, int samples, int channels, struct roar_mixer_settings * set) {91 return -1;92 }93 94 89 int roar_amp_pcm_32bit (int32_t * output, int32_t * input, int samples, int channels, struct roar_mixer_settings * set) { 95 90 #ifdef ROAR_NATIVE_INT64 -
libroardsp/channels.c
r4708 r5270 93 93 94 94 int roardsp_chanlist2str(char * list, size_t len, char * str, size_t strlen) { 95 size_t i; 95 96 char * name; 96 int i;97 97 98 98 if ( list == NULL && len > 0 ) -
libroardsp/filter.c
r5269 r5270 26 26 #include "libroardsp.h" 27 27 28 st ruct _roardsp_filterlist {28 static struct _roardsp_filterlist { 29 29 int id; 30 30 char * name; -
libroardsp/filter_agc.c
r4708 r5270 28 28 int roardsp_agc_init (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 29 29 struct roardsp_agc * self = roar_mm_malloc(sizeof(struct roardsp_agc)); 30 31 (void)id; 30 32 31 33 if ( self == NULL ) -
libroardsp/filter_amp.c
r5181 r5270 28 28 int roardsp_amp_init (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 29 29 struct roardsp_amp * self = roar_mm_malloc(sizeof(struct roardsp_amp)); 30 31 (void)stream, (void)id; 30 32 31 33 if ( self == NULL ) -
libroardsp/filter_clip.c
r5177 r5270 27 27 28 28 int roardsp_clip_init (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 29 (void)stream, (void)id; 30 29 31 if ( (filter->inst = roar_mm_malloc(sizeof(struct roardsp_clip))) == NULL ) 30 32 return -1; -
libroardsp/filter_dcblock.c
r4708 r5270 29 29 struct roardsp_dcblock * inst = roar_mm_malloc(sizeof(struct roardsp_dcblock)); 30 30 // roardsp_downmix_ctl(filter, ROARDSP_FCTL_MODE, &mode); 31 32 (void)stream, (void)id; 31 33 32 34 if ( inst == NULL ) { -
libroardsp/filter_highp.c
r5181 r5270 31 31 struct roardsp_highp * self = roar_mm_malloc(sizeof(struct roardsp_highp)); 32 32 33 (void)stream, (void)id; 34 33 35 if ( self == NULL ) 34 36 return -1; … … 52 54 int##bits##_t * samp = (int##bits##_t *) data; \ 53 55 register int##twobits##_t s, h; \ 54 int i, c; \55 int channels = filter->channels; \56 size_t i, c; \ 57 size_t channels = filter->channels; \ 56 58 \ 57 59 if ( channels > ROAR_MAX_CHANNELS ) \ -
libroardsp/filter_lowp.c
r5181 r5270 31 31 struct roardsp_lowp * self = roar_mm_malloc(sizeof(struct roardsp_lowp)); 32 32 33 (void)stream, (void)id; 34 33 35 ROAR_DBG("roardsp_lowp_init(*): self=%p", self); 34 36 … … 53 55 int##bits##_t * samp = (int##bits##_t *) data; \ 54 56 register int##twobits##_t s; \ 55 int i, c; \56 int channels = filter->channels; \57 size_t i, c; \ 58 size_t channels = filter->channels; \ 57 59 \ 58 60 if ( channels > ROAR_MAX_CHANNELS ) \ -
libroardsp/filter_quantify.c
r5181 r5270 27 27 28 28 int roardsp_quantify_init (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 29 30 (void)stream, (void)id; 29 31 30 32 roardsp_filter_reset(filter, ROARDSP_RESET_FULL); -
libroardsp/filter_responsecurve.c
r5269 r5270 29 29 struct roardsp_responsecurve * self = roar_mm_malloc(sizeof(struct roardsp_responsecurve)); 30 30 31 (void)stream, (void)id; 32 31 33 ROAR_DBG("roardsp_responsecurve_init(filter=%p, stream=%p, id=%i) = ?", filter, stream, id); 32 34 … … 50 52 51 53 static double __func_pass(double i, double N) { 54 (void)N; 52 55 return i; 53 56 } … … 70 73 71 74 static double __func_cos(double i, double N) { 75 (void)N; 72 76 return 0.5 - cos(i * M_PI)/2.; 73 77 } 74 78 75 79 static double __func_icos(double i, double N) { 80 (void)N; 76 81 return 2.*i - 0.5 + cos(i * M_PI)/2.; 77 82 } -
libroardsp/filter_swap.c
r5181 r5270 28 28 int roardsp_swap_init (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 29 29 struct roardsp_swap * inst = roar_mm_malloc(sizeof(struct roardsp_swap)); 30 31 (void)stream, (void)id; 30 32 31 33 ROAR_DBG("roardsp_swap_init(*): inst=%p", inst); … … 60 62 size_t i; \ 61 63 \ 64 (void)filter; \ 65 \ 62 66 for (i = 0; i < samples; i += 2) { \ 63 67 ROAR_DBG("roardsp_swap_calc*2(*): d[i]=%i, d[i+1]=%i", d[i], d[i+1]); \ … … 75 79 76 80 int roardsp_swap_ctl (struct roardsp_filter * filter, int cmd, void * data) { 81 (void)filter, (void)cmd, (void)data; 82 roar_err_set(ROAR_ERROR_NOSYS); 77 83 return -1; 78 84 } -
libroardsp/interleave.c
r4708 r5270 27 27 28 28 int roar_interl_init (struct roar_interleave * state, size_t channels, size_t bits) { 29 if ( state == NULL ) 29 if ( state == NULL ) { 30 roar_err_set(ROAR_ERROR_FAULT); 30 31 return -1; 32 } 31 33 32 34 // we can currently only hanle full bytes: … … 35 37 36 38 // currently we have a channel limit 37 if ( channels > ROAR_INTERLEAVE_MAX_CHANNELS ) 39 if ( channels > ROAR_INTERLEAVE_MAX_CHANNELS ) { 40 roar_err_set(ROAR_ERROR_RANGE); 38 41 return -1; 42 } 39 43 40 44 memset(state, 0, sizeof(struct roar_interleave)); … … 47 51 48 52 int roar_interl_uninit(struct roar_interleave * state) { 49 if ( state == NULL ) 53 if ( state == NULL ) { 54 roar_err_set(ROAR_ERROR_FAULT); 50 55 return -1; 56 } 51 57 52 58 memset(state, 0, sizeof(struct roar_interleave)); … … 56 62 57 63 int roar_interl_ctl (struct roar_interleave * state, int cmd, void * data) { 58 if ( state == NULL ) 64 if ( state == NULL ) { 65 roar_err_set(ROAR_ERROR_FAULT); 59 66 return -1; 67 } 60 68 69 (void)state, (void)cmd, (void)data; 70 71 roar_err_set(ROAR_ERROR_NOSYS); 61 72 return -1; 62 73 } … … 68 79 char * ip[ROAR_INTERLEAVE_MAX_CHANNELS]; // output pointer 69 80 70 if ( state == NULL ) 81 if ( state == NULL ) { 82 roar_err_set(ROAR_ERROR_FAULT); 71 83 return -1; 84 } 72 85 73 if ( in == NULL || out == NULL ) 86 if ( in == NULL || out == NULL ) { 87 roar_err_set(ROAR_ERROR_FAULT); 74 88 return -1; 89 } 75 90 76 91 if ( len == 0 ) -
libroardsp/mixer.c
r4708 r5270 30 30 case 8: return roar_mix_pcm_8bit (output, (int8_t **)input, samples); break; 31 31 case 16: return roar_mix_pcm_16bit(output, (int16_t **)input, samples); break; 32 case 24: return roar_mix_pcm_24bit(output, input, samples); break;33 32 case 32: return roar_mix_pcm_32bit(output, (int32_t **)input, samples); break; 34 33 default: return -1; … … 82 81 } 83 82 84 int roar_mix_pcm_24bit (void * output, void ** input, int samples) {85 return -1;86 }87 88 83 int roar_mix_pcm_32bit (int32_t * output, int32_t ** input, int samples) { 89 84 #ifdef ROAR_NATIVE_INT64 -
libroardsp/mulaw.c
r4708 r5270 58 58 59 59 #ifdef ROAR_SUPPORT_MULAW 60 int16_t _roardsp_mulaw2pcm16[] = {60 static const int16_t _roardsp_mulaw2pcm16[] = { 61 61 /* -------- SUN -------- */ 62 62 -32124, -31100, -30076, -29052, -28028, -27004, -25980, … … 101 101 102 102 #ifdef ROAR_SUPPORT_MULAW_RW 103 int8_t _roardsp_pcm142mulaw[] = {103 static const int8_t _roardsp_pcm142mulaw[] = { 104 104 /* -------- SUN -------- */ 105 105 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -
libroardsp/poly.c
r4881 r5270 102 102 103 103 int roar_math_mkpoly_5x5 (float * poly, float * data) { 104 roar_err_set(ROAR_ERROR_NOSYS); 104 105 return -1; 105 106 } -
libroardsp/synth.c
r4708 r5270 96 96 float cv0, cv1; 97 97 #endif 98 int i;98 size_t i; 99 99 100 100 _CHECK_PCMOUT(); … … 133 133 // basic SINFs: 134 134 float roar_synth_synf_rect (float t, struct roar_synth_state * state) { 135 (void)state; 136 135 137 t /= 2*M_PI; 136 138 t -= (int)t; … … 143 145 144 146 float roar_synth_synf_saw (float t, struct roar_synth_state * state) { 147 (void)state; 148 145 149 t /= 2*M_PI; 146 150 t -= (int)t; … … 150 154 151 155 float roar_synth_synf_tri (float t, struct roar_synth_state * state) { 156 (void)state; 157 152 158 t /= 2*M_PI; 153 159 t -= (int)t; … … 160 166 161 167 float roar_synth_synf_trap (float t, struct roar_synth_state * state) { 168 (void)state; 169 162 170 t /= 2*M_PI; 163 171 t -= (int)t; … … 176 184 #ifdef ROAR_HAVE_LIBM 177 185 float roar_synth_synf_s2s (float t, struct roar_synth_state * state) { 186 (void)state; 187 178 188 float sin2 = sinf(t/1.2); 179 189 -
libroardsp/transcode.c
r4708 r5270 264 264 } 265 265 266 while ( ringstats.bytes > state->packet_len ) {266 while ( (ssize_t)ringstats.bytes > state->packet_len ) { 267 267 curlen = state->packet_len; 268 268 if ( roar_buffer_shift_out(&(state->iobuffer), bufdata, &curlen) == -1 ) { … … 421 421 // dummy functions used by some de/encoders: 422 422 int roar_xcoder_dummy_inituninit(struct roar_xcoder * state) { 423 (void)state; 423 424 return 0; 424 425 } … … 426 427 int roar_xcoder_dummy_packet_size_any(struct roar_xcoder * state, int samples) { 427 428 // the case samples=-1/samples!=-1 based things are done in the general func 429 (void)state, (void)samples; 428 430 return 0; 429 431 } 430 432 431 433 int roar_xcoder_dummy_proc_header(struct roar_xcoder * state) { 434 (void)state; 432 435 return 0; 433 436 } -
libroardsp/transcode_mualaw.c
r4708 r5270 36 36 return -1; 37 37 38 #define _SEND_RETURN() if ( roar_vio_write(state->backend, iobuf, outbyte) != outbyte ) \38 #define _SEND_RETURN() if ( roar_vio_write(state->backend, iobuf, outbyte) != (ssize_t)outbyte ) \ 39 39 return -1; \ 40 40 return 0; 41 41 42 #define _READ() if ( roar_vio_read(state->backend, iobuf, outbyte) != outbyte ) \42 #define _READ() if ( roar_vio_read(state->backend, iobuf, outbyte) != (ssize_t)outbyte ) \ 43 43 return -1; 44 44 -
libroardsp/vio_transcode.c
r4708 r5270 76 76 return !ret ? count : -1; 77 77 #else 78 return !roar_xcoder_proc(vio->inst, buf, count) ? count : -1;78 return !roar_xcoder_proc(vio->inst, buf, count) ? (ssize_t)count : -1; 79 79 #endif 80 80 } … … 137 137 return -1; 138 138 139 return !roar_bixcoder_read(vio->inst, buf, count) ? count : -1;139 return !roar_bixcoder_read(vio->inst, buf, count) ? (ssize_t)count : -1; 140 140 } 141 141 … … 148 148 return -1; 149 149 150 return !roar_bixcoder_write(vio->inst, buf, count) ? count : -1;150 return !roar_bixcoder_write(vio->inst, buf, count) ? (ssize_t)count : -1; 151 151 } 152 152
Note: See TracChangeset
for help on using the changeset viewer.