shithub: opus

Download patch

ref: bc5cedf26ff213b6d35ca892f79c20ecf100c825
parent: 2ec8d9e5227b5875a837b72d89d1a81234c35252
author: Jean-Marc Valin <[email protected]>
date: Thu Dec 6 10:18:25 EST 2007

Linking with libentcode

--- a/Makefile.am
+++ b/Makefile.am
@@ -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
--- a/libcelt/Makefile.am
+++ b/libcelt/Makefile.am
@@ -21,4 +21,7 @@
 
 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
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -37,6 +37,7 @@
 #include "fftwrap.h"
 #include "bands.h"
 #include "modes.h"
+#include "probenc.h"
 
 #define MAX_PERIOD 1024
 
@@ -46,6 +47,9 @@
    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 @@
    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);