Linking with libentcode
authorJean-Marc Valin <Jean-Marc.Valin@csiro.au>
Thu, 6 Dec 2007 04:18:25 +0000 (15:18 +1100)
committerJean-Marc Valin <Jean-Marc.Valin@csiro.au>
Thu, 6 Dec 2007 04:18:25 +0000 (15:18 +1100)
Makefile.am
libcelt/Makefile.am
libcelt/celt.c

index 0095dfa..2370d57 100644 (file)
@@ -5,7 +5,7 @@
 AUTOMAKE_OPTIONS = 1.6
 
 #Fools KDevelop into including all files
-SUBDIRS = libcelt libentcode
+SUBDIRS = libentcode libcelt
 
 rpm: dist
        rpmbuild -ta ${PACKAGE}-${VERSION}.tar.gz
index 42a6060..87f870b 100644 (file)
@@ -21,4 +21,7 @@ noinst_HEADERS = arch.h bands.h celt.h cwrs.h fftwrap.h mdct.h modes.h \
 
 noinst_PROGRAMS = testcelt
 testcelt_SOURCES = testcelt.c
-testcelt_LDADD = $(top_builddir)/libcelt/libcelt.la
+testcelt_LDADD = $(top_builddir)/libentcode/libentcode.la \
+       $(top_builddir)/libcelt/libcelt.la
+INCLUDES = -I$(top_srcdir)/libentcode
+libcelt_la_LIBADD = $(top_builddir)/libentcode/libentcode.la
index 0fdb670..1434f8d 100644 (file)
@@ -37,6 +37,7 @@
 #include "fftwrap.h"
 #include "bands.h"
 #include "modes.h"
+#include "probenc.h"
 
 #define MAX_PERIOD 1024
 
@@ -46,6 +47,9 @@ struct CELTState_ {
    int block_size;
    int nb_blocks;
       
+   ec_byte_buffer buf;
+   ec_enc         enc;
+
    float preemph;
    float preemph_memE;
    float preemph_memD;
@@ -75,6 +79,9 @@ CELTState *celt_encoder_new(const CELTMode *mode)
    st->block_size = N;
    st->nb_blocks  = B;
    
+   ec_byte_writeinit(&st->buf);
+   ec_enc_init(&st->enc,&st->buf);
+
    mdct_init(&st->mdct_lookup, 2*N);
    st->fft = spx_fft_init(MAX_PERIOD);