diff options
author | jm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800> | 2007-03-12 16:55:23 +0300 |
---|---|---|
committer | jm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800> | 2007-03-12 16:55:23 +0300 |
commit | 723f644e09333a0230383eae4af1f3aa3e46e1c3 (patch) | |
tree | 8ed300b306c404008144c2525e4b46a6aa156d4b /include | |
parent | f45dd89d7d69e0604634990128a7e553c36fb5c9 (diff) |
Changed the sign of a bunch of parameters in the API. Tons of signed/unsigned
changes in the code as a consequence of that. Hopefully this will be the last
change to the API.
git-svn-id: http://svn.xiph.org/trunk/speex@12736 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'include')
-rw-r--r-- | include/speex/speex_resampler.h | 71 |
1 files changed, 37 insertions, 34 deletions
diff --git a/include/speex/speex_resampler.h b/include/speex/speex_resampler.h index a2892dd..4bea16c 100644 --- a/include/speex/speex_resampler.h +++ b/include/speex/speex_resampler.h @@ -75,10 +75,13 @@ #define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem) #define spx_int16_t short +#define spx_int32_t int +#define spx_uint16_t unsigned short +#define spx_uint32_t unsigned int #ifdef FIXED_POINT -#define spx_word16_t short -#define spx_word32_t int +#define spx_word16_t spx_int16_t +#define spx_word32_t spx_int32_t #else /* FIXED_POINT */ @@ -117,9 +120,9 @@ typedef struct SpeexResamplerState_ SpeexResamplerState; * @return Newly created resampler state * @retval NULL Error: not enough memory */ -SpeexResamplerState *speex_resampler_init(int nb_channels, - int in_rate, - int out_rate, +SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, + spx_uint32_t in_rate, + spx_uint32_t out_rate, int quality); /** Create a new resampler with fractional input/output rates. The sampling @@ -135,11 +138,11 @@ SpeexResamplerState *speex_resampler_init(int nb_channels, * @return Newly created resampler state * @retval NULL Error: not enough memory */ -SpeexResamplerState *speex_resampler_init_frac(int nb_channels, - int ratio_num, - int ratio_den, - int in_rate, - int out_rate, +SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, + spx_uint32_t ratio_num, + spx_uint32_t ratio_den, + spx_uint32_t in_rate, + spx_uint32_t out_rate, int quality); /** Destroy a resampler state. @@ -158,11 +161,11 @@ void speex_resampler_destroy(SpeexResamplerState *st); * @param out_len Size of the output buffer. Returns the number of samples written */ void speex_resampler_process_float(SpeexResamplerState *st, - int channel_index, + spx_uint32_t channel_index, const float *in, - int *in_len, + spx_uint32_t *in_len, float *out, - int *out_len); + spx_uint32_t *out_len); /** Resample an int array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -175,11 +178,11 @@ void speex_resampler_process_float(SpeexResamplerState *st, * @param out_len Size of the output buffer. Returns the number of samples written */ void speex_resampler_process_int(SpeexResamplerState *st, - int channel_index, + spx_uint32_t channel_index, const spx_int16_t *in, - int *in_len, + spx_uint32_t *in_len, spx_int16_t *out, - int *out_len); + spx_uint32_t *out_len); /** Resample an interleaved float array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -192,9 +195,9 @@ void speex_resampler_process_int(SpeexResamplerState *st, */ void speex_resampler_process_interleaved_float(SpeexResamplerState *st, const float *in, - int *in_len, + spx_uint32_t *in_len, float *out, - int *out_len); + spx_uint32_t *out_len); /** Resample an interleaved int array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -207,9 +210,9 @@ void speex_resampler_process_interleaved_float(SpeexResamplerState *st, */ void speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_int16_t *in, - int *in_len, + spx_uint32_t *in_len, spx_int16_t *out, - int *out_len); + spx_uint32_t *out_len); /** Set (change) the input/output sampling rates (integer value). * @param st Resampler state @@ -217,8 +220,8 @@ void speex_resampler_process_interleaved_int(SpeexResamplerState *st, * @param out_rate Output sampling rate (integer number of Hz). */ void speex_resampler_set_rate(SpeexResamplerState *st, - int in_rate, - int out_rate); + spx_uint32_t in_rate, + spx_uint32_t out_rate); /** Get the current input/output sampling rates (integer value). * @param st Resampler state @@ -226,8 +229,8 @@ void speex_resampler_set_rate(SpeexResamplerState *st, * @param out_rate Output sampling rate (integer number of Hz) copied. */ void speex_resampler_get_rate(SpeexResamplerState *st, - int *in_rate, - int *out_rate); + spx_uint32_t *in_rate, + spx_uint32_t *out_rate); /** Set (change) the input/output sampling rates and resampling ratio * (fractional values in Hz supported). @@ -238,10 +241,10 @@ void speex_resampler_get_rate(SpeexResamplerState *st, * @param out_rate Output sampling rate rounded to the nearest integer (in Hz). */ void speex_resampler_set_rate_frac(SpeexResamplerState *st, - int ratio_num, - int ratio_den, - int in_rate, - int out_rate); + spx_uint32_t ratio_num, + spx_uint32_t ratio_den, + spx_uint32_t in_rate, + spx_uint32_t out_rate); /** Get the current resampling ratio. This will be reduced to the least * common denominator. @@ -250,8 +253,8 @@ void speex_resampler_set_rate_frac(SpeexResamplerState *st, * @param ratio_den Denominator of the sampling rate ratio copied */ void speex_resampler_get_ratio(SpeexResamplerState *st, - int *ratio_num, - int *ratio_den); + spx_uint32_t *ratio_num, + spx_uint32_t *ratio_den); /** Set (change) the conversion quality. * @param st Resampler state @@ -274,28 +277,28 @@ void speex_resampler_get_quality(SpeexResamplerState *st, * @param stride Input stride */ void speex_resampler_set_input_stride(SpeexResamplerState *st, - int stride); + spx_uint32_t stride); /** Get the input stride. * @param st Resampler state * @param stride Input stride copied */ void speex_resampler_get_input_stride(SpeexResamplerState *st, - int *stride); + spx_uint32_t *stride); /** Set (change) the output stride. * @param st Resampler state * @param stride Output stride */ void speex_resample_set_output_stride(SpeexResamplerState *st, - int stride); + spx_uint32_t stride); /** Get the output stride. * @param st Resampler state copied * @param stride Output stride */ void speex_resample_get_output_stride(SpeexResamplerState *st, - int *stride); + spx_uint32_t *stride); /** Make sure that the first samples to go out of the resamplers don't have * leading zeros. This is only useful before starting to use a newly created |