| /OK3568_Linux_fs/buildroot/dl/sox/git/src/ |
| H A D | effects.c | 30 static int default_function(sox_effect_t * effp UNUSED) in default_function() 36 int lsx_flow_copy(sox_effect_t * effp UNUSED, const sox_sample_t * ibuf, in lsx_flow_copy() 45 static int default_drain(sox_effect_t * effp UNUSED, sox_sample_t *obuf UNUSED, size_t *osamp) in default_drain() 52 static int default_getopts(sox_effect_t * effp, int argc, char **argv UNUSED) in default_getopts() argument 54 return --argc? lsx_usage(effp) : SOX_SUCCESS; in default_getopts() 60 sox_effect_t * effp = lsx_calloc(1, sizeof(*effp)); in sox_create_effect() local 61 effp->obuf = NULL; in sox_create_effect() 63 effp->global_info = sox_get_effects_globals(); in sox_create_effect() 64 effp->handler = *eh; in sox_create_effect() 65 if (!effp->handler.getopts) effp->handler.getopts = default_getopts; in sox_create_effect() [all …]
|
| H A D | silence.c | 66 static void clear_rms(sox_effect_t * effp) in clear_rms() argument 69 priv_t * silence = (priv_t *) effp->priv; in clear_rms() 79 static int sox_silence_getopts(sox_effect_t * effp, int argc, char **argv) in sox_silence_getopts() argument 81 priv_t * silence = (priv_t *) effp->priv; in sox_silence_getopts() 98 return lsx_usage(effp); in sox_silence_getopts() 103 return lsx_usage(effp); in sox_silence_getopts() 116 return lsx_usage(effp); in sox_silence_getopts() 126 return lsx_usage(effp); in sox_silence_getopts() 132 return lsx_usage(effp); in sox_silence_getopts() 145 return lsx_usage(effp); in sox_silence_getopts() [all …]
|
| H A D | remix.c | 43 return lsx_usage(effp); \ 48 static int parse(sox_effect_t * effp, char * * argv, unsigned channels) in parse() argument 50 priv_t * p = (priv_t *)effp->priv; in parse() 69 return lsx_usage(effp); in parse() 97 effp->out_signal.channels = p->num_out_channels; in parse() 113 static int create(sox_effect_t * effp, int argc, char * * argv) in create() argument 115 priv_t * p = (priv_t *)effp->priv; in create() 126 return parse(effp, argv, 1); /* No channels yet; parse with dummy */ in create() 129 static int start(sox_effect_t * effp) in start() argument 131 priv_t * p = (priv_t *)effp->priv; in start() [all …]
|
| H A D | gain.c | 34 static int create(sox_effect_t * effp, int argc, char * * argv) in create() argument 36 priv_t * p = (priv_t *)effp->priv; in create() 48 default: lsx_fail("invalid option `-%c'", *q); return lsx_usage(effp); in create() 64 return argc? lsx_usage(effp) : SOX_SUCCESS; in create() 67 static int start(sox_effect_t * effp) in start() argument 69 priv_t * p = (priv_t *)effp->priv; in start() 71 if (effp->flow == 0) { in start() 73 if (!effp->in_signal.mult || *effp->in_signal.mult >= 1) { in start() 77 p->reclaim = 1 / *effp->in_signal.mult; in start() 79 effp->out_signal.mult = p->make_headroom? &p->fixed_gain : NULL; in start() [all …]
|
| H A D | pad.c | 33 static int parse(sox_effect_t * effp, char * * argv, sox_rate_t rate) in parse() argument 35 priv_t * p = (priv_t *)effp->priv; in parse() 40 (effp->in_signal.length != SOX_UNKNOWN_LEN ? in parse() 41 effp->in_signal.length / effp->in_signal.channels : SOX_UNKNOWN_LEN); in parse() 69 return lsx_usage(effp); in parse() 73 static int create(sox_effect_t * effp, int argc, char * * argv) in create() argument 75 priv_t * p = (priv_t *)effp->priv; in create() 79 return parse(effp, argv, 1e5); /* No rate yet; parse with dummy */ in create() 82 static int start(sox_effect_t * effp) in start() argument 84 priv_t * p = (priv_t *)effp->priv; in start() [all …]
|
| H A D | trim.c | 38 static int parse(sox_effect_t *effp, int argc, char **argv) in parse() argument 40 priv_t *p = (priv_t*) effp->priv; in parse() 52 return lsx_usage(effp); in parse() 58 static int start(sox_effect_t *effp) in start() argument 60 priv_t *p = (priv_t*) effp->priv; in start() 61 uint64_t in_length = effp->in_signal.length != SOX_UNKNOWN_LEN ? in start() 62 effp->in_signal.length / effp->in_signal.channels : SOX_UNKNOWN_LEN; in start() 71 …if (!lsx_parseposition(effp->in_signal.rate, p->pos[i].argstr, &p->pos[i].sample, last_seen, in_le… in start() 107 effp->out_signal.length = SOX_UNKNOWN_LEN; in start() 109 effp->out_signal.length = 0; in start() [all …]
|
| H A D | delay.c | 31 static int lsx_kill(sox_effect_t * effp) in lsx_kill() argument 33 priv_t * p = (priv_t *)effp->priv; in lsx_kill() 43 static int create(sox_effect_t * effp, int argc, char * * argv) in create() argument 45 priv_t * p = (priv_t *)effp->priv; in create() 55 lsx_kill(effp); in create() 56 return lsx_usage(effp); in create() 62 static int stop(sox_effect_t * effp) in stop() argument 64 priv_t * p = (priv_t *)effp->priv; in stop() 69 static int start(sox_effect_t * effp) in start() argument 71 priv_t * p = (priv_t *)effp->priv; in start() [all …]
|
| H A D | biquad.c | 34 int lsx_biquad_getopts(sox_effect_t * effp, int argc, char **argv, in lsx_biquad_getopts() argument 38 priv_t * p = (priv_t *)effp->priv; in lsx_biquad_getopts() 49 return lsx_usage(effp); in lsx_biquad_getopts() 61 static int start(sox_effect_t * effp) in start() argument 63 priv_t * p = (priv_t *)effp->priv; in start() 76 int lsx_biquad_start(sox_effect_t * effp) in lsx_biquad_start() argument 78 priv_t * p = (priv_t *)effp->priv; in lsx_biquad_start() 80 start(effp); in lsx_biquad_start() 82 if (effp->global_info->plot == sox_plot_octave) { in lsx_biquad_start() 96 , effp->in_signal.rate, p->b0, p->b1, p->b2, p->a1, p->a2 in lsx_biquad_start() [all …]
|
| H A D | splice.c | 66 static void splice(sox_effect_t * effp, const sox_sample_t * in1, const in splice() argument 69 priv_t * p = (priv_t *)effp->priv; in splice() 79 output[k] = SOX_ROUND_CLIP_COUNT(d, effp->clips); /* Might clip */ in splice() 90 output[k] = SOX_ROUND_CLIP_COUNT(d, effp->clips); /* Should not clip */ in splice() 101 output[k] = SOX_ROUND_CLIP_COUNT(d, effp->clips); /* Should not clip */ in splice() 107 static uint64_t do_splice(sox_effect_t * effp, in do_splice() argument 112 splice(effp, f, f + (overlap + offset) * channels, in do_splice() 117 static int parse(sox_effect_t * effp, char * * argv, sox_rate_t rate) in parse() argument 119 priv_t * p = (priv_t *)effp->priv; in parse() 124 (effp->in_signal.length != SOX_UNKNOWN_LEN ? in parse() [all …]
|
| H A D | stats.c | 32 static int getopts(sox_effect_t * effp, int argc, char **argv) in getopts() argument 34 priv_t * p = (priv_t *)effp->priv; in getopts() 46 default: lsx_fail("invalid option `-%c'", optstate.opt); return lsx_usage(effp); in getopts() 50 return optstate.ind != argc? lsx_usage(effp) : SOX_SUCCESS; in getopts() 53 static int start(sox_effect_t * effp) in start() argument 55 priv_t * p = (priv_t *)effp->priv; in start() 58 p->mult = exp((-1 / p->time_constant / effp->in_signal.rate)); in start() 59 p->tc_samples = 5 * p->time_constant * effp->in_signal.rate + .5; in start() 68 static int flow(sox_effect_t * effp, const sox_sample_t * ibuf, in flow() argument 71 priv_t * p = (priv_t *)effp->priv; in flow() [all …]
|
| H A D | fade.c | 44 static int sox_fade_getopts(sox_effect_t * effp, int argc, char **argv) in sox_fade_getopts() argument 47 priv_t * fade = (priv_t *) effp->priv; in sox_fade_getopts() 55 return lsx_usage(effp); in sox_fade_getopts() 80 return lsx_usage(effp); in sox_fade_getopts() 95 return lsx_usage(effp); in sox_fade_getopts() 105 return lsx_usage(effp); in sox_fade_getopts() 117 static int sox_fade_start(sox_effect_t * effp) in sox_fade_start() argument 119 priv_t * fade = (priv_t *) effp->priv; in sox_fade_start() 122 uint64_t in_length = effp->in_signal.length != SOX_UNKNOWN_LEN ? in sox_fade_start() 123 effp->in_signal.length / effp->in_signal.channels : SOX_UNKNOWN_LEN; in sox_fade_start() [all …]
|
| H A D | biquads.c | 68 static int hilo1_getopts(sox_effect_t * effp, int argc, char **argv) { in hilo1_getopts() argument 69 return lsx_biquad_getopts(effp, argc, argv, 1, 1, 0, 1, 2, "", in hilo1_getopts() 70 *effp->handler.name == 'l'? filter_LPF_1 : filter_HPF_1); in hilo1_getopts() 74 static int hilo2_getopts(sox_effect_t * effp, int argc, char **argv) { in hilo2_getopts() argument 75 priv_t * p = (priv_t *)effp->priv; in hilo2_getopts() 77 return hilo1_getopts(effp, argc - 1, argv + 1); in hilo2_getopts() 81 return lsx_biquad_getopts(effp, argc, argv, 1, 2, 0, 1, 2, "qohk", in hilo2_getopts() 82 *effp->handler.name == 'l'? filter_LPF : filter_HPF); in hilo2_getopts() 86 static int bandpass_getopts(sox_effect_t * effp, int argc, char **argv) { in bandpass_getopts() argument 90 return lsx_biquad_getopts(effp, argc, argv, 2, 2, 0, 1, 2, "hkqob", type); in bandpass_getopts() [all …]
|
| H A D | repeat.c | 27 static int create(sox_effect_t * effp, int argc, char * * argv) in create() argument 29 priv_t * p = (priv_t *)effp->priv; in create() 37 return argc? lsx_usage(effp) : SOX_SUCCESS; in create() 40 static int start(sox_effect_t * effp) in start() argument 42 priv_t * p = (priv_t *)effp->priv; in start() 52 if (effp->in_signal.length != SOX_UNKNOWN_LEN && p->num_repeats != UINT_MAX) in start() 53 effp->out_signal.length = effp->in_signal.length * (p->num_repeats + 1); in start() 55 effp->out_signal.length = SOX_UNKNOWN_LEN; in start() 60 static int flow(sox_effect_t * effp, const sox_sample_t * ibuf, in flow() argument 63 priv_t * p = (priv_t *)effp->priv; in flow() [all …]
|
| H A D | ladspa.c | 102 static int sox_ladspa_getopts(sox_effect_t *effp, int argc, char **argv) in sox_ladspa_getopts() argument 104 priv_t * l_st = (priv_t *)effp->priv; in sox_ladspa_getopts() 118 return lsx_usage(effp); in sox_ladspa_getopts() 209 return lsx_usage(effp); in sox_ladspa_getopts() 218 return argc? lsx_usage(effp) : SOX_SUCCESS; in sox_ladspa_getopts() 224 static int sox_ladspa_start(sox_effect_t * effp) in sox_ladspa_start() argument 226 priv_t * l_st = (priv_t *)effp->priv; in sox_ladspa_start() 229 unsigned long rate = (unsigned long)effp->in_signal.rate; in sox_ladspa_start() 232 lsx_debug("rate for plugin is %g", effp->in_signal.rate); in sox_ladspa_start() 235 effp->in_signal.channels == effp->out_signal.channels) { in sox_ladspa_start() [all …]
|
| H A D | tempo.c | 210 static int getopts(sox_effect_t * effp, int argc, char **argv) in getopts() argument 212 priv_t * p = (priv_t *)effp->priv; in getopts() 228 default: lsx_fail("unknown option `-%c'", optstate.opt); return lsx_usage(effp); in getopts() 248 return argc? lsx_usage(effp) : SOX_SUCCESS; in getopts() 251 static int start(sox_effect_t * effp) in start() argument 253 priv_t * p = (priv_t *)effp->priv; in start() 258 p->tempo = tempo_create((size_t)effp->in_signal.channels); in start() 259 tempo_setup(p->tempo, effp->in_signal.rate, p->quick_search, p->factor, in start() 262 effp->out_signal.length = SOX_UNKNOWN_LEN; in start() 263 if (effp->in_signal.length != SOX_UNKNOWN_LEN) { in start() [all …]
|
| H A D | dither.c | 295 static int flow_no_shape(sox_effect_t * effp, const sox_sample_t * ibuf, in flow_no_shape() argument 298 priv_t * p = (priv_t *)effp->priv; in flow_no_shape() 307 lsx_debug("flow %" PRIuPTR ": on @ %" PRIu64, effp->flow, p->num_output); in flow_no_shape() 310 lsx_debug("flow %" PRIuPTR ": off @ %" PRIu64, effp->flow, p->num_output); in flow_no_shape() 320 ++effp->clips, *obuf = SOX_SAMPLE_MIN; in flow_no_shape() 322 ++effp->clips, *obuf = SOX_INT_MAX(p->prec) << (32 - p->prec); in flow_no_shape() 333 static int getopts(sox_effect_t * effp, int argc, char * * argv) in getopts() argument 335 priv_t * p = (priv_t *)effp->priv; in getopts() 350 default: lsx_fail("invalid option `-%c'", optstate.opt); return lsx_usage(effp); in getopts() 353 return argc? lsx_usage(effp) : SOX_SUCCESS; in getopts() [all …]
|
| H A D | noiseprof.c | 45 static int sox_noiseprof_getopts(sox_effect_t * effp, int argc, char **argv) in sox_noiseprof_getopts() argument 47 priv_t * data = (priv_t *) effp->priv; in sox_noiseprof_getopts() 53 return lsx_usage(effp); in sox_noiseprof_getopts() 62 static int sox_noiseprof_start(sox_effect_t * effp) in sox_noiseprof_start() argument 64 priv_t * data = (priv_t *) effp->priv; in sox_noiseprof_start() 65 unsigned channels = effp->in_signal.channels; in sox_noiseprof_start() 71 if (effp->global_info->global_info->stdout_in_use_by) { in sox_noiseprof_start() 72 lsx_fail("stdout already in use by `%s'", effp->global_info->global_info->stdout_in_use_by); in sox_noiseprof_start() 75 effp->global_info->global_info->stdout_in_use_by = effp->handler.name; in sox_noiseprof_start() 115 static int sox_noiseprof_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf, in sox_noiseprof_flow() argument [all …]
|
| H A D | divide.c | 30 static int start(sox_effect_t * effp) in start() argument 32 priv_t * p = (priv_t *)effp->priv; in start() 33 p->last = lsx_calloc(effp->in_signal.channels, sizeof(*p->last)); in start() 37 static int flow(sox_effect_t * effp, const sox_sample_t * ibuf, in flow() argument 40 priv_t * p = (priv_t *)effp->priv; in flow() 41 size_t i, len = min(*isamp, *osamp) / effp->in_signal.channels; in flow() 42 *osamp = *isamp = len * effp->in_signal.channels; in flow() 48 for (i = 1; i < effp->in_signal.channels; ++i) { in flow() 50 p->last[i] = *obuf++ = SOX_ROUND_CLIP_COUNT(out, effp->clips); in flow() 53 else for (i = 1; i < effp->in_signal.channels; ++i, ++ibuf) in flow() [all …]
|
| H A D | vad.c | 45 if (p->name < min || *parseIndex) return lsx_usage(effp); \ 48 static int create(sox_effect_t * effp, int argc, char * * argv) in create() argument 50 priv_t * p = (priv_t *)effp->priv; in create() 94 default: lsx_fail("invalid option `-%c'", optstate.opt); return lsx_usage(effp); in create() 96 return optstate.ind !=argc? lsx_usage(effp) : SOX_SUCCESS; in create() 99 static int start(sox_effect_t * effp) in start() argument 101 priv_t * p = (priv_t *)effp->priv; in start() 104 fixedPreTriggerLen_ns = p->preTriggerTime * effp->in_signal.rate + .5; in start() 105 fixedPreTriggerLen_ns *= effp->in_signal.channels; in start() 107 p->measureLen_ws = effp->in_signal.rate * p->measureDuration + .5; in start() [all …]
|
| H A D | compand.c | 67 static int getopts(sox_effect_t * effp, int argc, char * * argv) in getopts() argument 69 priv_t * l = (priv_t *) effp->priv; in getopts() 76 return lsx_usage(effp); in getopts() 137 static int start(sox_effect_t * effp) in start() argument 139 priv_t * l = (priv_t *) effp->priv; in start() 143 l->expectedChannels, effp->out_signal.channels); in start() 147 if (!lsx_compandt_show(&l->transfer_fn, effp->global_info->plot)) in start() 153 if (l->channels[i].attack_times[j] > 1.0/effp->out_signal.rate) in start() 155 exp(-1.0/(effp->out_signal.rate * l->channels[i].attack_times[j])); in start() 160 l->delay_buf_size = l->delay * effp->out_signal.rate * effp->out_signal.channels; in start() [all …]
|
| H A D | firfit.c | 33 static int create(sox_effect_t * effp, int argc, char **argv) in create() argument 35 priv_t * p = (priv_t *)effp->priv; in create() 42 return argc? lsx_usage(effp) : SOX_SUCCESS; in create() 45 static double * make_filter(sox_effect_t * effp) in make_filter() argument 47 priv_t * p = (priv_t *)effp->priv; in make_filter() 49 sox_rate_t rate = effp->in_signal.rate; in make_filter() 82 static sox_bool read_knots(sox_effect_t * effp) in read_knots() argument 84 priv_t * p = (priv_t *) effp->priv; in read_knots() 85 FILE * file = lsx_open_input_file(effp, p->filename, sox_true); in read_knots() 114 static int start(sox_effect_t * effp) in start() argument [all …]
|
| H A D | noisered.c | 60 static int sox_noisered_getopts(sox_effect_t * effp, int argc, char **argv) in sox_noisered_getopts() argument 62 priv_t * p = (priv_t *) effp->priv; in sox_noisered_getopts() 76 return argc? lsx_usage(effp) : SOX_SUCCESS; in sox_noisered_getopts() 83 static int sox_noisered_start(sox_effect_t * effp) in sox_noisered_start() argument 85 priv_t * data = (priv_t *) effp->priv; in sox_noisered_start() 87 size_t channels = effp->in_signal.channels; in sox_noisered_start() 89 FILE * ifp = lsx_open_input_file(effp, data->profile_filename, sox_false); in sox_noisered_start() 133 effp->out_signal.length = SOX_UNKNOWN_LEN; /* TODO: calculate actual length */ in sox_noisered_start() 216 static int process_window(sox_effect_t * effp, priv_t * data, unsigned chan_num, unsigned num_chans, in process_window() argument 236 SOX_FLOAT_32BIT_TO_SAMPLE(s, effp->clips); in process_window() [all …]
|
| H A D | reverb.c | 180 static int getopts(sox_effect_t * effp, int argc, char **argv) in getopts() argument 182 priv_t * p = (priv_t *)effp->priv; in getopts() 198 return argc ? lsx_usage(effp) : SOX_SUCCESS; in getopts() 201 static int start(sox_effect_t * effp) in start() argument 203 priv_t * p = (priv_t *)effp->priv; in start() 207 effp->out_signal.rate = effp->in_signal.rate; in start() 208 if (effp->in_signal.channels > 2 && p->stereo_depth) { in start() 212 if (effp->in_signal.channels == 1 && p->stereo_depth) in start() 213 effp->out_signal.channels = p->ochannels = 2; in start() 214 else effp->out_signal.channels = effp->in_signal.channels; in start() [all …]
|
| H A D | dcshift.c | 27 static int sox_dcshift_getopts(sox_effect_t * effp, int argc, char **argv) in sox_dcshift_getopts() argument 29 priv_t * dcs = (priv_t *) effp->priv; in sox_dcshift_getopts() 35 return lsx_usage(effp); in sox_dcshift_getopts() 38 return lsx_usage(effp); in sox_dcshift_getopts() 43 return lsx_usage(effp); in sox_dcshift_getopts() 61 static int sox_dcshift_start(sox_effect_t * effp) in sox_dcshift_start() argument 63 priv_t * dcs = (priv_t *) effp->priv; in sox_dcshift_start() 77 static int sox_dcshift_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf, in sox_dcshift_flow() argument 80 priv_t * dcs = (priv_t *) effp->priv; in sox_dcshift_flow() 121 SOX_SAMPLE_CLIP_COUNT(sample, effp->clips); in sox_dcshift_flow() [all …]
|
| H A D | mcompand.c | 165 static int getopts(sox_effect_t * effp, int argc, char **argv) in getopts() argument 170 priv_t * c = (priv_t *) effp->priv; in getopts() 216 static int start(sox_effect_t * effp) in start() argument 218 priv_t * c = (priv_t *) effp->priv; in start() 225 l->delay_size = c->bands[band].delay * effp->out_signal.rate * effp->out_signal.channels; in start() 235 if (l->attackRate[i] > 1.0/effp->out_signal.rate) in start() 237 exp(-1.0/(effp->out_signal.rate * l->attackRate[i])); in start() 240 if (l->decayRate[i] > 1.0/effp->out_signal.rate) in start() 242 exp(-1.0/(effp->out_signal.rate * l->decayRate[i])); in start() 254 crossover_setup(effp, &l->filter, l->topfreq); in start() [all …]
|