diff options
Diffstat (limited to 'libspeex')
-rw-r--r-- | libspeex/speex.c | 21 | ||||
-rw-r--r-- | libspeex/speex.h | 5 |
2 files changed, 23 insertions, 3 deletions
diff --git a/libspeex/speex.c b/libspeex/speex.c index 1430695..39bb448 100644 --- a/libspeex/speex.c +++ b/libspeex/speex.c @@ -106,7 +106,6 @@ void encoder_init(EncState *st, SpeexMode *mode) st->interp_qlpc = malloc((st->lpcSize+1)*sizeof(float)); st->bw_lpc1 = malloc((st->lpcSize+1)*sizeof(float)); st->bw_lpc2 = malloc((st->lpcSize+1)*sizeof(float)); - st->bw_az = malloc((st->lpcSize*2+1)*sizeof(float)); st->lsp = malloc(st->lpcSize*sizeof(float)); st->qlsp = malloc(st->lpcSize*sizeof(float)); @@ -138,7 +137,6 @@ void encoder_destroy(EncState *st) free(st->bw_lpc1); free(st->bw_lpc2); - free(st->bw_az); free(st->autocorr); free(st->lagWindow); free(st->lsp); @@ -465,6 +463,8 @@ void decoder_init(DecState *st, SpeexMode *mode) st->bufSize = mode->bufSize; st->gamma1=mode->gamma1; st->gamma2=mode->gamma2; + st->min_pitch=mode->pitchStart; + st->max_pitch=mode->pitchEnd; st->inBuf = malloc(st->bufSize*sizeof(float)); @@ -475,14 +475,31 @@ void decoder_init(DecState *st, SpeexMode *mode) st->inBuf[i]=0; for (i=0;i<st->bufSize;i++) st->excBuf[i]=0; + + st->interp_qlpc = malloc((st->lpcSize+1)*sizeof(float)); + st->bw_lpc1 = malloc((st->lpcSize+1)*sizeof(float)); + st->bw_lpc2 = malloc((st->lpcSize+1)*sizeof(float)); + + st->qlsp = malloc(st->lpcSize*sizeof(float)); + st->old_qlsp = malloc(st->lpcSize*sizeof(float)); + st->interp_qlsp = malloc(st->lpcSize*sizeof(float)); + } void decoder_destroy(DecState *st) { free(st->inBuf); free(st->excBuf); + free(st->interp_qlpc); + free(st->bw_lpc1); + free(st->bw_lpc2); + free(st->qlsp); + free(st->old_qlsp); + free(st->interp_qlsp); + } void decode(DecState *st, FrameBits *bits, float *out) { + int id = frame_bits_unpack_signed(bits, 30); } diff --git a/libspeex/speex.h b/libspeex/speex.h index af44236..1e625bf 100644 --- a/libspeex/speex.h +++ b/libspeex/speex.h @@ -64,7 +64,6 @@ typedef struct EncState { float *interp_qlpc; /* Interpolated quantized LPCs */ float *bw_lpc1; /* LPCs after bandwidth expansion by gamma1 for perceptual weighting*/ float *bw_lpc2; /* LPCs after bandwidth expansion by gamma2 for perceptual weighting*/ - float *bw_az; /* Convolution of bw_lpc2 and interp_qlpc */ float *rc; /* Reflection coefficients */ float *mem_sp, *mem_sw; float *dmem1, *dmem2; @@ -78,6 +77,8 @@ typedef struct DecState { int windowSize; /* Analysis (LPC) window length */ int lpcSize; /* LPC order */ int bufSize; /* Buffer size */ + int min_pitch; /* Minimum pitch value allowed */ + int max_pitch; /* Maximum pitch value allowed */ float gamma1; /* Perceptual filter: A(z/gamma1) */ float gamma2; /* Perceptual filter: A(z/gamma2) */ float *inBuf; /* Input buffer (original signal) */ @@ -88,6 +89,8 @@ typedef struct DecState { float *old_qlsp; /* Quantized LSPs for previous frame */ float *interp_qlsp; /* Interpolated quantized LSPs */ float *interp_qlpc; /* Interpolated quantized LPCs */ + float *bw_lpc1; /* LPCs after bandwidth expansion by gamma1 for perceptual weighting*/ + float *bw_lpc2; /* LPCs after bandwidth expansion by gamma2 for perceptual weighting*/ } DecState; |