diff --git a/libcelt/Makefile.am b/libcelt/Makefile.am index cd198bff..42a6060b 100644 --- a/libcelt/Makefile.am +++ b/libcelt/Makefile.am @@ -10,14 +10,14 @@ lib_LTLIBRARIES = libcelt.la # Sources for compilation in the library libcelt_la_SOURCES = bands.c celt.c cwrs.c fftwrap.c mdct.c modes.c pitch.c \ - smallft.c vq.c + quant_bands.c smallft.c vq.c #noinst_HEADERS = libcelt_la_LDFLAGS = -version-info @CELT_LT_CURRENT@:@CELT_LT_REVISION@:@CELT_LT_AGE@ noinst_HEADERS = arch.h bands.h celt.h cwrs.h fftwrap.h mdct.h modes.h \ - os_support.h pitch.h smallft.h vq.h + os_support.h pitch.h quant_bands.h smallft.h vq.h noinst_PROGRAMS = testcelt testcelt_SOURCES = testcelt.c diff --git a/libcelt/celt.c b/libcelt/celt.c index 44799d9c..0fdb6701 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -58,6 +58,7 @@ struct CELTState_ { float *mdct_overlap; float *out_mem; + float *oldBandE; }; @@ -84,6 +85,8 @@ CELTState *celt_encoder_new(const CELTMode *mode) for (i=0;iwindow[i] = st->window[2*N-i-1] = sin(.5*M_PI* sin(.5*M_PI*(i+.5)/N) * sin(.5*M_PI*(i+.5)/N)); + st->oldBandE = celt_alloc(mode->nbEBands*sizeof(float)); + st->preemph = 0.8; return st; } @@ -200,14 +203,16 @@ int celt_encode(CELTState *st, short *pcm) /* Band normalisation */ compute_band_energies(st->mode, X, bandE); normalise_bands(st->mode, X, bandE); + //for (i=0;imode->nbEBands;i++)printf("%f ", bandE[i]);printf("\n"); - //for (i=0;imode->nbEBands]; compute_band_energies(st->mode, P, bandEp); normalise_bands(st->mode, P, bandEp); } + quant_energy(st->mode, bandE, st->oldBandE); + /* Pitch prediction */ compute_pitch_gain(st->mode, X, P, gains, bandE); //quantise_pitch(gains, PBANDS);