ref: 029227d809195ab9137473295b7147f5f09200d9
parent: 8b20bdf305ef1a2233fc0cc70393de1d9748ca8a
author: rrt <rrt>
date: Wed Apr 11 20:29:11 EDT 2007
Rename sox_sample_t -> sox_ssample_t and sox_usample_t to sox_sample_t, as per FIXME.
--- a/src/8svx.c
+++ b/src/8svx.c
@@ -193,7 +193,7 @@
/*======================================================================*/
/* 8SVXREAD */
/*======================================================================*/
-static sox_size_t sox_svxread(ft_t ft, sox_sample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_svxread(ft_t ft, sox_ssample_t *buf, sox_size_t nsamp)
{
unsigned char datum;
size_t done = 0, i;
@@ -261,7 +261,7 @@
/* 8SVXWRITE */
/*======================================================================*/
-static sox_size_t sox_svxwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_svxwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
svx_t p = (svx_t ) ft->priv;
--- a/src/adpcm.c
+++ b/src/adpcm.c
@@ -39,7 +39,7 @@
#include "adpcm.h"
typedef struct MsState {
- sox_sample_t step; /* step size */
+ sox_ssample_t step; /* step size */
short iCoef[2];
} MsState_t;
@@ -53,7 +53,7 @@
* 1.0 is scaled to 0x100
*/
static const
-sox_sample_t stepAdjustTable[] = {
+sox_ssample_t stepAdjustTable[] = {
230, 230, 230, 230, 307, 409, 512, 614,
768, 614, 512, 409, 307, 230, 230, 230
};
@@ -72,17 +72,17 @@
{ 392,-232}
};
-static inline sox_sample_t AdpcmDecode(sox_sample_t c, MsState_t *state,
- sox_sample_t sample1, sox_sample_t sample2)
+static inline sox_ssample_t AdpcmDecode(sox_ssample_t c, MsState_t *state,
+ sox_ssample_t sample1, sox_ssample_t sample2)
{
- sox_sample_t vlin;
- sox_sample_t sample;
- sox_sample_t step;
+ sox_ssample_t vlin;
+ sox_ssample_t sample;
+ sox_ssample_t step;
/** Compute next step value **/
step = state->step;
{
- sox_sample_t nstep;
+ sox_ssample_t nstep;
nstep = (stepAdjustTable[c] * step) >> 8;
state->step = (nstep < 16)? 16:nstep;
}
--- a/src/adpcms.c
+++ b/src/adpcms.c
@@ -155,7 +155,7 @@
* Notes :
******************************************************************************/
-sox_size_t sox_adpcm_read(ft_t ft, adpcm_io_t state, sox_sample_t * buffer, sox_size_t len)
+sox_size_t sox_adpcm_read(ft_t ft, adpcm_io_t state, sox_ssample_t * buffer, sox_size_t len)
{
sox_size_t n;
uint8_t byte;
@@ -202,7 +202,7 @@
* Notes :
******************************************************************************/
-sox_size_t sox_adpcm_write(ft_t ft, adpcm_io_t state, const sox_sample_t * buffer, sox_size_t length)
+sox_size_t sox_adpcm_write(ft_t ft, adpcm_io_t state, const sox_ssample_t * buffer, sox_size_t length)
{
sox_size_t count = 0;
uint8_t byte = state->store.byte;
--- a/src/adpcms.h
+++ b/src/adpcms.h
@@ -38,8 +38,8 @@
void sox_adpcm_reset(adpcm_io_t state, sox_encoding_t type);
int sox_adpcm_oki_start(ft_t ft, adpcm_io_t state);
int sox_adpcm_ima_start(ft_t ft, adpcm_io_t state);
-sox_size_t sox_adpcm_read(ft_t ft, adpcm_io_t state, sox_sample_t *buffer, sox_size_t len);
+sox_size_t sox_adpcm_read(ft_t ft, adpcm_io_t state, sox_ssample_t *buffer, sox_size_t len);
int sox_adpcm_stopread(ft_t ft, adpcm_io_t state);
-sox_size_t sox_adpcm_write(ft_t ft, adpcm_io_t state, const sox_sample_t *buffer, sox_size_t length);
+sox_size_t sox_adpcm_write(ft_t ft, adpcm_io_t state, const sox_ssample_t *buffer, sox_size_t length);
void sox_adpcm_flush(ft_t ft, adpcm_io_t state);
int sox_adpcm_stopwrite(ft_t ft, adpcm_io_t state);
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -602,7 +602,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_aiffread(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_aiffread(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
aiff_t aiff = (aiff_t ) ft->priv;
sox_ssize_t done;
@@ -689,7 +689,7 @@
return(aiffwriteheader(ft, 0x7f000000 / (ft->signal.size*ft->signal.channels)));
}
-static sox_size_t sox_aiffwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_aiffwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
aiff_t aiff = (aiff_t ) ft->priv;
aiff->nsamples += len;
@@ -706,7 +706,7 @@
NUL */
if (aiff->nsamples % 2 == 1 && ft->signal.size == 1 && ft->signal.channels == 1)
{
- sox_sample_t buf = 0;
+ sox_ssample_t buf = 0;
sox_rawwrite(ft, &buf, 1);
}
@@ -911,7 +911,7 @@
NUL */
if (aiff->nsamples % 2 == 1 && ft->signal.size == 1 && ft->signal.channels == 1)
{
- sox_sample_t buf = 0;
+ sox_ssample_t buf = 0;
sox_rawwrite(ft, &buf, 1);
}
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -424,19 +424,19 @@
return sox_alsasetup(ft, SND_PCM_STREAM_CAPTURE);
}
-static void ub_read_buf(sox_sample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips UNUSED)
+static void ub_read_buf(sox_ssample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips UNUSED)
{
while (len--)
*buf1++ = SOX_UNSIGNED_BYTE_TO_SAMPLE(*((unsigned char *)buf2++),);
}
-static void sb_read_buf(sox_sample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips UNUSED)
+static void sb_read_buf(sox_ssample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips UNUSED)
{
while (len--)
*buf1++ = SOX_SIGNED_BYTE_TO_SAMPLE(*((int8_t *)buf2++),);
}
-static void uw_read_buf(sox_sample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips UNUSED)
+static void uw_read_buf(sox_ssample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips UNUSED)
{
while (len--)
{
@@ -449,7 +449,7 @@
}
}
-static void sw_read_buf(sox_sample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips UNUSED)
+static void sw_read_buf(sox_ssample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips UNUSED)
{
while (len--)
{
@@ -462,12 +462,12 @@
}
}
-static sox_size_t sox_alsaread(ft_t ft, sox_sample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_alsaread(ft_t ft, sox_ssample_t *buf, sox_size_t nsamp)
{
sox_size_t len;
int err;
alsa_priv_t alsa = (alsa_priv_t)ft->priv;
- void (*read_buf)(sox_sample_t *, char const *, sox_size_t, sox_bool, sox_size_t *) = 0;
+ void (*read_buf)(sox_ssample_t *, char const *, sox_size_t, sox_bool, sox_size_t *) = 0;
switch(ft->signal.size) {
case SOX_SIZE_BYTE:
@@ -523,7 +523,7 @@
}
else
{
- read_buf(buf+(len*sizeof(sox_sample_t)), alsa->buf, (unsigned)err, ft->signal.reverse_bytes, &ft->clips);
+ read_buf(buf+(len*sizeof(sox_ssample_t)), alsa->buf, (unsigned)err, ft->signal.reverse_bytes, &ft->clips);
len += err * ft->signal.channels;
}
}
@@ -547,19 +547,19 @@
return sox_alsasetup(ft, SND_PCM_STREAM_PLAYBACK);
}
-static void sox_ub_write_buf(char* buf1, sox_sample_t const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips)
+static void sox_ub_write_buf(char* buf1, sox_ssample_t const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips)
{
while (len--)
*(uint8_t *)buf1++ = SOX_SAMPLE_TO_UNSIGNED_BYTE(*buf2++, *clips);
}
-static void sox_sb_write_buf(char *buf1, sox_sample_t const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips)
+static void sox_sb_write_buf(char *buf1, sox_ssample_t const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips)
{
while (len--)
*(int8_t *)buf1++ = SOX_SAMPLE_TO_SIGNED_BYTE(*buf2++, *clips);
}
-static void sox_uw_write_buf(char *buf1, sox_sample_t const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips)
+static void sox_uw_write_buf(char *buf1, sox_ssample_t const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips)
{
while (len--)
{
@@ -571,7 +571,7 @@
}
}
-static void sox_sw_write_buf(char *buf1, sox_sample_t const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips)
+static void sox_sw_write_buf(char *buf1, sox_ssample_t const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips)
{
while (len--)
{
@@ -583,11 +583,11 @@
}
}
-static sox_size_t sox_alsawrite(ft_t ft, const sox_sample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_alsawrite(ft_t ft, const sox_ssample_t *buf, sox_size_t nsamp)
{
sox_size_t osamp, done;
alsa_priv_t alsa = (alsa_priv_t)ft->priv;
- void (*write_buf)(char *, const sox_sample_t *, sox_size_t, sox_bool, sox_size_t *) = 0;
+ void (*write_buf)(char *, const sox_ssample_t *, sox_size_t, sox_bool, sox_size_t *) = 0;
switch(ft->signal.size) {
case SOX_SIZE_BYTE:
--- a/src/amr-wb.c
+++ b/src/amr-wb.c
@@ -123,7 +123,7 @@
return SOX_SUCCESS;
}
-static sox_size_t read(ft_t ft, sox_sample_t * buf, sox_size_t len)
+static sox_size_t read(ft_t ft, sox_ssample_t * buf, sox_size_t len)
{
amr_wb_t this = (amr_wb_t) ft->priv;
sox_size_t done;
@@ -168,7 +168,7 @@
return SOX_SUCCESS;
}
-static sox_size_t write(ft_t ft, const sox_sample_t * buf, sox_size_t len)
+static sox_size_t write(ft_t ft, const sox_ssample_t * buf, sox_size_t len)
{
amr_wb_t this = (amr_wb_t) ft->priv;
sox_size_t done;
--- a/src/ao.c
+++ b/src/ao.c
@@ -60,11 +60,11 @@
return SOX_SUCCESS;
}
-static sox_size_t write(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t write(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
ao_priv_t ao = (ao_priv_t)ft->priv;
- if (ao_play(ao->device, (void *)buf, len * sizeof(sox_sample_t)) == 0)
+ if (ao_play(ao->device, (void *)buf, len * sizeof(sox_ssample_t)) == 0)
return 0;
return len;
--- a/src/au.c
+++ b/src/au.c
@@ -329,7 +329,7 @@
return (p->in_bits > 0);
}
-static sox_size_t sox_auread(ft_t ft, sox_sample_t *buf, sox_size_t samp)
+static sox_size_t sox_auread(ft_t ft, sox_ssample_t *buf, sox_size_t samp)
{
au_t p = (au_t ) ft->priv;
unsigned char code;
@@ -347,7 +347,7 @@
return done;
}
-static sox_size_t sox_auwrite(ft_t ft, const sox_sample_t *buf, sox_size_t samp)
+static sox_size_t sox_auwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t samp)
{
au_t p = (au_t ) ft->priv;
p->data_size += samp * ft->signal.size;
--- a/src/avr.c
+++ b/src/avr.c
@@ -246,7 +246,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_avrwrite(ft_t ft, const sox_sample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_avrwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t nsamp)
{
avr_t avr = (avr_t)ft->priv;
--- a/src/biquad.c
+++ b/src/biquad.c
@@ -90,8 +90,8 @@
}
-int sox_biquad_flow(eff_t effp, const sox_sample_t *ibuf,
- sox_sample_t *obuf, sox_size_t *isamp, sox_size_t *osamp)
+int sox_biquad_flow(eff_t effp, const sox_ssample_t *ibuf,
+ sox_ssample_t *obuf, sox_size_t *isamp, sox_size_t *osamp)
{
biquad_t p = (biquad_t) effp->priv;
sox_size_t len = (*isamp > *osamp)? *osamp : *isamp;
--- a/src/biquad.h
+++ b/src/biquad.h
@@ -66,7 +66,7 @@
double b2, b1, b0; /* Filter coefficients */
double a2, a1, a0; /* Filter coefficients */
- sox_sample_t i1, i2; /* Filter memory */
+ sox_ssample_t i1, i2; /* Filter memory */
double o1, o2; /* Filter memory */
} * biquad_t;
@@ -78,7 +78,7 @@
int min_args, int max_args, int fc_pos, int width_pos, int gain_pos,
char const * allowed_width_types, filter_t filter_type);
int sox_biquad_start(eff_t effp);
-int sox_biquad_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+int sox_biquad_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp);
#undef sox_fail
--- a/src/cdr.c
+++ b/src/cdr.c
@@ -71,7 +71,7 @@
* Return number of samples read.
*/
-static sox_size_t sox_cdrread(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_cdrread(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
return sox_rawread(ft, buf, len);
@@ -107,7 +107,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_cdrwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_cdrwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
cdr_t cdr = (cdr_t) ft->priv;
--- a/src/chorus.c
+++ b/src/chorus.c
@@ -243,7 +243,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_chorus_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_chorus_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
chorus_t chorus = (chorus_t) effp->priv;
@@ -251,7 +251,7 @@
int i;
float d_in, d_out;
- sox_sample_t out;
+ sox_ssample_t out;
len = ((*isamp > *osamp) ? *osamp : *isamp);
for(done = 0; done < len; done++) {
@@ -265,7 +265,7 @@
chorus->maxsamples] * chorus->decay[i];
/* Adjust the output volume and size to 24 bit */
d_out = d_out * chorus->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delay and input */
chorus->chorusbuf[chorus->counter] = d_in;
@@ -282,7 +282,7 @@
/*
* Drain out reverb lines.
*/
-static int sox_chorus_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_chorus_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
chorus_t chorus = (chorus_t) effp->priv;
sox_size_t done;
@@ -289,7 +289,7 @@
int i;
float d_in, d_out;
- sox_sample_t out;
+ sox_ssample_t out;
done = 0;
while ( ( done < *osamp ) && ( done < chorus->fade_out ) ) {
@@ -302,7 +302,7 @@
chorus->maxsamples] * chorus->decay[i];
/* Adjust the output volume and size to 24 bit */
d_out = d_out * chorus->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delay and input */
chorus->chorusbuf[chorus->counter] = d_in;
--- a/src/compand.c
+++ b/src/compand.c
@@ -52,7 +52,7 @@
unsigned expectedChannels;/* Also flags that channels aren't to be treated
individually when = 1 and input not mono */
double delay; /* Delay to apply before companding */
- sox_sample_t *delay_buf; /* Old samples, used for delay processing */
+ sox_ssample_t *delay_buf; /* Old samples, used for delay processing */
sox_ssize_t delay_buf_size;/* Size of delay_buf in samples */
sox_ssize_t delay_buf_index; /* Index into delay_buf */
sox_ssize_t delay_buf_cnt; /* No. of active entries in delay_buf */
@@ -175,7 +175,7 @@
*v += delta * l->channels[chan].attack_times[1];
}
-static int flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
compand_t l = (compand_t) effp->priv;
@@ -236,7 +236,7 @@
return (SOX_SUCCESS);
}
-static int drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
compand_t l = (compand_t) effp->priv;
sox_size_t chan, done = 0;
--- a/src/cvsd.c
+++ b/src/cvsd.c
@@ -226,7 +226,7 @@
/* ---------------------------------------------------------------------- */
-static sox_size_t sox_cvsdread(ft_t ft, sox_sample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_cvsdread(ft_t ft, sox_ssample_t *buf, sox_size_t nsamp)
{
struct cvsdpriv *p = (struct cvsdpriv *) ft->priv;
sox_size_t done = 0;
@@ -282,7 +282,7 @@
/* ---------------------------------------------------------------------- */
-static sox_size_t sox_cvsdwrite(ft_t ft, const sox_sample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_cvsdwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t nsamp)
{
struct cvsdpriv *p = (struct cvsdpriv *) ft->priv;
sox_size_t done = 0;
--- a/src/dat.c
+++ b/src/dat.c
@@ -76,7 +76,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_datread(ft_t ft, sox_sample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_datread(ft_t ft, sox_ssample_t *buf, sox_size_t nsamp)
{
char inpstr[LINEWIDTH];
int inpPtr = 0;
@@ -123,7 +123,7 @@
return (done);
}
-static sox_size_t sox_datwrite(ft_t ft, const sox_sample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_datwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t nsamp)
{
dat_t dat = (dat_t) ft->priv;
sox_size_t done = 0;
--- a/src/dcshift.c
+++ b/src/dcshift.c
@@ -101,7 +101,7 @@
/*
* Process data.
*/
-static int sox_dcshift_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_dcshift_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
dcs_t dcs = (dcs_t) effp->priv;
--- a/src/dither.c
+++ b/src/dither.c
@@ -65,8 +65,8 @@
return SOX_EFF_NULL; /* Dithering not needed at >= 24 bits */
}
-static int flow(eff_t effp, const sox_sample_t * ibuf,
- sox_sample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
+static int flow(eff_t effp, const sox_ssample_t * ibuf,
+ sox_ssample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
{
dither_t dither = (dither_t)effp->priv;
sox_size_t len = min(*isamp, *osamp);
--- a/src/earwax.c
+++ b/src/earwax.c
@@ -31,7 +31,7 @@
/* A stereo fir filter. One side filters as if the signal was from
30 degrees from the ear, the other as if 330 degrees. */
/* 30 330 */
-static const sox_sample_t filt[] =
+static const sox_ssample_t filt[] =
{ 4, -6,
4, -11,
-1, -5,
@@ -69,7 +69,7 @@
#define EARWAX_NUMTAPS 64
typedef struct earwaxstuff {
- sox_sample_t *tap; /* taps are z^-1 delays for the FIR filter */
+ sox_ssample_t *tap; /* taps are z^-1 delays for the FIR filter */
} *earwax_t;
/*
@@ -87,7 +87,7 @@
}
/* allocate tap memory */
- earwax->tap = (sox_sample_t*)xmalloc( sizeof(sox_sample_t) * EARWAX_NUMTAPS );
+ earwax->tap = (sox_ssample_t*)xmalloc( sizeof(sox_ssample_t) * EARWAX_NUMTAPS );
/* zero out the delayed taps */
for(i=0; i < EARWAX_NUMTAPS; i++ ){
@@ -102,13 +102,13 @@
* Return number of samples processed.
*/
-static int sox_earwax_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_earwax_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
earwax_t earwax = (earwax_t) effp->priv;
int len, done;
int i;
- sox_sample_t output;
+ sox_ssample_t output;
len = ((*isamp > *osamp) ? *osamp : *isamp);
@@ -134,11 +134,11 @@
/*
* Drain out taps.
*/
-static int sox_earwax_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_earwax_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
earwax_t earwax = (earwax_t) effp->priv;
int i,j;
- sox_sample_t output;
+ sox_ssample_t output;
for(i = EARWAX_NUMTAPS-1; i >= 0; i--){
output = 0;
--- a/src/echo.c
+++ b/src/echo.c
@@ -180,7 +180,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_echo_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_echo_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
echo_t echo = (echo_t) effp->priv;
@@ -188,7 +188,7 @@
int j;
double d_in, d_out;
- sox_sample_t out;
+ sox_ssample_t out;
len = ((*isamp > *osamp) ? *osamp : *isamp);
for(done = 0; done < len; done++) {
@@ -203,7 +203,7 @@
}
/* Adjust the output volume and size to 24 bit */
d_out = d_out * echo->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Store input in delay buffer */
echo->delay_buf[echo->counter] = d_in;
@@ -217,11 +217,11 @@
/*
* Drain out reverb lines.
*/
-static int sox_echo_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_echo_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
echo_t echo = (echo_t) effp->priv;
double d_in, d_out;
- sox_sample_t out;
+ sox_ssample_t out;
int j;
sox_size_t done;
@@ -237,7 +237,7 @@
}
/* Adjust the output volume and size to 24 bit */
d_out = d_out * echo->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Store input in delay buffer */
echo->delay_buf[echo->counter] = d_in;
--- a/src/echos.c
+++ b/src/echos.c
@@ -172,7 +172,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_echos_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_echos_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
echos_t echos = (echos_t) effp->priv;
@@ -180,7 +180,7 @@
int j;
double d_in, d_out;
- sox_sample_t out;
+ sox_ssample_t out;
len = ((*isamp > *osamp) ? *osamp : *isamp);
for(done = 0; done < len; done++) {
@@ -193,7 +193,7 @@
}
/* Adjust the output volume and size to 24 bit */
d_out = d_out * echos->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delays and input */
for ( j = 0; j < echos->num_delays; j++ ) {
@@ -215,11 +215,11 @@
/*
* Drain out reverb lines.
*/
-static int sox_echos_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_echos_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
echos_t echos = (echos_t) effp->priv;
double d_in, d_out;
- sox_sample_t out;
+ sox_ssample_t out;
int j;
sox_size_t done;
@@ -233,7 +233,7 @@
}
/* Adjust the output volume and size to 24 bit */
d_out = d_out * echos->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delays and input */
for ( j = 0; j < echos->num_delays; j++ ) {
--- a/src/fade.c
+++ b/src/fade.c
@@ -197,13 +197,13 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_fade_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_fade_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
fade_t fade = (fade_t) effp->priv;
/* len is total samples, chcnt counts channels */
int len = 0, t_output = 1, more_output = 1;
- sox_sample_t t_ibuf;
+ sox_ssample_t t_ibuf;
sox_size_t chcnt = 0;
len = ((*isamp > *osamp) ? *osamp : *isamp);
@@ -278,7 +278,7 @@
/*
* Drain out remaining samples if the effect generates any.
*/
-static int sox_fade_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_fade_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
fade_t fade = (fade_t) effp->priv;
int len;
--- a/src/filter.c
+++ b/src/filter.c
@@ -35,8 +35,8 @@
/* Private data for Lerp via LCM file */
typedef struct filterstuff {
sox_rate_t rate;
- sox_sample_t freq0;/* low corner freq */
- sox_sample_t freq1;/* high corner freq */
+ sox_ssample_t freq0;/* low corner freq */
+ sox_ssample_t freq1;/* high corner freq */
double beta;/* >2 is kaiser window beta, <=2 selects nuttall window */
long Nwin;
double *Fp;/* [Xh+1] Filter coefficients */
@@ -114,7 +114,7 @@
f->rate = effp->ininfo.rate;
/* adjust upper frequency to Nyquist if necessary */
- if (f->freq1 > (sox_sample_t)f->rate/2 || f->freq1 <= 0)
+ if (f->freq1 > (sox_ssample_t)f->rate/2 || f->freq1 <= 0)
f->freq1 = f->rate/2;
if ((f->freq0 < 0) || (f->freq0 > f->freq1))
@@ -126,7 +126,7 @@
Xh = f->Nwin/2;
Fp0 = (double *) xmalloc(sizeof(double) * (Xh + 2)) + 1;
- if (f->freq0 > (sox_sample_t)f->rate/200) {
+ if (f->freq0 > (sox_ssample_t)f->rate/200) {
Xh0 = makeFilter(Fp0, Xh, 2.0*(double)f->freq0/f->rate, f->beta, 1, 0);
if (Xh0 <= 1)
{
@@ -138,7 +138,7 @@
}
Fp1 = (double *) xmalloc(sizeof(double) * (Xh + 2)) + 1;
/* need Fp[-1] and Fp[Xh] for makeFilter */
- if (f->freq1 < (sox_sample_t)f->rate/2) {
+ if (f->freq1 < (sox_ssample_t)f->rate/2) {
Xh1 = makeFilter(Fp1, Xh, 2.0*(double)f->freq1/f->rate, f->beta, 1, 0);
if (Xh1 <= 1)
{
@@ -182,7 +182,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_filter_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_filter_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
filter_t f = (filter_t) effp->priv;
@@ -235,11 +235,11 @@
/*
* Process tail of input samples.
*/
-static int sox_filter_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_filter_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
filter_t f = (filter_t) effp->priv;
long isamp_res, osamp_res;
- sox_sample_t *Obuf;
+ sox_ssample_t *Obuf;
sox_debug("Xh %d, Xt %d <--- DRAIN",f->Xh, f->Xt);
@@ -248,7 +248,7 @@
osamp_res = *osamp;
Obuf = obuf;
while (isamp_res>0 && osamp_res>0) {
- sox_sample_t Isamp, Osamp;
+ sox_ssample_t Isamp, Osamp;
Isamp = isamp_res;
Osamp = osamp_res;
sox_filter_flow(effp, NULL, Obuf, (sox_size_t *)&Isamp, (sox_size_t *)&Osamp);
--- a/src/flac.c
+++ b/src/flac.c
@@ -193,7 +193,7 @@
}
-static sox_size_t read(ft_t const format, sox_sample_t * sampleBuffer, sox_size_t const requested)
+static sox_size_t read(ft_t const format, sox_ssample_t * sampleBuffer, sox_size_t const requested)
{
Decoder * decoder = (Decoder *) format->priv;
size_t actual = 0;
@@ -447,7 +447,7 @@
-static sox_size_t write(ft_t const format, sox_sample_t const * const sampleBuffer, sox_size_t const len)
+static sox_size_t write(ft_t const format, sox_ssample_t const * const sampleBuffer, sox_size_t const len)
{
Encoder * encoder = (Encoder *) format->priv;
unsigned i;
--- a/src/flanger.c
+++ b/src/flanger.c
@@ -234,8 +234,8 @@
-static int sox_flanger_flow(eff_t effp, sox_sample_t const * ibuf,
- sox_sample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
+static int sox_flanger_flow(eff_t effp, sox_ssample_t const * ibuf,
+ sox_ssample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
{
flanger_t f = (flanger_t) effp->priv;
int c, channels = effp->ininfo.channels;
--- a/src/gsm.c
+++ b/src/gsm.c
@@ -105,7 +105,7 @@
* Return number of samples read.
*/
-static sox_size_t sox_gsmread(ft_t ft, sox_sample_t *buf, sox_size_t samp)
+static sox_size_t sox_gsmread(ft_t ft, sox_ssample_t *buf, sox_size_t samp)
{
size_t done = 0;
int r, ch, chans;
@@ -184,7 +184,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_gsmwrite(ft_t ft, const sox_sample_t *buf, sox_size_t samp)
+static sox_size_t sox_gsmwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t samp)
{
size_t done = 0;
struct gsmpriv *p = (struct gsmpriv *) ft->priv;
--- a/src/hcom.c
+++ b/src/hcom.c
@@ -149,7 +149,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_hcomread(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_hcomread(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
register struct readpriv *p = (struct readpriv *) ft->priv;
int done = 0;
@@ -264,10 +264,10 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_hcomwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_hcomwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
struct writepriv *p = (struct writepriv *) ft->priv;
- sox_sample_t datum;
+ sox_ssample_t datum;
sox_size_t i;
if (len == 0)
--- a/src/maud.c
+++ b/src/maud.c
@@ -232,7 +232,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_maudwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_maudwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
struct maudstuff * p = (struct maudstuff *) ft->priv;
--- a/src/mcompand.c
+++ b/src/mcompand.c
@@ -123,7 +123,7 @@
return (SOX_SUCCESS);
}
-static int lowpass_flow(eff_t effp, butterworth_crossover_t butterworth, sox_size_t nChan, sox_sample_t *ibuf, sox_sample_t *lowbuf, sox_sample_t *highbuf,
+static int lowpass_flow(eff_t effp, butterworth_crossover_t butterworth, sox_size_t nChan, sox_ssample_t *ibuf, sox_ssample_t *lowbuf, sox_ssample_t *highbuf,
sox_size_t len) {
sox_size_t chan;
double in, out;
@@ -130,7 +130,7 @@
sox_size_t done;
- sox_sample_t *ibufptr, *lowbufptr, *highbufptr;
+ sox_ssample_t *ibufptr, *lowbufptr, *highbufptr;
for (chan=0;chan<nChan;++chan) {
ibufptr = ibuf+chan;
@@ -200,7 +200,7 @@
double delay; /* Delay to apply before companding */
double topfreq; /* upper bound crossover frequency */
struct butterworth_crossover filter;
- sox_sample_t *delay_buf; /* Old samples, used for delay processing */
+ sox_ssample_t *delay_buf; /* Old samples, used for delay processing */
sox_size_t delay_size; /* lookahead for this band (in samples) - function of delay, above */
sox_ssize_t delay_buf_ptr; /* Index into delay_buf */
sox_size_t delay_buf_cnt; /* No. of active entries in delay_buf */
@@ -208,7 +208,7 @@
typedef struct {
sox_size_t nBands;
- sox_sample_t *band_buf1, *band_buf2, *band_buf3;
+ sox_ssample_t *band_buf1, *band_buf2, *band_buf3;
sox_size_t band_buf_len;
sox_size_t delay_buf_size;/* Size of delay_buf in samples */
struct comp_band *bands;
@@ -381,7 +381,7 @@
/* Allocate the delay buffer */
if (c->delay_buf_size > 0)
- l->delay_buf = (sox_sample_t *)xcalloc(sizeof(long), c->delay_buf_size);
+ l->delay_buf = (sox_ssample_t *)xcalloc(sizeof(long), c->delay_buf_size);
l->delay_buf_ptr = 0;
l->delay_buf_cnt = 0;
@@ -398,7 +398,7 @@
static void doVolume(double *v, double samp, comp_band_t l, sox_size_t chan)
{
- double s = samp/(~((sox_sample_t)1<<31));
+ double s = samp/(~((sox_ssample_t)1<<31));
double delta = s - *v;
if (delta > 0.0) /* increase volume according to attack rate */
@@ -407,7 +407,7 @@
*v += delta * l->decayRate[chan];
}
-static int sox_mcompand_flow_1(eff_t effp, compand_t c, comp_band_t l, const sox_sample_t *ibuf, sox_sample_t *obuf, sox_size_t len, sox_size_t filechans)
+static int sox_mcompand_flow_1(eff_t effp, compand_t c, comp_band_t l, const sox_ssample_t *ibuf, sox_ssample_t *obuf, sox_size_t len, sox_size_t filechans)
{
sox_size_t done, chan;
@@ -477,24 +477,24 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_mcompand_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_mcompand_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp) {
compand_t c = (compand_t) effp->priv;
comp_band_t l;
sox_size_t len = min(*isamp, *osamp);
sox_size_t band, i;
- sox_sample_t *abuf, *bbuf, *cbuf, *oldabuf, *ibuf_copy;
+ sox_ssample_t *abuf, *bbuf, *cbuf, *oldabuf, *ibuf_copy;
double out;
if (c->band_buf_len < len) {
- c->band_buf1 = (sox_sample_t *)xrealloc(c->band_buf1,len*sizeof(sox_sample_t));
- c->band_buf2 = (sox_sample_t *)xrealloc(c->band_buf2,len*sizeof(sox_sample_t));
- c->band_buf3 = (sox_sample_t *)xrealloc(c->band_buf3,len*sizeof(sox_sample_t));
+ c->band_buf1 = (sox_ssample_t *)xrealloc(c->band_buf1,len*sizeof(sox_ssample_t));
+ c->band_buf2 = (sox_ssample_t *)xrealloc(c->band_buf2,len*sizeof(sox_ssample_t));
+ c->band_buf3 = (sox_ssample_t *)xrealloc(c->band_buf3,len*sizeof(sox_ssample_t));
c->band_buf_len = len;
}
- ibuf_copy = (sox_sample_t *)xmalloc(*isamp * sizeof(sox_sample_t));
- memcpy(ibuf_copy, ibuf, *isamp * sizeof(sox_sample_t));
+ ibuf_copy = (sox_ssample_t *)xmalloc(*isamp * sizeof(sox_ssample_t));
+ memcpy(ibuf_copy, ibuf, *isamp * sizeof(sox_ssample_t));
/* split ibuf into bands using butterworths, pipe each band through sox_mcompand_flow_1, then add back together and write to obuf */
@@ -529,7 +529,7 @@
return SOX_SUCCESS;
}
-static int sox_mcompand_drain_1(eff_t effp, compand_t c, comp_band_t l, sox_sample_t *obuf, sox_size_t maxdrain)
+static int sox_mcompand_drain_1(eff_t effp, compand_t c, comp_band_t l, sox_ssample_t *obuf, sox_size_t maxdrain)
{
sox_size_t done;
double out;
@@ -553,7 +553,7 @@
/*
* Drain out compander delay lines.
*/
-static int sox_mcompand_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_mcompand_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
sox_size_t band, drained, mostdrained = 0;
compand_t c = (compand_t)effp->priv;
--- a/src/misc.c
+++ b/src/misc.c
@@ -308,8 +308,8 @@
/* dummy format routines for do-nothing functions */
int sox_format_nothing(ft_t ft UNUSED) { return(SOX_SUCCESS); }
-sox_size_t sox_format_nothing_read(ft_t ft UNUSED, sox_sample_t *buf UNUSED, sox_size_t len UNUSED) { return(0); }
-sox_size_t sox_format_nothing_write(ft_t ft UNUSED, const sox_sample_t *buf UNUSED, sox_size_t len UNUSED) { return(0); }
+sox_size_t sox_format_nothing_read(ft_t ft UNUSED, sox_ssample_t *buf UNUSED, sox_size_t len UNUSED) { return(0); }
+sox_size_t sox_format_nothing_write(ft_t ft UNUSED, const sox_ssample_t *buf UNUSED, sox_size_t len UNUSED) { return(0); }
int sox_format_nothing_seek(ft_t ft UNUSED, sox_size_t offset UNUSED) { sox_fail_errno(ft, SOX_ENOTSUP, "operation not supported"); return(SOX_EOF); }
/* dummy effect routine for do-nothing functions */
@@ -318,15 +318,15 @@
return SOX_SUCCESS;
}
-int sox_effect_nothing_flow(eff_t effp UNUSED, const sox_sample_t *ibuf UNUSED, sox_sample_t *obuf UNUSED, sox_size_t *isamp, sox_size_t *osamp)
+int sox_effect_nothing_flow(eff_t effp UNUSED, const sox_ssample_t *ibuf UNUSED, sox_ssample_t *obuf UNUSED, sox_size_t *isamp, sox_size_t *osamp)
{
/* Pass through samples verbatim */
*isamp = *osamp = min(*isamp, *osamp);
- memcpy(obuf, ibuf, *isamp * sizeof(sox_sample_t));
+ memcpy(obuf, ibuf, *isamp * sizeof(sox_ssample_t));
return SOX_SUCCESS;
}
-int sox_effect_nothing_drain(eff_t effp UNUSED, sox_sample_t *obuf UNUSED, sox_size_t *osamp)
+int sox_effect_nothing_drain(eff_t effp UNUSED, sox_ssample_t *obuf UNUSED, sox_size_t *osamp)
{
/* Inform no more samples to drain */
*osamp = 0;
@@ -344,7 +344,7 @@
/* here for linear interp. might be useful for other things */
-sox_sample_t sox_gcd(sox_sample_t a, sox_sample_t b)
+sox_ssample_t sox_gcd(sox_ssample_t a, sox_ssample_t b)
{
if (b == 0)
return a;
@@ -352,7 +352,7 @@
return sox_gcd(b, a % b);
}
-sox_sample_t sox_lcm(sox_sample_t a, sox_sample_t b)
+sox_ssample_t sox_lcm(sox_ssample_t a, sox_ssample_t b)
{
/* parenthesize this way to avoid sox_sample_t overflow in product term */
return a * (b / sox_gcd(a, b));
--- a/src/mixer.c
+++ b/src/mixer.c
@@ -517,7 +517,7 @@
* Process either isamp or osamp samples, whichever is smaller.
*/
-static int flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
mixer_t mixer = (mixer_t) effp->priv;
--- a/src/mp3.c
+++ b/src/mp3.c
@@ -263,7 +263,7 @@
* Place in buf[].
* Return number of samples read.
*/
-static sox_size_t sox_mp3read(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_mp3read(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
struct mp3priv *p = (struct mp3priv *) ft->priv;
sox_size_t donow,i,done=0;
@@ -280,7 +280,7 @@
sample=-MAD_F_ONE;
else if (sample >= MAD_F_ONE)
sample=MAD_F_ONE-1;
- *buf++=(sox_sample_t)(sample<<(32-1-MAD_F_FRACBITS));
+ *buf++=(sox_ssample_t)(sample<<(32-1-MAD_F_FRACBITS));
i++;
}
p->cursamp++;
@@ -416,7 +416,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_mp3write(ft_t ft, const sox_sample_t *buf, sox_size_t samp)
+static sox_size_t sox_mp3write(ft_t ft, const sox_ssample_t *buf, sox_size_t samp)
{
struct mp3priv *p = (struct mp3priv *)ft->priv;
char *mp3buffer;
--- a/src/noiseprof.c
+++ b/src/noiseprof.c
@@ -109,7 +109,7 @@
/*
* Grab what we can from ibuf, and process if we have a whole window.
*/
-static int sox_noiseprof_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_noiseprof_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
profdata_t data = (profdata_t) effp->priv;
@@ -151,7 +151,7 @@
* Finish off the last window.
*/
-static int sox_noiseprof_drain(eff_t effp, sox_sample_t *obuf UNUSED, sox_size_t *osamp)
+static int sox_noiseprof_drain(eff_t effp, sox_ssample_t *obuf UNUSED, sox_size_t *osamp)
{
profdata_t data = (profdata_t) effp->priv;
int tracks = effp->ininfo.channels;
--- a/src/noisered.c
+++ b/src/noisered.c
@@ -206,7 +206,7 @@
/* Do window management once we have a complete window, including mangling
* the current window. */
static int process_window(eff_t effp, reddata_t data, unsigned chan_num, unsigned num_chans,
- sox_sample_t *obuf, unsigned len) {
+ sox_ssample_t *obuf, unsigned len) {
int j;
float* nextwindow;
int use = min(len, WINDOWSIZE)-min(len,(WINDOWSIZE/2));
@@ -243,7 +243,7 @@
/*
* Read in windows, and call process_window once we get a whole one.
*/
-static int sox_noisered_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_noisered_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
reddata_t data = (reddata_t) effp->priv;
@@ -293,7 +293,7 @@
* We have up to half a window left to dump.
*/
-static int sox_noisered_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_noisered_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
reddata_t data = (reddata_t)effp->priv;
unsigned i;
--- a/src/nulfile.c
+++ b/src/nulfile.c
@@ -29,14 +29,14 @@
return SOX_SUCCESS;
}
-static sox_size_t sox_nulread(ft_t ft UNUSED, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_nulread(ft_t ft UNUSED, sox_ssample_t *buf, sox_size_t len)
{
/* Reading from null generates silence i.e. (sox_sample_t)0. */
- memset(buf, 0, sizeof(sox_sample_t) * len);
+ memset(buf, 0, sizeof(sox_ssample_t) * len);
return len; /* Return number of samples "read". */
}
-static sox_size_t sox_nulwrite(ft_t ft UNUSED, const sox_sample_t *buf UNUSED, sox_size_t len)
+static sox_size_t sox_nulwrite(ft_t ft UNUSED, const sox_ssample_t *buf UNUSED, sox_size_t len)
{
/* Writing to null just discards the samples */
return len; /* Return number of samples "written". */
--- a/src/pad.c
+++ b/src/pad.c
@@ -82,7 +82,7 @@
return SOX_EFF_NULL;
}
-static int flow(eff_t effp, const sox_sample_t * ibuf, sox_sample_t * obuf,
+static int flow(eff_t effp, const sox_ssample_t * ibuf, sox_ssample_t * obuf,
sox_size_t * isamp, sox_size_t * osamp)
{
pad_t p = (pad_t) effp->priv;
@@ -111,7 +111,7 @@
return SOX_SUCCESS;
}
-static int drain(eff_t effp, sox_sample_t * obuf, sox_size_t * osamp)
+static int drain(eff_t effp, sox_ssample_t * obuf, sox_size_t * osamp)
{
static sox_size_t isamp = 0;
pad_t p = (pad_t) effp->priv;
--- a/src/pan.c
+++ b/src/pan.c
@@ -73,17 +73,17 @@
/*
* Process either isamp or osamp samples, whichever is smaller.
*/
-static int sox_pan_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_pan_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
pan_t pan = (pan_t) effp->priv;
sox_size_t len, done;
- sox_sample_t *ibuf_copy;
+ sox_ssample_t *ibuf_copy;
char ich, och;
double left, right, dir, hdir;
- ibuf_copy = (sox_sample_t *)xmalloc(*isamp * sizeof(sox_sample_t));
- memcpy(ibuf_copy, ibuf, *isamp * sizeof(sox_sample_t));
+ ibuf_copy = (sox_ssample_t *)xmalloc(*isamp * sizeof(sox_ssample_t));
+ memcpy(ibuf_copy, ibuf, *isamp * sizeof(sox_ssample_t));
dir = pan->dir; /* -1 <= dir <= 1 */
hdir = 0.5 * dir; /* -0.5 <= hdir <= 0.5 */
--- a/src/phaser.c
+++ b/src/phaser.c
@@ -179,7 +179,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_phaser_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_phaser_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
phaser_t phaser = (phaser_t) effp->priv;
@@ -186,7 +186,7 @@
int len, done;
double d_in, d_out;
- sox_sample_t out;
+ sox_ssample_t out;
len = ((*isamp > *osamp) ? *osamp : *isamp);
for(done = 0; done < len; done++) {
@@ -199,7 +199,7 @@
phaser->maxsamples] * phaser->decay * -1.0;
/* Adjust the output volume and size to 24 bit */
d_out = d_in * phaser->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delay and input */
phaser->phaserbuf[phaser->counter] = d_in;
@@ -214,13 +214,13 @@
/*
* Drain out reverb lines.
*/
-static int sox_phaser_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_phaser_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
phaser_t phaser = (phaser_t) effp->priv;
sox_size_t done;
double d_in, d_out;
- sox_sample_t out;
+ sox_ssample_t out;
done = 0;
while ( ( done < *osamp ) && ( done < phaser->fade_out ) ) {
@@ -232,7 +232,7 @@
phaser->maxsamples] * phaser->decay * -1.0;
/* Adjust the output volume and size to 24 bit */
d_out = d_in * phaser->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delay and input */
phaser->phaserbuf[phaser->counter] = d_in;
--- a/src/pitch.c
+++ b/src/pitch.c
@@ -104,7 +104,7 @@
sox_size_t size; /* size of buffer for processing chunks. */
unsigned int index; /* index of next empty input item. */
- sox_sample_t *buf; /* bufferize input */
+ sox_ssample_t *buf; /* bufferize input */
pitch_state_t state; /* buffer management status. */
@@ -169,7 +169,7 @@
*/
static void interpolation(
pitch_t pitch,
- const sox_sample_t *ibuf, sox_size_t ilen,
+ const sox_ssample_t *ibuf, sox_size_t ilen,
double * out, sox_size_t olen,
double rate) /* signed */
{
@@ -379,7 +379,7 @@
pitch->fade = (double *) xmalloc(pitch->step*sizeof(double));
pitch->tmp = (double *) xmalloc(pitch->step*sizeof(double));
pitch->acc = (double *) xmalloc(pitch->step*sizeof(double));
- pitch->buf = (sox_sample_t *) xmalloc(pitch->size*sizeof(sox_sample_t));
+ pitch->buf = (sox_ssample_t *) xmalloc(pitch->size*sizeof(sox_ssample_t));
pitch->index = pitch->overlap;
/* default initial signal */
@@ -441,7 +441,7 @@
/* Processes input.
*/
-static int sox_pitch_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_pitch_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
pitch_t pitch = (pitch_t) effp->priv;
@@ -466,7 +466,7 @@
{
register int tocopy = min(pitch->size-pitch->index, len);
- memcpy(pitch->buf+pitch->index, ibuf+iindex, tocopy*sizeof(sox_sample_t));
+ memcpy(pitch->buf+pitch->index, ibuf+iindex, tocopy*sizeof(sox_ssample_t));
len -= tocopy;
pitch->index += tocopy;
@@ -518,7 +518,7 @@
/* at the end...
*/
-static int sox_pitch_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_pitch_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
pitch_t pitch = (pitch_t) effp->priv;
sox_size_t i;
--- a/src/polyphas.c
+++ b/src/polyphas.c
@@ -351,8 +351,8 @@
if (effp->ininfo.rate == effp->outinfo.rate)
return SOX_EFF_NULL;
- rate->lcmrate = sox_lcm((sox_sample_t)effp->ininfo.rate,
- (sox_sample_t)effp->outinfo.rate);
+ rate->lcmrate = sox_lcm((sox_ssample_t)effp->ininfo.rate,
+ (sox_ssample_t)effp->outinfo.rate);
/* Cursory check for LCM overflow.
* If both rates are below 65k, there should be no problem.
@@ -488,7 +488,7 @@
}
-static int sox_poly_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_poly_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
poly_t rate = (poly_t) effp->priv;
@@ -548,7 +548,7 @@
}
{
- sox_sample_t *q;
+ sox_ssample_t *q;
sox_size_t out_size;
sox_size_t oskip;
Float *out_buf;
@@ -591,7 +591,7 @@
/*
* Process tail of input samples.
*/
-static int sox_poly_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_poly_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
sox_size_t in_size;
/* Call "flow" with NULL input. */
--- a/src/prc.c
+++ b/src/prc.c
@@ -257,7 +257,7 @@
return a;
}
-static sox_size_t read(ft_t ft, sox_sample_t *buf, sox_size_t samp)
+static sox_size_t read(ft_t ft, sox_ssample_t *buf, sox_size_t samp)
{
prc_t p = (prc_t)ft->priv;
@@ -387,7 +387,7 @@
}
}
-static sox_size_t write(ft_t ft, const sox_sample_t *buf, sox_size_t samp)
+static sox_size_t write(ft_t ft, const sox_ssample_t *buf, sox_size_t samp)
{
prc_t p = (prc_t)ft->priv;
/* Psion Record seems not to be able to handle frames > 800 samples */
--- a/src/rabbit.c
+++ b/src/rabbit.c
@@ -111,7 +111,7 @@
/*
* Read all the data.
*/
-static int sox_rabbit_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf UNUSED,
+static int sox_rabbit_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf UNUSED,
sox_size_t *isamp, sox_size_t *osamp)
{
rabbit_t r = (rabbit_t) effp->priv;
@@ -141,7 +141,7 @@
/*
* Process samples and write output.
*/
-static int sox_rabbit_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_rabbit_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
rabbit_t r = (rabbit_t) effp->priv;
int channels = effp->ininfo.channels;
--- a/src/rate.c
+++ b/src/rate.c
@@ -9,9 +9,9 @@
int sox_resample_getopts(eff_t effp, int n, char **argv);
int sox_resample_start(eff_t effp);
-int sox_resample_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+int sox_resample_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp);
-int sox_resample_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp);
+int sox_resample_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp);
int sox_resample_stop(eff_t effp);
static sox_effect_t sox_rate_effect = {
--- a/src/raw.c
+++ b/src/raw.c
@@ -95,7 +95,7 @@
#define READ_SAMPLES_FUNC(type, size, sign, ctype, cast) \
sox_size_t sox_read_ ## sign ## type ## _samples( \
- ft_t ft, sox_sample_t *buf, sox_size_t len) \
+ ft_t ft, sox_ssample_t *buf, sox_size_t len) \
{ \
sox_size_t n, nread; \
ctype *data = xmalloc(sizeof(ctype) * len); \
@@ -122,7 +122,7 @@
#define WRITE_SAMPLES_FUNC(type, size, sign, ctype, cast) \
sox_size_t sox_write_ ## sign ## type ## _samples( \
- ft_t ft, sox_sample_t *buf, sox_size_t len) \
+ ft_t ft, sox_ssample_t *buf, sox_size_t len) \
{ \
sox_size_t n, nwritten; \
ctype *data = xmalloc(sizeof(ctype) * len); \
@@ -147,7 +147,7 @@
static WRITE_SAMPLES_FUNC(f, sizeof(float), su, float, SOX_SAMPLE_TO_FLOAT_DWORD)
static WRITE_SAMPLES_FUNC(df, sizeof(double), su, double, SOX_SAMPLE_TO_FLOAT_DDWORD)
-typedef sox_size_t (ft_io_fun)(ft_t ft, sox_sample_t *buf, sox_size_t len);
+typedef sox_size_t (ft_io_fun)(ft_t ft, sox_ssample_t *buf, sox_size_t len);
static ft_io_fun *check_format(ft_t ft, sox_bool write)
{
@@ -221,7 +221,7 @@
}
/* Read a stream of some type into SoX's internal buffer format. */
-sox_size_t sox_rawread(ft_t ft, sox_sample_t *buf, sox_size_t nsamp)
+sox_size_t sox_rawread(ft_t ft, sox_ssample_t *buf, sox_size_t nsamp)
{
ft_io_fun * read_buf = check_format(ft, sox_false);
@@ -232,12 +232,12 @@
}
/* Writes SoX's internal buffer format to buffer of various data types. */
-sox_size_t sox_rawwrite(ft_t ft, const sox_sample_t *buf, sox_size_t nsamp)
+sox_size_t sox_rawwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t nsamp)
{
ft_io_fun *write_buf = check_format(ft, sox_true);
if (write_buf && nsamp)
- return write_buf(ft, (sox_sample_t *)buf, nsamp);
+ return write_buf(ft, (sox_ssample_t *)buf, nsamp);
return 0;
}
--- a/src/repeat.c
+++ b/src/repeat.c
@@ -72,12 +72,12 @@
return (SOX_SUCCESS);
}
-static int sox_repeat_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf UNUSED,
+static int sox_repeat_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf UNUSED,
sox_size_t *isamp, sox_size_t *osamp)
{
repeat_t repeat = (repeat_t)effp->priv;
- if (fwrite((char *)ibuf, sizeof(sox_sample_t), *isamp, repeat->fp) !=
+ if (fwrite((char *)ibuf, sizeof(sox_ssample_t), *isamp, repeat->fp) !=
*isamp) {
sox_fail("repeat: write error on temporary file");
return (SOX_EOF);
@@ -88,10 +88,10 @@
return (SOX_SUCCESS);
}
-static int sox_repeat_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_repeat_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
size_t read = 0;
- sox_sample_t *buf;
+ sox_ssample_t *buf;
sox_size_t samp;
sox_size_t done;
@@ -103,12 +103,12 @@
fseeko(repeat->fp, (off_t)0, SEEK_END);
repeat->total = ftello(repeat->fp);
- if ((repeat->total % sizeof(sox_sample_t)) != 0) {
+ if ((repeat->total % sizeof(sox_ssample_t)) != 0) {
sox_fail("repeat: corrupted temporary file");
return (SOX_EOF);
}
- repeat->total /= sizeof(sox_sample_t);
+ repeat->total /= sizeof(sox_ssample_t);
repeat->remaining = repeat->total;
fseeko(repeat->fp, (off_t)0, SEEK_SET);
@@ -128,7 +128,7 @@
buf = obuf;
samp = repeat->remaining;
- read = fread((char *)buf, sizeof(sox_sample_t), samp,
+ read = fread((char *)buf, sizeof(sox_ssample_t), samp,
repeat->fp);
if (read != samp) {
perror(strerror(errno));
@@ -154,7 +154,7 @@
repeat->remaining = repeat->total - samp;
- read = fread((char *)buf, sizeof(sox_sample_t), samp,
+ read = fread((char *)buf, sizeof(sox_ssample_t), samp,
repeat->fp);
if (read != samp) {
perror(strerror(errno));
@@ -170,7 +170,7 @@
*osamp = done;
}
else {
- read = fread((char *)obuf, sizeof(sox_sample_t), *osamp,
+ read = fread((char *)obuf, sizeof(sox_ssample_t), *osamp,
repeat->fp);
if (read != *osamp) {
perror(strerror(errno));
--- a/src/resample.c
+++ b/src/resample.c
@@ -280,7 +280,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-int sox_resample_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+int sox_resample_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
resample_t r = (resample_t) effp->priv;
@@ -385,11 +385,11 @@
/*
* Process tail of input samples.
*/
-int sox_resample_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+int sox_resample_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
resample_t r = (resample_t) effp->priv;
long isamp_res, osamp_res;
- sox_sample_t *Obuf;
+ sox_ssample_t *Obuf;
int rc;
sox_debug("Xoff %d <--- DRAIN",r->Xoff);
@@ -399,7 +399,7 @@
osamp_res = *osamp;
Obuf = obuf;
while (isamp_res>0 && osamp_res>0) {
- sox_sample_t Isamp, Osamp;
+ sox_ssample_t Isamp, Osamp;
Isamp = isamp_res;
Osamp = osamp_res;
rc = sox_resample_flow(effp, NULL, Obuf, (sox_size_t *)&Isamp, (sox_size_t *)&Osamp);
--- a/src/reverb.c
+++ b/src/reverb.c
@@ -109,7 +109,7 @@
float in_gain, out_gain, time;
float delay[MAXREVERBS], decay[MAXREVERBS];
size_t samples[MAXREVERBS], maxsamples;
- sox_sample_t pl, ppl, pppl;
+ sox_ssample_t pl, ppl, pppl;
} *reverb_t;
/*
@@ -203,7 +203,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_reverb_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_reverb_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
reverb_t reverb = (reverb_t) effp->priv;
@@ -211,7 +211,7 @@
size_t i, j;
float d_in, d_out;
- sox_sample_t out;
+ sox_ssample_t out;
i = reverb->counter;
len = ((*isamp > *osamp) ? *osamp : *isamp);
@@ -224,7 +224,7 @@
d_in +=
reverb->reverbbuf[(i + reverb->maxsamples - reverb->samples[j]) % reverb->maxsamples] * reverb->decay[j];
d_out = d_in * reverb->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
*obuf++ = out * 256;
reverb->reverbbuf[i] = d_in;
i++; /* XXX need a % maxsamples here ? */
@@ -238,11 +238,11 @@
/*
* Drain out reverb lines.
*/
-static int sox_reverb_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_reverb_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
reverb_t reverb = (reverb_t) effp->priv;
float d_in, d_out;
- sox_sample_t out, l;
+ sox_ssample_t out, l;
size_t i, j;
sox_size_t done;
@@ -256,10 +256,10 @@
d_in +=
reverb->reverbbuf[(i + reverb->maxsamples - reverb->samples[j]) % reverb->maxsamples] * reverb->decay[j];
d_out = d_in * reverb->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
obuf[done++] = out * 256;
reverb->reverbbuf[i] = d_in;
- l = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_in, effp->clips);
+ l = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_in, effp->clips);
reverb->pppl = reverb->ppl;
reverb->ppl = reverb->pl;
reverb->pl = l;
--- a/src/reverse.c
+++ b/src/reverse.c
@@ -53,7 +53,7 @@
* Effect flow: a degenerate case: write input samples on temporary file,
* don't generate any output samples.
*/
-static int sox_reverse_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf UNUSED,
+static int sox_reverse_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf UNUSED,
sox_size_t *isamp, sox_size_t *osamp)
{
reverse_t reverse = (reverse_t) effp->priv;
@@ -63,7 +63,7 @@
sox_fail("Internal error: reverse_flow called in wrong phase");
return(SOX_EOF);
}
- if (fwrite((char *)ibuf, sizeof(sox_sample_t), *isamp, reverse->fp)
+ if (fwrite((char *)ibuf, sizeof(sox_ssample_t), *isamp, reverse->fp)
!= *isamp)
{
sox_fail("Reverse effect write error on temporary file");
@@ -77,18 +77,18 @@
* Effect drain: generate the actual samples in reverse order.
*/
-static int sox_reverse_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_reverse_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
reverse_t reverse = (reverse_t) effp->priv;
sox_size_t len, nbytes;
register int i, j;
- sox_sample_t temp;
+ sox_ssample_t temp;
if (reverse->phase == WRITING) {
fflush(reverse->fp);
fseeko(reverse->fp, (off_t)0, SEEK_END);
reverse->pos = ftello(reverse->fp);
- if (reverse->pos % sizeof(sox_sample_t) != 0)
+ if (reverse->pos % sizeof(sox_ssample_t) != 0)
{
sox_fail("Reverse effect finds odd temporary file");
return(SOX_EOF);
@@ -96,14 +96,14 @@
reverse->phase = READING;
}
len = *osamp;
- nbytes = len * sizeof(sox_sample_t);
+ nbytes = len * sizeof(sox_ssample_t);
if (reverse->pos < nbytes) {
nbytes = reverse->pos;
- len = nbytes / sizeof(sox_sample_t);
+ len = nbytes / sizeof(sox_ssample_t);
}
reverse->pos -= nbytes;
fseeko(reverse->fp, reverse->pos, SEEK_SET);
- if (fread((char *)obuf, sizeof(sox_sample_t), len, reverse->fp) != len)
+ if (fread((char *)obuf, sizeof(sox_ssample_t), len, reverse->fp) != len)
{
sox_fail("Reverse effect read error from temporary file");
return(SOX_EOF);
--- a/src/silence.c
+++ b/src/silence.c
@@ -38,7 +38,7 @@
char start_unit; /* "d" for decibels or "%" for percent. */
int restart;
- sox_sample_t *start_holdoff;
+ sox_ssample_t *start_holdoff;
sox_size_t start_holdoff_offset;
sox_size_t start_holdoff_end;
int start_found_periods;
@@ -50,7 +50,7 @@
double stop_threshold;
char stop_unit;
- sox_sample_t *stop_holdoff;
+ sox_ssample_t *stop_holdoff;
sox_size_t stop_holdoff_offset;
sox_size_t stop_holdoff_end;
int stop_found_periods;
@@ -290,12 +290,12 @@
else
silence->mode = SILENCE_COPY;
- silence->start_holdoff = (sox_sample_t *)xmalloc(sizeof(sox_sample_t)*silence->start_duration);
+ silence->start_holdoff = (sox_ssample_t *)xmalloc(sizeof(sox_ssample_t)*silence->start_duration);
silence->start_holdoff_offset = 0;
silence->start_holdoff_end = 0;
silence->start_found_periods = 0;
- silence->stop_holdoff = (sox_sample_t *)xmalloc(sizeof(sox_sample_t)*silence->stop_duration);
+ silence->stop_holdoff = (sox_ssample_t *)xmalloc(sizeof(sox_ssample_t)*silence->stop_duration);
silence->stop_holdoff_offset = 0;
silence->stop_holdoff_end = 0;
silence->stop_found_periods = 0;
@@ -303,11 +303,11 @@
return(SOX_SUCCESS);
}
-static int aboveThreshold(eff_t effp, sox_sample_t value, double threshold, int unit)
+static int aboveThreshold(eff_t effp, sox_ssample_t value, double threshold, int unit)
{
double ratio;
int rc;
- sox_sample_t dummy_clipped_count = 0;
+ sox_ssample_t dummy_clipped_count = 0;
/* When scaling low bit data, noise values got scaled way up */
/* Only consider the original bits when looking for silence */
@@ -342,11 +342,11 @@
return rc;
}
-static sox_sample_t compute_rms(eff_t effp, sox_sample_t sample)
+static sox_ssample_t compute_rms(eff_t effp, sox_ssample_t sample)
{
silence_t silence = (silence_t) effp->priv;
double new_sum;
- sox_sample_t rms;
+ sox_ssample_t rms;
new_sum = silence->rms_sum;
new_sum -= *silence->window_current;
@@ -357,7 +357,7 @@
return (rms);
}
-static void update_rms(eff_t effp, sox_sample_t sample)
+static void update_rms(eff_t effp, sox_ssample_t sample)
{
silence_t silence = (silence_t) effp->priv;
@@ -372,7 +372,7 @@
/* Process signed long samples from ibuf to obuf. */
/* Return number of samples processed in isamp and osamp. */
-static int sox_silence_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_silence_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
silence_t silence = (silence_t) effp->priv;
@@ -619,7 +619,7 @@
else /* !(silence->stop) */
{
/* Case B */
- memcpy(obuf, ibuf, sizeof(sox_sample_t)*nrOfTicks*
+ memcpy(obuf, ibuf, sizeof(sox_ssample_t)*nrOfTicks*
effp->ininfo.channels);
nrOfInSamplesRead += (nrOfTicks*effp->ininfo.channels);
nrOfOutSamplesWritten += (nrOfTicks*effp->ininfo.channels);
@@ -659,7 +659,7 @@
return (SOX_SUCCESS);
}
-static int sox_silence_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_silence_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
silence_t silence = (silence_t) effp->priv;
sox_size_t i;
--- a/src/skeleff.c
+++ b/src/skeleff.c
@@ -64,7 +64,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
skeleff_t skeleff = (skeleff_t)effp->priv;
@@ -97,7 +97,7 @@
/*
* Drain out remaining samples if the effect generates any.
*/
-static int drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
*osamp = 0;
/* Help out application and return SOX_EOF when drain
--- a/src/skelform.c
+++ b/src/skelform.c
@@ -84,7 +84,7 @@
* Read up to len samples of type sox_sample_t from file into buf[].
* Return number of samples read, or 0 if at end of file.
*/
-static sox_size_t read(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t read(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
skelform_t sk = (skelform_t)ft->priv;
sox_size_t done;
@@ -159,7 +159,7 @@
* Write len samples of type sox_sample_t from buf[] to file.
* Return number of samples written.
*/
-static sox_size_t write(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t write(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
skelform_t sk = (skelform_t)ft->priv;
--- a/src/smp.c
+++ b/src/smp.c
@@ -319,7 +319,7 @@
* Place in buf[].
* Return number of samples read.
*/
-static sox_size_t sox_smpread(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_smpread(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
smp_t smp = (smp_t) ft->priv;
unsigned short datum;
@@ -367,7 +367,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_smpwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_smpwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
smp_t smp = (smp_t) ft->priv;
int datum;
--- a/src/sndfile.c
+++ b/src/sndfile.c
@@ -135,7 +135,7 @@
* Read up to len samples of type sox_sample_t from file into buf[].
* Return number of samples read.
*/
-sox_size_t sox_sndfile_read(ft_t ft, sox_sample_t *buf, sox_size_t len)
+sox_size_t sox_sndfile_read(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
sndfile_t sf = (sndfile_t)ft->priv;
@@ -321,7 +321,7 @@
* Write len samples of type sox_sample_t from buf[] to file.
* Return number of samples written.
*/
-sox_size_t sox_sndfile_write(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+sox_size_t sox_sndfile_write(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
sndfile_t sf = (sndfile_t)ft->priv;
--- a/src/sndrtool.c
+++ b/src/sndrtool.c
@@ -149,7 +149,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_sndtwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_sndtwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
snd_t p = (snd_t ) ft->priv;
p->nsamples += len;
--- a/src/sox.c
+++ b/src/sox.c
@@ -77,7 +77,7 @@
static unsigned long read_wide_samples = 0;
static unsigned long output_samples = 0;
-static sox_sample_t *ibufl, *ibufr, *obufl, *obufr; /* Left/right interleave buffers */
+static sox_ssample_t *ibufl, *ibufr, *obufl, *obufr; /* Left/right interleave buffers */
typedef struct file_info
{
@@ -467,10 +467,10 @@
parse_options_and_filenames(argc, argv);
/* Allocate buffers, size of which may have been set by --buffer */
- ibufl = xcalloc(sox_bufsiz / 2, sizeof(sox_sample_t));
- obufl = xcalloc(sox_bufsiz / 2, sizeof(sox_sample_t));
- ibufr = xcalloc(sox_bufsiz / 2, sizeof(sox_sample_t));
- obufr = xcalloc(sox_bufsiz / 2, sizeof(sox_sample_t));
+ ibufl = xcalloc(sox_bufsiz / 2, sizeof(sox_ssample_t));
+ obufl = xcalloc(sox_bufsiz / 2, sizeof(sox_ssample_t));
+ ibufr = xcalloc(sox_bufsiz / 2, sizeof(sox_ssample_t));
+ obufr = xcalloc(sox_bufsiz / 2, sizeof(sox_ssample_t));
/* Make sure we got at least the required # of input filenames */
input_count = file_count ? file_count - 1 : 0;
@@ -995,7 +995,7 @@
files[i]->desc->signal.rate == files[i - 1]->desc->signal.rate;
}
-static sox_size_t sox_read_wide(ft_t desc, sox_sample_t * buf)
+static sox_size_t sox_read_wide(ft_t desc, sox_ssample_t * buf)
{
sox_size_t len = sox_bufsiz / combiner.channels;
len = sox_read(desc, buf, len * desc->signal.channels) / desc->signal.channels;
@@ -1004,7 +1004,7 @@
return len;
}
-static void balance_input(sox_sample_t * buf, sox_size_t ws, file_t f)
+static void balance_input(sox_ssample_t * buf, sox_size_t ws, file_t f)
{
sox_size_t s = ws * f->desc->signal.channels;
@@ -1023,7 +1023,7 @@
int flowstatus = 0;
sox_size_t e, ws, s, i;
sox_size_t ilen[MAX_INPUT_FILES];
- sox_sample_t *ibuf[MAX_INPUT_FILES];
+ sox_ssample_t *ibuf[MAX_INPUT_FILES];
combiner = files[current_input]->desc->signal;
if (combine_method == SOX_sequence) {
@@ -1127,9 +1127,9 @@
/* Allocate output buffers for effects */
for (e = 0; e < neffects; e++) {
- efftab[e].obuf = (sox_sample_t *)xmalloc(sox_bufsiz * sizeof(sox_sample_t));
+ efftab[e].obuf = (sox_ssample_t *)xmalloc(sox_bufsiz * sizeof(sox_ssample_t));
if (efftabR[e].name)
- efftabR[e].obuf = (sox_sample_t *)xmalloc(sox_bufsiz * sizeof(sox_sample_t));
+ efftabR[e].obuf = (sox_ssample_t *)xmalloc(sox_bufsiz * sizeof(sox_ssample_t));
}
if (combine_method <= SOX_concatenate)
@@ -1137,7 +1137,7 @@
else {
ws = 0;
for (i = 0; i < input_count; i++) {
- ibuf[i] = (sox_sample_t *)xmalloc(sox_bufsiz * sizeof(sox_sample_t));
+ ibuf[i] = (sox_ssample_t *)xmalloc(sox_bufsiz * sizeof(sox_ssample_t));
progress_to_file(files[i]);
ws = max(ws, input_wide_samples);
}
@@ -1176,7 +1176,7 @@
}
balance_input(efftab[0].obuf, efftab[0].olen, files[current_input]);
} else {
- sox_sample_t * p = efftab[0].obuf;
+ sox_ssample_t * p = efftab[0].obuf;
for (i = 0; i < input_count; ++i) {
ilen[i] = sox_read_wide(files[i]->desc, ibuf[i]);
balance_input(ibuf[i], ilen[i], files[i]);
@@ -1556,10 +1556,10 @@
static int flow_effect(unsigned e)
{
sox_size_t i, done, idone, odone, idonel, odonel, idoner, odoner;
- const sox_sample_t *ibuf;
- sox_sample_t *obuf;
+ const sox_ssample_t *ibuf;
+ sox_ssample_t *obuf;
int effstatus, effstatusl, effstatusr;
- int (*flow)(eff_t, sox_sample_t const*, sox_sample_t*, sox_size_t*, sox_size_t*) =
+ int (*flow)(eff_t, sox_ssample_t const*, sox_ssample_t*, sox_size_t*, sox_size_t*) =
efftab[e].h->flow? efftab[e].h->flow : sox_effect_nothing_flow;
/* Do not attempt to do any more effect processing during
@@ -1686,9 +1686,9 @@
static int drain_effect(unsigned e)
{
sox_ssize_t i, olen, olenl, olenr;
- sox_sample_t *obuf;
+ sox_ssample_t *obuf;
int rc;
- int (*drain)(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp) =
+ int (*drain)(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp) =
efftab[e].h->drain? efftab[e].h->drain : sox_effect_nothing_drain;
if (! efftabR[e].name) {
--- a/src/sox.h
+++ b/src/sox.h
@@ -47,12 +47,12 @@
#define SOX_INT32_MAX SOX_INT_MAX(32)
#define SOX_INT64_MAX 0x7fffffffffffffffLL /* Not in use yet */
-typedef int32_t sox_sample_t;
-typedef uint32_t sox_usample_t; /* FIXME: this naming is different from
- other types */
+typedef int32_t sox_ssample_t;
+typedef uint32_t sox_sample_t;
+
/* Minimum and maximum values a sample can hold. */
-#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
-#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
+#define SOX_SAMPLE_MAX (sox_ssample_t)SOX_INT_MAX(32)
+#define SOX_SAMPLE_MIN (sox_ssample_t)SOX_INT_MIN(32)
@@ -80,7 +80,7 @@
*/
/* Temporary variables to prevent multiple evaluation of macro arguments: */
-static sox_sample_t sox_macro_temp_sample UNUSED;
+static sox_ssample_t sox_macro_temp_sample UNUSED;
static double sox_macro_temp_double UNUSED;
#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
@@ -87,12 +87,12 @@
#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
(uint##bits##_t)( \
sox_macro_temp_sample=(d), \
- sox_macro_temp_sample>(sox_sample_t)(SOX_SAMPLE_MAX-(1U<<(31-bits)))? \
+ sox_macro_temp_sample>(sox_ssample_t)(SOX_SAMPLE_MAX-(1U<<(31-bits)))? \
++(clips),SOX_UINT_MAX(bits): \
((uint32_t)(sox_macro_temp_sample^SOX_SAMPLE_NEG)+(1U<<(31-bits)))>>(32-bits))
#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
(int##bits##_t)(SOX_SAMPLE_TO_UNSIGNED(bits,d,clips)^SOX_INT_MIN(bits))
-#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_sample_t)(d)<<(32-bits))
+#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_ssample_t)(d)<<(32-bits))
#define SOX_UNSIGNED_TO_SAMPLE(bits,d)(SOX_SIGNED_TO_SAMPLE(bits,d)^SOX_SAMPLE_NEG)
#define SOX_UNSIGNED_BYTE_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
@@ -101,10 +101,10 @@
#define SOX_SIGNED_WORD_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
-#define SOX_UNSIGNED_DWORD_TO_SAMPLE(d,clips) (sox_sample_t)((d)^SOX_SAMPLE_NEG)
-#define SOX_SIGNED_DWORD_TO_SAMPLE(d,clips) (sox_sample_t)(d)
+#define SOX_UNSIGNED_DWORD_TO_SAMPLE(d,clips) (sox_ssample_t)((d)^SOX_SAMPLE_NEG)
+#define SOX_SIGNED_DWORD_TO_SAMPLE(d,clips) (sox_ssample_t)(d)
#define SOX_FLOAT_DWORD_TO_SAMPLE SOX_FLOAT_DDWORD_TO_SAMPLE
-#define SOX_FLOAT_DDWORD_TO_SAMPLE(d,clips) (sox_macro_temp_double=(d),sox_macro_temp_double<-1?++(clips),(-SOX_SAMPLE_MAX):sox_macro_temp_double>1?++(clips),SOX_SAMPLE_MAX:(sox_sample_t)((uint32_t)((double)(sox_macro_temp_double)*SOX_SAMPLE_MAX+(SOX_SAMPLE_MAX+.5))-SOX_SAMPLE_MAX))
+#define SOX_FLOAT_DDWORD_TO_SAMPLE(d,clips) (sox_macro_temp_double=(d),sox_macro_temp_double<-1?++(clips),(-SOX_SAMPLE_MAX):sox_macro_temp_double>1?++(clips),SOX_SAMPLE_MAX:(sox_ssample_t)((uint32_t)((double)(sox_macro_temp_double)*SOX_SAMPLE_MAX+(SOX_SAMPLE_MAX+.5))-SOX_SAMPLE_MAX))
#define SOX_SAMPLE_TO_UNSIGNED_BYTE(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
#define SOX_SAMPLE_TO_SIGNED_BYTE(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
#define SOX_SAMPLE_TO_UNSIGNED_WORD(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
@@ -140,8 +140,8 @@
* and increment a counter if clipping occurs.
*/
#define SOX_24BIT_CLIP_COUNT(l, clips) \
- ((l) >= ((sox_sample_t)1 << 23)? ++(clips), ((sox_sample_t)1 << 23) - 1 : \
- (l) <=-((sox_sample_t)1 << 23)? ++(clips),-((sox_sample_t)1 << 23) + 1 : (l))
+ ((l) >= ((sox_ssample_t)1 << 23)? ++(clips), ((sox_sample_t)1 << 23) - 1 : \
+ (l) <=-((sox_ssample_t)1 << 23)? ++(clips),-((sox_ssample_t)1 << 23) + 1 : (l))
@@ -284,10 +284,10 @@
const char *usage;
unsigned int flags;
int (*startread)(ft_t ft);
- sox_size_t (*read)(ft_t ft, sox_sample_t *buf, sox_size_t len);
+ sox_size_t (*read)(ft_t ft, sox_ssample_t *buf, sox_size_t len);
int (*stopread)(ft_t ft);
int (*startwrite)(ft_t ft);
- sox_size_t (*write)(ft_t ft, const sox_sample_t *buf, sox_size_t len);
+ sox_size_t (*write)(ft_t ft, const sox_ssample_t *buf, sox_size_t len);
int (*stopwrite)(ft_t ft);
int (*seek)(ft_t ft, sox_size_t offset);
} sox_format_t;
@@ -366,9 +366,9 @@
int (*getopts)(eff_t effp, int argc, char *argv[]);
int (*start)(eff_t effp);
- int (*flow)(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+ int (*flow)(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp);
- int (*drain)(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp);
+ int (*drain)(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp);
int (*stop)(eff_t effp);
int (*kill)(eff_t effp);
} sox_effect_t;
@@ -380,7 +380,7 @@
struct sox_signalinfo ininfo; /* input signal specifications */
struct sox_signalinfo outinfo; /* output signal specifications */
const sox_effect_t *h; /* effects driver */
- sox_sample_t *obuf; /* output buffer */
+ sox_ssample_t *obuf; /* output buffer */
sox_size_t odone, olen; /* consumed, total length */
sox_size_t clips; /* increment if clipping occurs */
/* The following is a portable trick to align this variable on
@@ -404,8 +404,8 @@
const char *comment,
const sox_instrinfo_t *instr,
const sox_loopinfo_t *loops);
-extern sox_size_t sox_read(ft_t ft, sox_sample_t *buf, sox_size_t len);
-extern sox_size_t sox_write(ft_t ft, const sox_sample_t *buf, sox_size_t len);
+extern sox_size_t sox_read(ft_t ft, sox_ssample_t *buf, sox_size_t len);
+extern sox_size_t sox_write(ft_t ft, const sox_ssample_t *buf, sox_size_t len);
extern int sox_close(ft_t ft);
#define SOX_SEEK_SET 0
--- a/src/sox_i.h
+++ b/src/sox_i.h
@@ -83,8 +83,8 @@
double max, /* Maximum value on the y-axis. (e.g. +1) */
double phase); /* Phase at 1st point; 0..2pi. (e.g. pi/2 for cosine) */
-sox_sample_t sox_gcd(sox_sample_t a, sox_sample_t b);
-sox_sample_t sox_lcm(sox_sample_t a, sox_sample_t b);
+sox_ssample_t sox_gcd(sox_ssample_t a, sox_ssample_t b);
+sox_ssample_t sox_lcm(sox_ssample_t a, sox_ssample_t b);
#ifndef HAVE_STRCASECMP
int strcasecmp(const char *s1, const char *s2);
@@ -285,18 +285,18 @@
/* Raw I/O */
int sox_rawstartread(ft_t ft);
-sox_size_t sox_rawread(ft_t ft, sox_sample_t *buf, sox_size_t nsamp);
+sox_size_t sox_rawread(ft_t ft, sox_ssample_t *buf, sox_size_t nsamp);
int sox_rawstopread(ft_t ft);
int sox_rawstartwrite(ft_t ft);
-sox_size_t sox_rawwrite(ft_t ft, const sox_sample_t *buf, sox_size_t nsamp);
+sox_size_t sox_rawwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t nsamp);
int sox_rawseek(ft_t ft, sox_size_t offset);
/* libsndfile I/O */
int sox_sndfile_startread(ft_t ft);
-sox_size_t sox_sndfile_read(ft_t ft, sox_sample_t *buf, sox_size_t len);
+sox_size_t sox_sndfile_read(ft_t ft, sox_ssample_t *buf, sox_size_t len);
int sox_sndfile_stopread(ft_t ft);
int sox_sndfile_startwrite(ft_t ft);
-sox_size_t sox_sndfile_write(ft_t ft, const sox_sample_t *buf, sox_size_t len);
+sox_size_t sox_sndfile_write(ft_t ft, const sox_ssample_t *buf, sox_size_t len);
int sox_sndfile_stopwrite(ft_t ft);
int sox_sndfile_seek(ft_t ft, sox_size_t offset);
@@ -305,12 +305,12 @@
* a file handler or effect doesn't need to do anything special
*/
int sox_format_nothing(ft_t ft);
-sox_size_t sox_format_nothing_read(ft_t ft, sox_sample_t *buf, sox_size_t len);
-sox_size_t sox_format_nothing_write(ft_t ft, const sox_sample_t *buf, sox_size_t len);
+sox_size_t sox_format_nothing_read(ft_t ft, sox_ssample_t *buf, sox_size_t len);
+sox_size_t sox_format_nothing_write(ft_t ft, const sox_ssample_t *buf, sox_size_t len);
int sox_format_nothing_seek(ft_t ft, sox_size_t offset);
int sox_effect_nothing(eff_t effp);
-int sox_effect_nothing_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf, sox_size_t *isamp, sox_size_t *osamp);
-int sox_effect_nothing_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp);
+int sox_effect_nothing_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf, sox_size_t *isamp, sox_size_t *osamp);
+int sox_effect_nothing_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp);
int sox_effect_nothing_getopts(eff_t effp, int n, char **argv UNUSED);
int sox_rawstart(ft_t ft, sox_bool default_rate, sox_bool default_channels, sox_encoding_t encoding, int size, sox_option_t rev_bits);
@@ -384,8 +384,8 @@
/* Needed in rate.c */
int sox_resample_start(eff_t effp);
int sox_resample_getopts(eff_t effp, int n, char **argv);
-int sox_resample_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf, sox_size_t *isamp, sox_size_t *osamp);
-int sox_resample_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp);
+int sox_resample_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf, sox_size_t *isamp, sox_size_t *osamp);
+int sox_resample_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp);
int sox_resample_stop(eff_t effp);
#endif
--- a/src/sox_sample_test.c
+++ b/src/sox_sample_test.c
@@ -132,7 +132,7 @@
int16_t int16_2;
int24_t int24_2;
- sox_sample_t sample;
+ sox_ssample_t sample;
sox_size_t clips = 0;
double d;
--- a/src/soxio.c
+++ b/src/soxio.c
@@ -298,13 +298,13 @@
return NULL;
}
-sox_size_t sox_read(ft_t f, sox_sample_t * buf, sox_size_t len)
+sox_size_t sox_read(ft_t f, sox_ssample_t * buf, sox_size_t len)
{
sox_size_t actual = (*f->h->read)(f, buf, len);
return (actual > len? 0 : actual);
}
-sox_size_t sox_write(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+sox_size_t sox_write(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
return (*ft->h->write)(ft, buf, len);
}
--- a/src/sphere.c
+++ b/src/sphere.c
@@ -206,7 +206,7 @@
}
-static sox_size_t sox_spherewrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_spherewrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
sphere_t sphere = (sphere_t) ft->priv;
--- a/src/stat.c
+++ b/src/stat.c
@@ -129,7 +129,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_stat_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_stat_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
stat_t stat = (stat_t) effp->priv;
@@ -201,7 +201,7 @@
/*
* Process tail of input samples.
*/
-static int sox_stat_drain(eff_t effp, sox_sample_t *obuf UNUSED, sox_size_t *osamp)
+static int sox_stat_drain(eff_t effp, sox_ssample_t *obuf UNUSED, sox_size_t *osamp)
{
stat_t stat = (stat_t) effp->priv;
--- a/src/stretch.c
+++ b/src/stretch.c
@@ -57,7 +57,7 @@
sox_size_t size; /* buffer size */
sox_size_t index; /* next available element */
- sox_sample_t *ibuf; /* input buffer */
+ sox_ssample_t *ibuf; /* input buffer */
sox_size_t ishift; /* input shift */
sox_size_t oindex; /* next evailable element */
@@ -176,7 +176,7 @@
stretch->size = (int)(effp->outinfo.rate * 0.001 * stretch->window);
/* start in the middle of an input to avoid initial fading... */
stretch->index = stretch->size / 2;
- stretch->ibuf = (sox_sample_t *)xmalloc(stretch->size * sizeof(sox_sample_t));
+ stretch->ibuf = (sox_ssample_t *)xmalloc(stretch->size * sizeof(sox_ssample_t));
/* the shift ratio deal with the longest of ishift/oshift
hence ishift<=size and oshift<=size. */
@@ -244,7 +244,7 @@
/*
* Processes flow.
*/
-static int sox_stretch_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_stretch_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
stretch_t stretch = (stretch_t) effp->priv;
@@ -256,7 +256,7 @@
sox_size_t tocopy = min(*isamp-iindex,
stretch->size-stretch->index);
- memcpy(stretch->ibuf + stretch->index, ibuf + iindex, tocopy * sizeof(sox_sample_t));
+ memcpy(stretch->ibuf + stretch->index, ibuf + iindex, tocopy * sizeof(sox_ssample_t));
iindex += tocopy;
stretch->index += tocopy;
@@ -311,7 +311,7 @@
* Drain buffer at the end
* maybe not correct ? end might be artificially faded?
*/
-static int sox_stretch_drain(eff_t effp, sox_sample_t *obuf, sox_size_t *osamp)
+static int sox_stretch_drain(eff_t effp, sox_ssample_t *obuf, sox_size_t *osamp)
{
stretch_t stretch = (stretch_t) effp->priv;
sox_size_t i;
--- a/src/swap.c
+++ b/src/swap.c
@@ -133,7 +133,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_swap_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_swap_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
swap_t swap = (swap_t) effp->priv;
--- a/src/synth.c
+++ b/src/synth.c
@@ -168,7 +168,7 @@
double par[MAXCHAN][5];
/* internal stuff */
- sox_sample_t max;
+ sox_ssample_t max;
sox_size_t samples_done;
int rate;
sox_size_t length; /* length in number of samples */
@@ -477,8 +477,8 @@
-static sox_sample_t do_synth(sox_sample_t iv, synth_t synth, int c){
- sox_sample_t ov=iv;
+static sox_ssample_t do_synth(sox_ssample_t iv, synth_t synth, int c){
+ sox_ssample_t ov=iv;
double r=0.0; /* -1 .. +1 */
double f;
double om;
@@ -637,7 +637,7 @@
ov = iv/2 + r*synth->max/2;
break;
case SYNTH_AMOD:
- ov = (sox_sample_t)(0.5*(r+1.0)*(double)iv);
+ ov = (sox_ssample_t)(0.5*(r+1.0)*(double)iv);
break;
case SYNTH_FMOD:
ov = iv * r ;
@@ -655,7 +655,7 @@
/*
* Processed signed long samples from ibuf to obuf.
*/
-int sox_synth_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+int sox_synth_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
synth_t synth = (synth_t) effp->priv;
--- a/src/synth.h
+++ b/src/synth.h
@@ -1,4 +1,4 @@
#include "sox_i.h"
int sox_synth_getopts(eff_t, int, char * *);
int sox_synth_start(eff_t);
-int sox_synth_flow(eff_t, sox_sample_t const *, sox_sample_t *, sox_size_t *, sox_size_t *);
+int sox_synth_flow(eff_t, sox_ssample_t const *, sox_ssample_t *, sox_size_t *, sox_size_t *);
--- a/src/trim.c
+++ b/src/trim.c
@@ -116,7 +116,7 @@
* Place in buf[].
* Return number of samples read.
*/
-static int sox_trim_flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int sox_trim_flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
int finished = 0;
@@ -164,7 +164,7 @@
trim->trimmed += done;
}
- memcpy(obuf, ibuf+offset, done * sizeof(sox_sample_t));
+ memcpy(obuf, ibuf+offset, done * sizeof(sox_ssample_t));
*osamp = done;
*isamp = offset + done;
--- a/src/tx16w.c
+++ b/src/tx16w.c
@@ -186,7 +186,7 @@
* Return number of samples read.
*/
-static sox_size_t sox_txwread(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_txwread(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
txw_t sk = (txw_t) ft->priv;
sox_size_t done = 0;
@@ -225,10 +225,10 @@
sk->rest -= 3; /* adjust remaining for bytes we just read */
s1 = (unsigned short) (uc1 << 4) | (((uc2 >> 4) & 017));
s2 = (unsigned short) (uc3 << 4) | (( uc2 & 017 ));
- *buf = (sox_sample_t) s1;
+ *buf = (sox_ssample_t) s1;
*buf = (*buf << 20);
buf++; /* sample one is done */
- *buf = (sox_sample_t) s2;
+ *buf = (sox_ssample_t) s2;
*buf = (*buf << 20);
buf++; /* sample two is done */
done += 2; /* adjust converted & stored sample count */
@@ -267,10 +267,10 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_txwwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_txwwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
sox_size_t i;
- sox_sample_t w1,w2;
+ sox_ssample_t w1,w2;
tx16w_len += len;
if (tx16w_len > TXMAXLEN) return 0;
--- a/src/voc.c
+++ b/src/voc.c
@@ -202,8 +202,8 @@
static void blockstart(ft_t);
/* Conversion macros (from raw.c) */
-#define SOX_ALAW_BYTE_TO_SAMPLE(d) ((sox_sample_t)(sox_alaw2linear16(d)) << 16)
-#define SOX_ULAW_BYTE_TO_SAMPLE(d) ((sox_sample_t)(sox_ulaw2linear16(d)) << 16)
+#define SOX_ALAW_BYTE_TO_SAMPLE(d) ((sox_ssample_t)(sox_alaw2linear16(d)) << 16)
+#define SOX_ULAW_BYTE_TO_SAMPLE(d) ((sox_ssample_t)(sox_ulaw2linear16(d)) << 16)
/* public VOC functions for SOX */
/*-----------------------------------------------------------------
@@ -308,7 +308,7 @@
* ANN: Major changes here to support multi-part files and files
* that do not have audio in block 9's.
*-----------------------------------------------------------------*/
-static sox_size_t sox_vocread(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_vocread(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
vs_t v = (vs_t) ft->priv;
sox_size_t done = 0;
@@ -441,7 +441,7 @@
/*-----------------------------------------------------------------
* sox_vocwrite() -- write a VOC file
*-----------------------------------------------------------------*/
-static sox_size_t sox_vocwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_vocwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
vs_t v = (vs_t) ft->priv;
unsigned char uc;
@@ -474,7 +474,7 @@
static void blockstop(ft_t ft)
{
vs_t v = (vs_t) ft->priv;
- sox_sample_t datum;
+ sox_ssample_t datum;
sox_writeb(ft, 0); /* End of file block code */
sox_seeki(ft, v->blockseek, 0); /* seek back to block length */
--- a/src/vol.c
+++ b/src/vol.c
@@ -127,7 +127,7 @@
/*
* Process data.
*/
-static int flow(eff_t effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
+static int flow(eff_t effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
vol_t vol = (vol_t) effp->priv;
--- a/src/vorbis.c
+++ b/src/vorbis.c
@@ -210,12 +210,12 @@
* Return number of samples read.
*/
-static sox_size_t sox_vorbisread(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_vorbisread(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
vorbis_t vb = (vorbis_t) ft->priv;
sox_size_t i;
int ret;
- sox_sample_t l;
+ sox_ssample_t l;
for(i = 0; i < len; i++) {
@@ -377,7 +377,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_vorbiswrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_vorbiswrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
vorbis_t vb = (vorbis_t) ft->priv;
vorbis_enc_t *ve = vb->vorbis_enc_data;
--- a/src/vox.c
+++ b/src/vox.c
@@ -26,7 +26,7 @@
return sox_adpcm_ima_start(ft, (adpcm_io_t)ft->priv);
}
-static sox_size_t read(ft_t ft, sox_sample_t *buffer, sox_size_t len)
+static sox_size_t read(ft_t ft, sox_ssample_t *buffer, sox_size_t len)
{
return sox_adpcm_read(ft, (adpcm_io_t)ft->priv, buffer, len);
}
@@ -36,7 +36,7 @@
return sox_adpcm_stopread(ft, (adpcm_io_t)ft->priv);
}
-static sox_size_t write(ft_t ft, const sox_sample_t *buffer, sox_size_t length)
+static sox_size_t write(ft_t ft, const sox_ssample_t *buffer, sox_size_t length)
{
return sox_adpcm_write(ft, (adpcm_io_t)ft->priv, buffer, length);
}
--- a/src/wav.c
+++ b/src/wav.c
@@ -220,7 +220,7 @@
free(wav->gsmsample);
}
-static sox_size_t wavgsmread(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t wavgsmread(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
wav_t wav = (wav_t) ft->priv;
size_t done=0;
@@ -288,7 +288,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t wavgsmwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t wavgsmwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
wav_t wav = (wav_t) ft->priv;
size_t done = 0;
@@ -996,7 +996,7 @@
* Return number of samples read.
*/
-static sox_size_t sox_wavread(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_wavread(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
wav_t wav = (wav_t) ft->priv;
sox_size_t done;
@@ -1531,7 +1531,7 @@
return SOX_SUCCESS;
}
-static sox_size_t sox_wavwrite(ft_t ft, const sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_wavwrite(ft_t ft, const sox_ssample_t *buf, sox_size_t len)
{
wav_t wav = (wav_t) ft->priv;
sox_ssize_t total_len = len;
--- a/src/wve.c
+++ b/src/wve.c
@@ -143,7 +143,7 @@
return SOX_SUCCESS;
}
-static sox_size_t sox_wvewrite(ft_t ft, const sox_sample_t *buf, sox_size_t samp)
+static sox_size_t sox_wvewrite(ft_t ft, const sox_ssample_t *buf, sox_size_t samp)
{
wve_t p = (wve_t)ft->priv;
p->length += samp * ft->signal.size;
--- a/src/xa.c
+++ b/src/xa.c
@@ -194,7 +194,7 @@
* Read up to len samples from a file, converted to signed longs.
* Return the number of samples read.
*/
-static sox_size_t sox_xaread(ft_t ft, sox_sample_t *buf, sox_size_t len)
+static sox_size_t sox_xaread(ft_t ft, sox_ssample_t *buf, sox_size_t len)
{
xa_t xa = (xa_t) ft->priv;
int32_t sample;
@@ -290,7 +290,7 @@
return SOX_EOF;
}
-static sox_size_t sox_xawrite(ft_t ft, const sox_sample_t *buf UNUSED, sox_size_t len UNUSED)
+static sox_size_t sox_xawrite(ft_t ft, const sox_ssample_t *buf UNUSED, sox_size_t len UNUSED)
{
sox_fail_errno(ft, SOX_ENOTSUP, ".XA writing not supported");
return 0;