Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/celt-0.7.0.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Krautz <mikkel@krautz.dk>2014-01-26 16:14:39 +0400
committerMikkel Krautz <mikkel@krautz.dk>2014-01-26 16:14:39 +0400
commit411011be8ed13ee21053527772f95c2182a85d5a (patch)
treebb8c5c256b483a1e1782432abac954d721e2fead
parent6c79a9325c328f86fa048bf124ff6a8912a60a3e (diff)
Add explicit void * conversions to allow building in C++ mode.
-rw-r--r--libcelt/bands.c8
-rw-r--r--libcelt/celt.c12
-rw-r--r--libcelt/modes.c6
-rw-r--r--libcelt/quant_bands.c2
-rw-r--r--libcelt/rate.c4
5 files changed, 16 insertions, 16 deletions
diff --git a/libcelt/bands.c b/libcelt/bands.c
index 4bcb70e..2ce373b 100644
--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -469,9 +469,9 @@ void quant_bands(const CELTMode *m, celt_norm * restrict X, const celt_ener *ban
BPbits = m->bits;
if (encode)
- tell = ec_enc_tell(enc_dec, BITRES);
+ tell = ec_enc_tell((ec_enc *) enc_dec, BITRES);
else
- tell = ec_dec_tell(enc_dec, BITRES);
+ tell = ec_dec_tell((ec_dec *) enc_dec, BITRES);
if (i != 0)
balance -= tell;
remaining_bits = (total_bits<<BITRES)-tell-1;
@@ -497,9 +497,9 @@ void quant_bands(const CELTMode *m, celt_norm * restrict X, const celt_ener *ban
{
int spread = fold ? B : 0;
if (encode)
- alg_quant(X+eBands[i], eBands[i+1]-eBands[i], q, spread, enc_dec);
+ alg_quant(X+eBands[i], eBands[i+1]-eBands[i], q, spread, (ec_enc *) enc_dec);
else
- alg_unquant(X+eBands[i], eBands[i+1]-eBands[i], q, spread, enc_dec);
+ alg_unquant(X+eBands[i], eBands[i+1]-eBands[i], q, spread, (ec_dec *) enc_dec);
} else {
intra_fold(m, eBands[i+1]-eBands[i], norm, X+eBands[i], eBands[i], B);
}
diff --git a/libcelt/celt.c b/libcelt/celt.c
index e230e10..e164f3a 100644
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -161,7 +161,7 @@ CELTEncoder *celt_encoder_create(const CELTMode *mode, int channels, int *error)
N = mode->mdctSize;
C = channels;
- st = celt_alloc(sizeof(CELTEncoder));
+ st = (CELTEncoder *) celt_alloc(sizeof(CELTEncoder));
if (st==NULL)
{
@@ -185,9 +185,9 @@ CELTEncoder *celt_encoder_create(const CELTMode *mode, int channels, int *error)
st->tonal_average = QCONST16(1.,8);
st->fold_decision = 1;
- st->in_mem = celt_alloc(st->overlap*C*sizeof(celt_sig));
- st->out_mem = celt_alloc((MAX_PERIOD+st->overlap)*C*sizeof(celt_sig));
- st->pitch_buf = celt_alloc(((MAX_PERIOD>>1)+2)*sizeof(celt_word16));
+ st->in_mem = (celt_sig *) celt_alloc(st->overlap*C*sizeof(celt_sig));
+ st->out_mem = (celt_sig *) celt_alloc((MAX_PERIOD+st->overlap)*C*sizeof(celt_sig));
+ st->pitch_buf = (celt_word16 *) celt_alloc(((MAX_PERIOD>>1)+2)*sizeof(celt_word16));
st->oldBandE = (celt_word16*)celt_alloc(C*mode->nbEBands*sizeof(celt_word16));
@@ -1149,7 +1149,7 @@ CELTDecoder *celt_decoder_create(const CELTMode *mode, int channels, int *error)
N = mode->mdctSize;
C = CHANNELS(channels);
- st = celt_alloc(sizeof(CELTDecoder));
+ st = (CELTDecoder *) celt_alloc(sizeof(CELTDecoder));
if (st==NULL)
{
@@ -1165,7 +1165,7 @@ CELTDecoder *celt_decoder_create(const CELTMode *mode, int channels, int *error)
st->overlap = mode->overlap;
st->channels = channels;
- st->decode_mem = celt_alloc((DECODE_BUFFER_SIZE+st->overlap)*C*sizeof(celt_sig));
+ st->decode_mem = (celt_sig *) celt_alloc((DECODE_BUFFER_SIZE+st->overlap)*C*sizeof(celt_sig));
st->out_mem = st->decode_mem+DECODE_BUFFER_SIZE-MAX_PERIOD;
st->oldBandE = (celt_word16*)celt_alloc(C*mode->nbEBands*sizeof(celt_word16));
diff --git a/libcelt/modes.c b/libcelt/modes.c
index 64cac78..dc640fd 100644
--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -141,7 +141,7 @@ static celt_int16 *compute_ebands(celt_int32 Fs, int frame_size, int nbShortMdct
low = ((bark_freq[lin]/res)+(min_bins-1))/min_bins;
high = nBark-lin;
*nbEBands = low+high;
- eBands = celt_alloc(sizeof(celt_int16)*(*nbEBands+2));
+ eBands = (celt_int16 *) celt_alloc(sizeof(celt_int16)*(*nbEBands+2));
if (eBands==NULL)
return NULL;
@@ -190,7 +190,7 @@ static void compute_allocation_table(CELTMode *mode, int res)
break;
mode->nbAllocVectors = BITALLOC_SIZE;
- allocVectors = celt_alloc(sizeof(celt_int16)*(BITALLOC_SIZE*mode->nbEBands));
+ allocVectors = (celt_int16 *) celt_alloc(sizeof(celt_int16)*(BITALLOC_SIZE*mode->nbEBands));
if (allocVectors==NULL)
return;
/* Compute per-codec-band allocation from per-critical-band matrix */
@@ -300,7 +300,7 @@ CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error)
}
res = (Fs+frame_size)/(2*frame_size);
- mode = celt_alloc(sizeof(CELTMode));
+ mode = (CELTMode *) celt_alloc(sizeof(CELTMode));
if (mode==NULL)
goto failure;
mode->marker_start = MODEPARTIAL;
diff --git a/libcelt/quant_bands.c b/libcelt/quant_bands.c
index 23514d3..c1c9f86 100644
--- a/libcelt/quant_bands.c
+++ b/libcelt/quant_bands.c
@@ -67,7 +67,7 @@ int *quant_prob_alloc(const CELTMode *m)
{
int i;
int *prob;
- prob = celt_alloc(4*m->nbEBands*sizeof(int));
+ prob = (int *) celt_alloc(4*m->nbEBands*sizeof(int));
if (prob==NULL)
return NULL;
for (i=0;i<m->nbEBands;i++)
diff --git a/libcelt/rate.c b/libcelt/rate.c
index 6dd4eeb..29bf487 100644
--- a/libcelt/rate.c
+++ b/libcelt/rate.c
@@ -53,7 +53,7 @@ celt_int16 **compute_alloc_cache(CELTMode *m, int C)
celt_int16 **bits;
const celt_int16 *eBands = m->eBands;
- bits = celt_alloc(m->nbEBands*sizeof(celt_int16*));
+ bits = (celt_int16 **) celt_alloc(m->nbEBands*sizeof(celt_int16*));
if (bits==NULL)
return NULL;
@@ -65,7 +65,7 @@ celt_int16 **compute_alloc_cache(CELTMode *m, int C)
{
bits[i] = bits[i-1];
} else {
- bits[i] = celt_alloc(MAX_PSEUDO*sizeof(celt_int16));
+ bits[i] = (celt_int16 *) celt_alloc(MAX_PSEUDO*sizeof(celt_int16));
if (bits[i]!=NULL) {
int j;
celt_int16 tmp[MAX_PULSES];