diff options
Diffstat (limited to 'thirdparties/android/common/include/speex/speex_resampler.h')
-rwxr-xr-x | thirdparties/android/common/include/speex/speex_resampler.h | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/thirdparties/android/common/include/speex/speex_resampler.h b/thirdparties/android/common/include/speex/speex_resampler.h index 54eef8d..4aefa61 100755 --- a/thirdparties/android/common/include/speex/speex_resampler.h +++ b/thirdparties/android/common/include/speex/speex_resampler.h @@ -1,8 +1,8 @@ /* Copyright (C) 2007 Jean-Marc Valin - + File: speex_resampler.h Resampling code - + The design goals of this code are: - Very fast algorithm - Low memory requirement @@ -43,7 +43,7 @@ /********* WARNING: MENTAL SANITY ENDS HERE *************/ -/* If the resampler is defined outside of Speex, we change the symbol names so that +/* If the resampler is defined outside of Speex, we change the symbol names so that there won't be any clash if linking with Speex later on. */ /* #define RANDOM_PREFIX your software name here */ @@ -53,7 +53,7 @@ #define CAT_PREFIX2(a,b) a ## b #define CAT_PREFIX(a,b) CAT_PREFIX2(a, b) - + #define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init) #define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac) #define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy) @@ -81,7 +81,7 @@ #define spx_int32_t int #define spx_uint16_t unsigned short #define spx_uint32_t unsigned int - + #else /* OUTSIDE_SPEEX */ #include "speex/speex_types.h" @@ -99,13 +99,13 @@ extern "C" { #define SPEEX_RESAMPLER_QUALITY_DESKTOP 5 enum { - RESAMPLER_ERR_SUCCESS = 0, - RESAMPLER_ERR_ALLOC_FAILED = 1, - RESAMPLER_ERR_BAD_STATE = 2, - RESAMPLER_ERR_INVALID_ARG = 3, - RESAMPLER_ERR_PTR_OVERLAP = 4, - - RESAMPLER_ERR_MAX_ERROR + RESAMPLER_ERR_SUCCESS = 0, + RESAMPLER_ERR_ALLOC_FAILED = 1, + RESAMPLER_ERR_BAD_STATE = 2, + RESAMPLER_ERR_INVALID_ARG = 3, + RESAMPLER_ERR_PTR_OVERLAP = 4, + + RESAMPLER_ERR_MAX_ERROR }; struct SpeexResamplerState_; @@ -120,14 +120,14 @@ typedef struct SpeexResamplerState_ SpeexResamplerState; * @return Newly created resampler state * @retval NULL Error: not enough memory */ -SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, - spx_uint32_t in_rate, - spx_uint32_t out_rate, - int quality, - int *err); - -/** Create a new resampler with fractional input/output rates. The sampling - * rate ratio is an arbitrary rational number with both the numerator and +SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, + spx_uint32_t in_rate, + spx_uint32_t out_rate, + int quality, + int *err); + +/** Create a new resampler with fractional input/output rates. The sampling + * rate ratio is an arbitrary rational number with both the numerator and * denominator being 32-bit integers. * @param nb_channels Number of channels to be processed * @param ratio_num Numerator of the sampling rate ratio @@ -139,13 +139,13 @@ SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, * @return Newly created resampler state * @retval NULL Error: not enough memory */ -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, - int *err); +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, + int *err); /** Destroy a resampler state. * @param st Resampler state @@ -154,24 +154,24 @@ void speex_resampler_destroy(SpeexResamplerState *st); /** Resample a float array. The input and output buffers must *not* overlap. * @param st Resampler state - * @param channel_index Index of the channel to process for the multi-channel + * @param channel_index Index of the channel to process for the multi-channel * base (0 otherwise) * @param in Input buffer - * @param in_len Number of input samples in the input buffer. Returns the + * @param in_len Number of input samples in the input buffer. Returns the * number of samples processed * @param out Output buffer * @param out_len Size of the output buffer. Returns the number of samples written */ -int speex_resampler_process_float(SpeexResamplerState *st, - spx_uint32_t channel_index, - const float *in, - spx_uint32_t *in_len, - float *out, - spx_uint32_t *out_len); +int speex_resampler_process_float(SpeexResamplerState *st, + spx_uint32_t channel_index, + const float *in, + spx_uint32_t *in_len, + float *out, + spx_uint32_t *out_len); /** Resample an int array. The input and output buffers must *not* overlap. * @param st Resampler state - * @param channel_index Index of the channel to process for the multi-channel + * @param channel_index Index of the channel to process for the multi-channel * base (0 otherwise) * @param in Input buffer * @param in_len Number of input samples in the input buffer. Returns the number @@ -179,12 +179,12 @@ int speex_resampler_process_float(SpeexResamplerState *st, * @param out Output buffer * @param out_len Size of the output buffer. Returns the number of samples written */ -int speex_resampler_process_int(SpeexResamplerState *st, - spx_uint32_t channel_index, - const spx_int16_t *in, - spx_uint32_t *in_len, - spx_int16_t *out, - spx_uint32_t *out_len); +int speex_resampler_process_int(SpeexResamplerState *st, + spx_uint32_t channel_index, + const spx_int16_t *in, + spx_uint32_t *in_len, + spx_int16_t *out, + spx_uint32_t *out_len); /** Resample an interleaved float array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -195,11 +195,11 @@ int speex_resampler_process_int(SpeexResamplerState *st, * @param out_len Size of the output buffer. Returns the number of samples written. * This is all per-channel. */ -int speex_resampler_process_interleaved_float(SpeexResamplerState *st, - const float *in, - spx_uint32_t *in_len, - float *out, - spx_uint32_t *out_len); +int speex_resampler_process_interleaved_float(SpeexResamplerState *st, + const float *in, + spx_uint32_t *in_len, + float *out, + spx_uint32_t *out_len); /** Resample an interleaved int array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -210,31 +210,31 @@ int speex_resampler_process_interleaved_float(SpeexResamplerState *st, * @param out_len Size of the output buffer. Returns the number of samples written. * This is all per-channel. */ -int speex_resampler_process_interleaved_int(SpeexResamplerState *st, - const spx_int16_t *in, - spx_uint32_t *in_len, - spx_int16_t *out, - spx_uint32_t *out_len); +int speex_resampler_process_interleaved_int(SpeexResamplerState *st, + const spx_int16_t *in, + spx_uint32_t *in_len, + spx_int16_t *out, + spx_uint32_t *out_len); /** Set (change) the input/output sampling rates (integer value). * @param st Resampler state * @param in_rate Input sampling rate (integer number of Hz). * @param out_rate Output sampling rate (integer number of Hz). */ -int speex_resampler_set_rate(SpeexResamplerState *st, - spx_uint32_t in_rate, - spx_uint32_t out_rate); +int speex_resampler_set_rate(SpeexResamplerState *st, + spx_uint32_t in_rate, + spx_uint32_t out_rate); /** Get the current input/output sampling rates (integer value). * @param st Resampler state * @param in_rate Input sampling rate (integer number of Hz) copied. * @param out_rate Output sampling rate (integer number of Hz) copied. */ -void speex_resampler_get_rate(SpeexResamplerState *st, - spx_uint32_t *in_rate, +void speex_resampler_get_rate(SpeexResamplerState *st, + spx_uint32_t *in_rate, spx_uint32_t *out_rate); -/** Set (change) the input/output sampling rates and resampling ratio +/** Set (change) the input/output sampling rates and resampling ratio * (fractional values in Hz supported). * @param st Resampler state * @param ratio_num Numerator of the sampling rate ratio @@ -242,11 +242,11 @@ void speex_resampler_get_rate(SpeexResamplerState *st, * @param in_rate Input sampling rate rounded to the nearest integer (in Hz). * @param out_rate Output sampling rate rounded to the nearest integer (in Hz). */ -int speex_resampler_set_rate_frac(SpeexResamplerState *st, - spx_uint32_t ratio_num, - spx_uint32_t ratio_den, - spx_uint32_t in_rate, - spx_uint32_t out_rate); +int speex_resampler_set_rate_frac(SpeexResamplerState *st, + 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. @@ -254,53 +254,53 @@ int speex_resampler_set_rate_frac(SpeexResamplerState *st, * @param ratio_num Numerator of the sampling rate ratio copied * @param ratio_den Denominator of the sampling rate ratio copied */ -void speex_resampler_get_ratio(SpeexResamplerState *st, - spx_uint32_t *ratio_num, +void speex_resampler_get_ratio(SpeexResamplerState *st, + spx_uint32_t *ratio_num, spx_uint32_t *ratio_den); /** Set (change) the conversion quality. * @param st Resampler state - * @param quality Resampling quality between 0 and 10, where 0 has poor + * @param quality Resampling quality between 0 and 10, where 0 has poor * quality and 10 has very high quality. */ -int speex_resampler_set_quality(SpeexResamplerState *st, - int quality); +int speex_resampler_set_quality(SpeexResamplerState *st, + int quality); /** Get the conversion quality. * @param st Resampler state - * @param quality Resampling quality between 0 and 10, where 0 has poor + * @param quality Resampling quality between 0 and 10, where 0 has poor * quality and 10 has very high quality. */ -void speex_resampler_get_quality(SpeexResamplerState *st, +void speex_resampler_get_quality(SpeexResamplerState *st, int *quality); /** Set (change) the input stride. * @param st Resampler state * @param stride Input stride */ -void speex_resampler_set_input_stride(SpeexResamplerState *st, +void speex_resampler_set_input_stride(SpeexResamplerState *st, 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, +void speex_resampler_get_input_stride(SpeexResamplerState *st, spx_uint32_t *stride); /** Set (change) the output stride. * @param st Resampler state * @param stride Output stride */ -void speex_resampler_set_output_stride(SpeexResamplerState *st, - spx_uint32_t stride); +void speex_resampler_set_output_stride(SpeexResamplerState *st, + spx_uint32_t stride); /** Get the output stride. * @param st Resampler state copied * @param stride Output stride */ -void speex_resampler_get_output_stride(SpeexResamplerState *st, - spx_uint32_t *stride); +void speex_resampler_get_output_stride(SpeexResamplerState *st, + spx_uint32_t *stride); /** Get the latency in input samples introduced by the resampler. * @param st Resampler state @@ -312,8 +312,8 @@ int speex_resampler_get_input_latency(SpeexResamplerState *st); */ int speex_resampler_get_output_latency(SpeexResamplerState *st); -/** 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 +/** 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 * resampler. It is recommended to use that when resampling an audio file, as * it will generate a file with the same length. For real-time processing, * it is probably easier not to use this call (so that the output duration |