Commit 30f7f813 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Changed all the celt*int*_t types to remove the _t suffix, which is reserved

by POSIX. The other _t types that are not part of the API are still there
for now. Also, got rid of all that was left of the 64-bit types.
parent d35d6775
......@@ -55,7 +55,7 @@ struct kiss_fft_state{
#ifdef DOUBLE_PRECISION
# define FRACBITS 31
# define SAMPPROD celt_int64_t
# define SAMPPROD long long
#define SAMP_MAX 2147483647
#ifdef MIXED_PRECISION
#define TWID_MAX 32767
......@@ -69,7 +69,7 @@ struct kiss_fft_state{
#else /* DOUBLE_PRECISION */
# define FRACBITS 15
# define SAMPPROD celt_int32_t
# define SAMPPROD celt_int32
#define SAMP_MAX 32767
#define TRIG_UPSCALE 1
#define EXT32(a) EXTEND32(a)
......
......@@ -49,8 +49,8 @@
#endif
#define IMUL32(a,b) ((a)*(b))
#define UMUL32(a,b) ((celt_int32_t)(a)*(celt_int32_t)(b))
#define UMUL16_16(a,b) ((celt_int32_t)(a)*(celt_int32_t)(b))
#define UMUL32(a,b) ((celt_int32)(a)*(celt_int32)(b))
#define UMUL16_16(a,b) ((celt_int32)(a)*(celt_int32)(b))
#define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */
#define ABS16(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 16-bit value. */
......@@ -68,8 +68,8 @@
#ifdef FIXED_POINT
typedef celt_int16_t celt_word16_t;
typedef celt_int32_t celt_word32_t;
typedef celt_int16 celt_word16_t;
typedef celt_int32 celt_word32_t;
typedef celt_word32_t celt_sig_t;
typedef celt_word16_t celt_norm_t;
......
......@@ -49,7 +49,7 @@
void compute_band_energies(const CELTMode *m, const celt_sig_t *X, celt_ener_t *bank, int _C)
{
int i, c, N;
const celt_int16_t *eBands = m->eBands;
const celt_int16 *eBands = m->eBands;
const int C = CHANNELS(_C);
N = FRAMESIZE(m);
for (c=0;c<C;c++)
......@@ -88,7 +88,7 @@ void compute_band_energies(const CELTMode *m, const celt_sig_t *X, celt_ener_t *
void normalise_bands(const CELTMode *m, const celt_sig_t * restrict freq, celt_norm_t * restrict X, const celt_ener_t *bank, int _C)
{
int i, c, N;
const celt_int16_t *eBands = m->eBands;
const celt_int16 *eBands = m->eBands;
const int C = CHANNELS(_C);
N = FRAMESIZE(m);
for (c=0;c<C;c++)
......@@ -112,7 +112,7 @@ void normalise_bands(const CELTMode *m, const celt_sig_t * restrict freq, celt_n
void compute_band_energies(const CELTMode *m, const celt_sig_t *X, celt_ener_t *bank, int _C)
{
int i, c, N;
const celt_int16_t *eBands = m->eBands;
const celt_int16 *eBands = m->eBands;
const int C = CHANNELS(_C);
N = FRAMESIZE(m);
for (c=0;c<C;c++)
......@@ -134,7 +134,7 @@ void compute_band_energies(const CELTMode *m, const celt_sig_t *X, celt_ener_t *
void compute_noise_energies(const CELTMode *m, const celt_sig_t *X, const celt_word16_t *tonality, celt_ener_t *bank, int _C)
{
int i, c, N;
const celt_int16_t *eBands = m->eBands;
const celt_int16 *eBands = m->eBands;
const int C = CHANNELS(_C);
N = FRAMESIZE(m);
for (c=0;c<C;c++)
......@@ -157,7 +157,7 @@ void compute_noise_energies(const CELTMode *m, const celt_sig_t *X, const celt_w
void normalise_bands(const CELTMode *m, const celt_sig_t * restrict freq, celt_norm_t * restrict X, const celt_ener_t *bank, int _C)
{
int i, c, N;
const celt_int16_t *eBands = m->eBands;
const celt_int16 *eBands = m->eBands;
const int C = CHANNELS(_C);
N = FRAMESIZE(m);
for (c=0;c<C;c++)
......@@ -177,7 +177,7 @@ void normalise_bands(const CELTMode *m, const celt_sig_t * restrict freq, celt_n
void renormalise_bands(const CELTMode *m, celt_norm_t * restrict X, int _C)
{
int i, c;
const celt_int16_t *eBands = m->eBands;
const celt_int16 *eBands = m->eBands;
const int C = CHANNELS(_C);
for (c=0;c<C;c++)
{
......@@ -191,7 +191,7 @@ void renormalise_bands(const CELTMode *m, celt_norm_t * restrict X, int _C)
void denormalise_bands(const CELTMode *m, const celt_norm_t * restrict X, celt_sig_t * restrict freq, const celt_ener_t *bank, int _C)
{
int i, c, N;
const celt_int16_t *eBands = m->eBands;
const celt_int16 *eBands = m->eBands;
const int C = CHANNELS(_C);
N = FRAMESIZE(m);
if (C>2)
......@@ -333,7 +333,7 @@ void apply_pitch(const CELTMode *m, celt_sig_t *X, const celt_sig_t *P, int gain
static void stereo_band_mix(const CELTMode *m, celt_norm_t *X, celt_norm_t *Y, const celt_ener_t *bank, int stereo_mode, int bandID, int dir)
{
int i = bandID;
const celt_int16_t *eBands = m->eBands;
const celt_int16 *eBands = m->eBands;
int j;
celt_word16_t a1, a2;
if (stereo_mode==0)
......@@ -372,7 +372,7 @@ int folding_decision(const CELTMode *m, celt_norm_t *X, celt_word16_t *average,
int NR=0;
celt_word32_t ratio = EPSILON;
const int C = CHANNELS(_C);
const celt_int16_t * restrict eBands = m->eBands;
const celt_int16 * restrict eBands = m->eBands;
N0 = FRAMESIZE(m);
......@@ -440,7 +440,7 @@ int folding_decision(const CELTMode *m, celt_norm_t *X, celt_word16_t *average,
void quant_bands(const CELTMode *m, celt_norm_t * restrict X, const celt_ener_t *bandE, int *pulses, int shortBlocks, int fold, int total_bits, int encode, void *enc_dec)
{
int i, j, remaining_bits, balance;
const celt_int16_t * restrict eBands = m->eBands;
const celt_int16 * restrict eBands = m->eBands;
celt_norm_t * restrict norm;
VARDECL(celt_norm_t, _norm);
int B;
......@@ -457,7 +457,7 @@ void quant_bands(const CELTMode *m, celt_norm_t * restrict X, const celt_ener_t
int N;
int q;
celt_word16_t n;
const celt_int16_t * const *BPbits;
const celt_int16 * const *BPbits;
int curr_balance, curr_bits;
......@@ -510,7 +510,7 @@ void quant_bands(const CELTMode *m, celt_norm_t * restrict X, const celt_ener_t
void quant_bands_stereo(const CELTMode *m, celt_norm_t *_X, const celt_ener_t *bandE, int *pulses, int shortBlocks, int fold, int total_bits, ec_enc *enc)
{
int i, j, remaining_bits, balance;
const celt_int16_t * restrict eBands = m->eBands;
const celt_int16 * restrict eBands = m->eBands;
celt_norm_t * restrict norm;
VARDECL(celt_norm_t, _norm);
int B;
......@@ -528,7 +528,7 @@ void quant_bands_stereo(const CELTMode *m, celt_norm_t *_X, const celt_ener_t *b
int tell;
int q1, q2;
celt_word16_t n;
const celt_int16_t * const *BPbits;
const celt_int16 * const *BPbits;
int b, qb;
int N;
int curr_balance, curr_bits;
......@@ -741,7 +741,7 @@ void quant_bands_stereo(const CELTMode *m, celt_norm_t *_X, const celt_ener_t *b
void unquant_bands_stereo(const CELTMode *m, celt_norm_t *_X, const celt_ener_t *bandE, int *pulses, int shortBlocks, int fold, int total_bits, ec_dec *dec)
{
int i, j, remaining_bits, balance;
const celt_int16_t * restrict eBands = m->eBands;
const celt_int16 * restrict eBands = m->eBands;
celt_norm_t * restrict norm;
VARDECL(celt_norm_t, _norm);
int B;
......@@ -759,7 +759,7 @@ void unquant_bands_stereo(const CELTMode *m, celt_norm_t *_X, const celt_ener_t
int tell;
int q1, q2;
celt_word16_t n;
const celt_int16_t * const *BPbits;
const celt_int16 * const *BPbits;
int b, qb;
int N;
int curr_balance, curr_bits;
......
......@@ -161,7 +161,7 @@ static c64_fft_t *cache32[NBCACHE] = {NULL,};
c64_fft_t *c64_fft16_alloc(int length, int x, int y)
{
c64_fft_t *state;
celt_int16_t *w, *iw;
celt_int16 *w, *iw;
int i, c;
......@@ -175,13 +175,13 @@ c64_fft_t *c64_fft16_alloc(int length, int x, int y)
state = (c64_fft_t *)celt_alloc(sizeof(c64_fft_t));
state->shift = log(length)/log(2) - ceil(log(length)/log(4)-1);
state->nfft = length;
state->twiddle = celt_alloc(length*2*sizeof(celt_int16_t));
state->itwiddle = celt_alloc(length*2*sizeof(celt_int16_t));
state->twiddle = celt_alloc(length*2*sizeof(celt_int16));
state->itwiddle = celt_alloc(length*2*sizeof(celt_int16));
gen_twiddle16((celt_int16_t *)state->twiddle, length, 32767.0);
gen_twiddle16((celt_int16 *)state->twiddle, length, 32767.0);
w = (celt_int16_t *)state->twiddle;
iw = (celt_int16_t *)state->itwiddle;
w = (celt_int16 *)state->twiddle;
iw = (celt_int16 *)state->itwiddle;
for (i = 0; i < length; i++) {
iw[2*i+0] = w[2*i+0];
......@@ -212,8 +212,8 @@ c64_fft_t *c64_fft32_alloc(int length, int x, int y)
state = (c64_fft_t *)celt_alloc(sizeof(c64_fft_t));
state->shift = log(length)/log(2) - ceil(log(length)/log(4)-1);
state->nfft = length;
state->twiddle = celt_alloc(length*2*sizeof(celt_int32_t));
state->itwiddle = celt_alloc(length*2*sizeof(celt_int32_t));
state->twiddle = celt_alloc(length*2*sizeof(celt_int32));
state->itwiddle = celt_alloc(length*2*sizeof(celt_int32));
// Generate the inverse twiddle first because it does not need scaling
gen_twiddle32(state->itwiddle, length, 2147483647.000000000);
......@@ -243,22 +243,22 @@ void c64_fft32_free(c64_fft_t *state)
}
void c64_fft16_inplace(c64_fft_t * restrict state, celt_int16_t *X)
void c64_fft16_inplace(c64_fft_t * restrict state, celt_int16 *X)
{
int i;
VARDECL(celt_int16_t, cin);
VARDECL(celt_int16_t, cout);
VARDECL(celt_int16, cin);
VARDECL(celt_int16, cout);
SAVE_STACK;
ALLOC(cin, state->nfft*2, celt_int16_t);
ALLOC(cout, state->nfft*2, celt_int16_t);
ALLOC(cin, state->nfft*2, celt_int16);
ALLOC(cout, state->nfft*2, celt_int16);
for (i = 0; i < state->nfft; i++) {
cin[2*i+0] = X[2*i+0];
cin[2*i+1] = X[2*i+1];
}
DSP_fft16x16t((celt_int16_t *)state->twiddle, state->nfft, cin, cout);
DSP_fft16x16t((celt_int16 *)state->twiddle, state->nfft, cin, cout);
for (i = 0; i < state->nfft; i++) {
X[2*i+0] = cout[2*i+0];
......@@ -270,12 +270,12 @@ void c64_fft16_inplace(c64_fft_t * restrict state, celt_int16_t *X)
void c64_fft32(c64_fft_t * restrict state, const celt_int32_t *X, celt_int32_t *Y)
void c64_fft32(c64_fft_t * restrict state, const celt_int32 *X, celt_int32 *Y)
{
int i;
VARDECL(celt_int32_t, cin);
VARDECL(celt_int32, cin);
SAVE_STACK;
ALLOC(cin, state->nfft*2, celt_int32_t);
ALLOC(cin, state->nfft*2, celt_int32);
for (i = 0; i < state->nfft; i++) {
cin[2*i+0] = X[2*i+0] >> state->shift;
......@@ -288,16 +288,16 @@ void c64_fft32(c64_fft_t * restrict state, const celt_int32_t *X, celt_int32_t *
}
void c64_ifft16(c64_fft_t * restrict state, const celt_int16_t *X, celt_int16_t *Y)
void c64_ifft16(c64_fft_t * restrict state, const celt_int16 *X, celt_int16 *Y)
{
int i;
VARDECL(celt_int16_t, cin);
VARDECL(celt_int16_t, cout);
VARDECL(celt_int16, cin);
VARDECL(celt_int16, cout);
SAVE_STACK;
ALLOC(cin, state->nfft*2, celt_int16_t);
if ((celt_int32_t)Y & 7)
ALLOC(cout, state->nfft*2, celt_int16_t);
ALLOC(cin, state->nfft*2, celt_int16);
if ((celt_int32)Y & 7)
ALLOC(cout, state->nfft*2, celt_int16);
else
cout = Y;
......@@ -308,9 +308,9 @@ void c64_ifft16(c64_fft_t * restrict state, const celt_int16_t *X, celt_int16_t
cin[2*i+1] = X[2*i+1];
}
DSP_fft16x16t((celt_int16_t *)state->itwiddle, state->nfft, cin, cout);
DSP_fft16x16t((celt_int16 *)state->itwiddle, state->nfft, cin, cout);
if ((celt_int32_t)Y & 7)
if ((celt_int32)Y & 7)
for (i = 0; i < state->nfft; i++) {
Y[2*i+0] = cout[2*i+0];
Y[2*i+1] = cout[2*i+1];
......@@ -320,12 +320,12 @@ void c64_ifft16(c64_fft_t * restrict state, const celt_int16_t *X, celt_int16_t
}
void c64_ifft32(c64_fft_t * restrict state, const celt_int32_t *X, celt_int32_t *Y)
void c64_ifft32(c64_fft_t * restrict state, const celt_int32 *X, celt_int32 *Y)
{
int i;
VARDECL(celt_int32_t, cin);
VARDECL(celt_int32, cin);
SAVE_STACK;
ALLOC(cin, state->nfft*2, celt_int32_t);
ALLOC(cin, state->nfft*2, celt_int32);
celt_assert(Y & 7 == 0);
......
......@@ -41,18 +41,18 @@
typedef struct {
int nfft;
int shift;
celt_int32_t *twiddle;
celt_int32_t *itwiddle;
celt_int32 *twiddle;
celt_int32 *itwiddle;
} c64_fft_t;
extern c64_fft_t *c64_fft16_alloc(int length, int x, int y);
extern void c64_fft16_free(c64_fft_t *state);
extern void c64_fft16_inplace(c64_fft_t *state, celt_int16_t *X);
extern void c64_ifft16(c64_fft_t *state, const celt_int16_t *X, celt_int16_t *Y);
extern void c64_fft16_inplace(c64_fft_t *state, celt_int16 *X);
extern void c64_ifft16(c64_fft_t *state, const celt_int16 *X, celt_int16 *Y);
extern c64_fft_t *c64_fft32_alloc(int length, int x, int y);
extern void c64_fft32_free(c64_fft_t *state);
extern void c64_fft32(c64_fft_t *state, const celt_int32_t *X, celt_int32_t *Y);
extern void c64_ifft32(c64_fft_t *state, const celt_int32_t *X, celt_int32_t *Y);
extern void c64_fft32(c64_fft_t *state, const celt_int32 *X, celt_int32 *Y);
extern void c64_ifft32(c64_fft_t *state, const celt_int32 *X, celt_int32 *Y);
#endif
......@@ -74,7 +74,7 @@ static const float transientWindow[16] = {
@brief Encoder state
*/
struct CELTEncoder {
celt_uint32_t marker;
celt_uint32 marker;
const CELTMode *mode; /**< Mode used by the encoder */
int frame_size;
int block_size;
......@@ -237,12 +237,12 @@ void celt_encoder_destroy(CELTEncoder *st)
celt_free(st);
}
static inline celt_int16_t FLOAT2INT16(float x)
static inline celt_int16 FLOAT2INT16(float x)
{
x = x*CELT_SIG_SCALE;
x = MAX32(x, -32768);
x = MIN32(x, 32767);
return (celt_int16_t)float2int(x);
return (celt_int16)float2int(x);
}
static inline celt_word16_t SIG2WORD16(celt_sig_t x)
......@@ -517,7 +517,7 @@ static void mdct_shape(const CELTMode *mode, celt_norm_t *X, int start, int end,
#ifdef FIXED_POINT
int celt_encode(CELTEncoder * restrict st, const celt_int16_t * pcm, celt_int16_t * optional_synthesis, unsigned char *compressed, int nbCompressedBytes)
int celt_encode(CELTEncoder * restrict st, const celt_int16 * pcm, celt_int16 * optional_synthesis, unsigned char *compressed, int nbCompressedBytes)
{
#else
int celt_encode_float(CELTEncoder * restrict st, const celt_sig_t * pcm, celt_sig_t * optional_synthesis, unsigned char *compressed, int nbCompressedBytes)
......@@ -630,7 +630,7 @@ int celt_encode_float(CELTEncoder * restrict st, const celt_sig_t * pcm, celt_si
compute_mdcts(st->mode, shortBlocks, in, freq, C);
norm_rate = (nbCompressedBytes-5)*8*(celt_uint32_t)st->mode->Fs/(C*N)>>10;
norm_rate = (nbCompressedBytes-5)*8*(celt_uint32)st->mode->Fs/(C*N)>>10;
/* Pitch analysis: we do it early to save on the peak stack space */
/* Don't use pitch if there isn't enough data available yet,
or if we're using shortBlocks */
......@@ -834,7 +834,7 @@ int celt_encode_float(CELTEncoder * restrict st, const celt_sig_t * pcm, celt_si
int celt_encode_float(CELTEncoder * restrict st, const float * pcm, float * optional_synthesis, unsigned char *compressed, int nbCompressedBytes)
{
int j, ret, C, N;
VARDECL(celt_int16_t, in);
VARDECL(celt_int16, in);
SAVE_STACK;
if (check_encoder(st) != CELT_OK)
......@@ -848,7 +848,7 @@ int celt_encode_float(CELTEncoder * restrict st, const float * pcm, float * opti
C = CHANNELS(st->channels);
N = st->block_size;
ALLOC(in, C*N, celt_int16_t);
ALLOC(in, C*N, celt_int16);
for (j=0;j<C*N;j++)
in[j] = FLOAT2INT16(pcm[j]);
......@@ -866,7 +866,7 @@ int celt_encode_float(CELTEncoder * restrict st, const float * pcm, float * opti
}
#endif /*DISABLE_FLOAT_API*/
#else
int celt_encode(CELTEncoder * restrict st, const celt_int16_t * pcm, celt_int16_t * optional_synthesis, unsigned char *compressed, int nbCompressedBytes)
int celt_encode(CELTEncoder * restrict st, const celt_int16 * pcm, celt_int16 * optional_synthesis, unsigned char *compressed, int nbCompressedBytes)
{
int j, ret, C, N;
VARDECL(celt_sig_t, in);
......@@ -922,7 +922,7 @@ int celt_encoder_ctl(CELTEncoder * restrict st, int request, ...)
break;
case CELT_SET_COMPLEXITY_REQUEST:
{
int value = va_arg(ap, celt_int32_t);
int value = va_arg(ap, celt_int32);
if (value<0 || value>10)
goto bad_arg;
if (value<=2) {
......@@ -937,7 +937,7 @@ int celt_encoder_ctl(CELTEncoder * restrict st, int request, ...)
break;
case CELT_SET_PREDICTION_REQUEST:
{
int value = va_arg(ap, celt_int32_t);
int value = va_arg(ap, celt_int32);
if (value<0 || value>2)
goto bad_arg;
if (value==0)
......@@ -955,7 +955,7 @@ int celt_encoder_ctl(CELTEncoder * restrict st, int request, ...)
break;
case CELT_SET_VBR_RATE_REQUEST:
{
celt_int32_t value = va_arg(ap, celt_int32_t);
celt_int32 value = va_arg(ap, celt_int32);
if (value<0)
goto bad_arg;
if (value>3072000)
......@@ -1016,7 +1016,7 @@ bad_request:
@brief Decoder state
*/
struct CELTDecoder {
celt_uint32_t marker;
celt_uint32 marker;
const CELTMode *mode;
int frame_size;
int block_size;
......@@ -1212,7 +1212,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16_t * restrict
#endif
#ifdef FIXED_POINT
int celt_decode(CELTDecoder * restrict st, const unsigned char *data, int len, celt_int16_t * restrict pcm)
int celt_decode(CELTDecoder * restrict st, const unsigned char *data, int len, celt_int16 * restrict pcm)
{
#else
int celt_decode_float(CELTDecoder * restrict st, const unsigned char *data, int len, celt_sig_t * restrict pcm)
......@@ -1364,7 +1364,7 @@ int celt_decode_float(CELTDecoder * restrict st, const unsigned char *data, int
int celt_decode_float(CELTDecoder * restrict st, const unsigned char *data, int len, float * restrict pcm)
{
int j, ret, C, N;
VARDECL(celt_int16_t, out);
VARDECL(celt_int16, out);
SAVE_STACK;
if (check_decoder(st) != CELT_OK)
......@@ -1379,7 +1379,7 @@ int celt_decode_float(CELTDecoder * restrict st, const unsigned char *data, int
C = CHANNELS(st->channels);
N = st->block_size;
ALLOC(out, C*N, celt_int16_t);
ALLOC(out, C*N, celt_int16);
ret=celt_decode(st, data, len, out);
for (j=0;j<C*N;j++)
pcm[j]=out[j]*(1/32768.);
......@@ -1389,7 +1389,7 @@ int celt_decode_float(CELTDecoder * restrict st, const unsigned char *data, int
}
#endif /*DISABLE_FLOAT_API*/
#else
int celt_decode(CELTDecoder * restrict st, const unsigned char *data, int len, celt_int16_t * restrict pcm)
int celt_decode(CELTDecoder * restrict st, const unsigned char *data, int len, celt_int16 * restrict pcm)
{
int j, ret, C, N;
VARDECL(celt_sig_t, out);
......
......@@ -51,7 +51,7 @@ extern "C" {
#define EXPORT
#endif
#define _celt_check_int(x) (((void)((x) == (celt_int32_t)0)), (celt_int32_t)(x))
#define _celt_check_int(x) (((void)((x) == (celt_int32)0)), (celt_int32)(x))
#define _celt_check_mode_ptr_ptr(ptr) ((ptr) + ((ptr) - (CELTMode**)(ptr)))
/* Error codes */
......@@ -138,7 +138,7 @@ typedef struct CELTMode CELTMode;
@param error Returned error code (if NULL, no error will be returned)
@return A newly created mode
*/
EXPORT CELTMode *celt_mode_create(celt_int32_t Fs, int frame_size, int *error);
EXPORT CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error);
/** Destroys a mode struct. Only call this after all encoders and
decoders using this mode are destroyed as well.
......@@ -147,7 +147,7 @@ EXPORT CELTMode *celt_mode_create(celt_int32_t Fs, int frame_size, int *error);
EXPORT void celt_mode_destroy(CELTMode *mode);
/** Query information from a mode */
EXPORT int celt_mode_info(const CELTMode *mode, int request, celt_int32_t *value);
EXPORT int celt_mode_info(const CELTMode *mode, int request, celt_int32 *value);
/* Encoder stuff */
......@@ -208,7 +208,7 @@ EXPORT int celt_encode_float(CELTEncoder *st, const float *pcm, float *optional_
* the length returned be somehow transmitted to the decoder. Otherwise, no
* decoding is possible.
*/
EXPORT int celt_encode(CELTEncoder *st, const celt_int16_t *pcm, celt_int16_t *optional_synthesis, unsigned char *compressed, int nbCompressedBytes);
EXPORT int celt_encode(CELTEncoder *st, const celt_int16 *pcm, celt_int16 *optional_synthesis, unsigned char *compressed, int nbCompressedBytes);
/** Query and set encoder parameters
@param st Encoder state
......@@ -254,7 +254,7 @@ EXPORT int celt_decode_float(CELTDecoder *st, const unsigned char *data, int len
returned here in 16-bit PCM format (native endian).
@return Error code.
*/
EXPORT int celt_decode(CELTDecoder *st, const unsigned char *data, int len, celt_int16_t *pcm);
EXPORT int celt_decode(CELTDecoder *st, const unsigned char *data, int len, celt_int16 *pcm);
/** Query and set decoder parameters
@param st Decoder state
......
......@@ -45,22 +45,22 @@ extern "C" {
typedef struct {
char codec_id[8]; /**< MUST be "CELT " (four spaces) */
char codec_version[20]; /**< Version used (as string) */
celt_int32_t version_id; /**< Version id (negative for until stream is frozen) */
celt_int32_t header_size; /**< Size of this header */
celt_int32_t sample_rate; /**< Sampling rate of the original audio */
celt_int32_t nb_channels; /**< Number of channels */
celt_int32_t frame_size; /**< Samples per frame (per channel) */
celt_int32_t overlap; /**< Overlapping samples (per channel) */
celt_int32_t bytes_per_packet; /**< Number of bytes per compressed packet (0 if unknown) */
celt_int32_t extra_headers; /**< Number of additional headers that follow this header */
celt_int32 version_id; /**< Version id (negative for until stream is frozen) */
celt_int32 header_size; /**< Size of this header */
celt_int32 sample_rate; /**< Sampling rate of the original audio */
celt_int32 nb_channels; /**< Number of channels */
celt_int32 frame_size; /**< Samples per frame (per channel) */
celt_int32 overlap; /**< Overlapping samples (per channel) */
celt_int32 bytes_per_packet; /**< Number of bytes per compressed packet (0 if unknown) */
celt_int32 extra_headers; /**< Number of additional headers that follow this header */
} CELTHeader;
/** Creates a basic header struct */
EXPORT int celt_header_init(CELTHeader *header, const CELTMode *m, int channels);
EXPORT int celt_header_to_packet(const CELTHeader *header, unsigned char *packet, celt_uint32_t size);
EXPORT int celt_header_to_packet(const CELTHeader *header, unsigned char *packet, celt_uint32 size);
EXPORT int celt_header_from_packet(const unsigned char *packet, celt_uint32_t size, CELTHeader *header);
EXPORT int celt_header_from_packet(const unsigned char *packet, celt_uint32 size, CELTHeader *header);
#ifdef __cplusplus
}
......
......@@ -26,142 +26,114 @@
#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
#include <stdint.h>
typedef int16_t celt_int16_t;
typedef uint16_t celt_uint16_t;
typedef int32_t celt_int32_t;
typedef uint32_t celt_uint32_t;
typedef int64_t celt_int64_t;
typedef uint64_t celt_uint64_t;
typedef int16_t celt_int16;
typedef uint16_t celt_uint16;
typedef int32_t celt_int32;
typedef uint32_t celt_uint32;
#elif defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
typedef _G_int32_t celt_int32_t;
typedef _G_uint32_t celt_uint32_t;
typedef _G_int16_t celt_int16_t;
typedef _G_uint16_t celt_uint16_t;
typedef _G_int64_t celt_int64_t;
typedef _G_uint64_t celt_uint64_t;
typedef _G_int32_t celt_int32;
typedef _G_uint32_t celt_uint32;
typedef _G_int16 celt_int16;
typedef _G_uint16 celt_uint16;
# elif defined(__MINGW32__)
typedef short celt_int16_t;
typedef unsigned short celt_uint16_t;
typedef int celt_int32_t;
typedef unsigned int celt_uint32_t;
typedef long long celt_int64_t;
typedef unsigned long long celt_uint64_t;
typedef short celt_int16;
typedef unsigned short celt_uint16;
typedef int celt_int32;
typedef unsigned int celt_uint32;
# elif defined(__MWERKS__)
typedef int celt_int32_t;
typedef unsigned int celt_uint32_t;
typedef short celt_int16_t;
typedef unsigned short celt_uint16_t;
typedef long long celt_int64_t;
typedef unsigned long long celt_uint64_t;
typedef int celt_int32;
typedef unsigned int celt_uint32;
typedef short celt_int16;
typedef unsigned short celt_uint16;
# else
/* MSVC/Borland */
typedef __int32 celt_int32_t;
typedef unsigned __int32 celt_uint32_t;
typedef __int16 celt_int16_t;
typedef unsigned __int16 celt_uint16_t;
typedef __int64 celt_int64_t;
typedef unsigned __int64 celt_uint64_t;
typedef __int32 celt_int32;
typedef unsigned __int32 celt_uint32;
typedef __int16 celt_int16;
typedef unsigned __int16 celt_uint16;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
typedef SInt16 celt_int16_t;
typedef UInt16 celt_uint16_t;
typedef SInt32 celt_int32_t;
typedef UInt32 celt_uint32_t;
typedef SInt64 celt_int64_t;
typedef UInt64 celt_uint64_t;