diff options
author | Jean-Marc Valin <Jean-Marc.Valin@csiro.au> | 2008-02-19 04:21:32 +0300 |
---|---|---|
committer | Jean-Marc Valin <Jean-Marc.Valin@csiro.au> | 2008-02-19 04:21:32 +0300 |
commit | 25358cd407bf159aab845390f8855217e7fbb610 (patch) | |
tree | 5200576feeeb66870c9d0c77c2cb5971c6566ef5 /libcelt/celt.c | |
parent | 224d2dab9c60d1e26ac80b7317151bad3c1b502d (diff) |
Merged the rate allocation atruct directly into the mode struct.
Diffstat (limited to 'libcelt/celt.c')
-rw-r--r-- | libcelt/celt.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/libcelt/celt.c b/libcelt/celt.c index 63d2af1..8f8b019 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -72,8 +72,6 @@ struct CELTEncoder { float *out_mem; float *oldBandE; - - struct alloc_data alloc; }; @@ -118,7 +116,6 @@ CELTEncoder *celt_encoder_new(const CELTMode *mode) st->preemph_memE = celt_alloc(C*sizeof(float));; st->preemph_memD = celt_alloc(C*sizeof(float));; - alloc_init(&st->alloc, st->mode); return st; } @@ -145,8 +142,6 @@ void celt_encoder_destroy(CELTEncoder *st) celt_free(st->preemph_memE); celt_free(st->preemph_memD); - alloc_clear(&st->alloc); - celt_free(st); } @@ -331,7 +326,7 @@ int celt_encode(CELTEncoder *st, celt_int16_t *pcm, unsigned char *compressed, i sum += X[i]*X[i]; printf ("%f\n", sum);*/ /* Residual quantisation */ - quant_bands(st->mode, X, P, mask, &st->alloc, nbCompressedBytes*8, &st->enc); + quant_bands(st->mode, X, P, mask, nbCompressedBytes*8, &st->enc); if (C==2) stereo_mix(st->mode, X, bandE, -1); @@ -427,8 +422,6 @@ struct CELTDecoder { float *oldBandE; int last_pitch_index; - - struct alloc_data alloc; }; CELTDecoder *celt_decoder_new(const CELTMode *mode) @@ -467,8 +460,6 @@ CELTDecoder *celt_decoder_new(const CELTMode *mode) st->preemph_memD = celt_alloc(C*sizeof(float));; st->last_pitch_index = 0; - alloc_init(&st->alloc, st->mode); - return st; } @@ -490,8 +481,6 @@ void celt_decoder_destroy(CELTDecoder *st) celt_free(st->preemph_memD); - alloc_clear(&st->alloc); - celt_free(st); } @@ -587,7 +576,7 @@ int celt_decode(CELTDecoder *st, unsigned char *data, int len, celt_int16_t *pcm pitch_quant_bands(st->mode, X, P, gains); /* Decode fixed codebook and merge with pitch */ - unquant_bands(st->mode, X, P, &st->alloc, len*8, &dec); + unquant_bands(st->mode, X, P, len*8, &dec); if (C==2) stereo_mix(st->mode, X, bandE, -1); |