Moved the content of libentcode into libcelt to reduce dependencies,
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Mon, 28 Jan 2008 11:28:54 +0000 (22:28 +1100)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Mon, 28 Jan 2008 11:28:54 +0000 (22:28 +1100)
especially now that we have a custom version of that code anyway. Moved
the test code to tests/

34 files changed:
Makefile.am
celt.pc.in
configure.ac
libcelt/Makefile.am
libcelt/bitrdec.c [moved from libentcode/bitrdec.c with 100% similarity]
libcelt/bitrdec.h [moved from libentcode/bitrdec.h with 100% similarity]
libcelt/bitree.c [moved from libentcode/bitree.c with 100% similarity]
libcelt/bitree.h [moved from libentcode/bitree.h with 100% similarity]
libcelt/bitrenc.c [moved from libentcode/bitrenc.c with 100% similarity]
libcelt/bitrenc.h [moved from libentcode/bitrenc.h with 100% similarity]
libcelt/celt.c
libcelt/ecintrin.h [moved from libentcode/ecintrin.h with 100% similarity]
libcelt/entcode.c [moved from libentcode/entcode.c with 100% similarity]
libcelt/entcode.h [moved from libentcode/entcode.h with 100% similarity]
libcelt/entdec.c [moved from libentcode/entdec.c with 100% similarity]
libcelt/entdec.h [moved from libentcode/entdec.h with 100% similarity]
libcelt/entenc.c [moved from libentcode/entenc.c with 100% similarity]
libcelt/entenc.h [moved from libentcode/entenc.h with 100% similarity]
libcelt/laplace.c [moved from libentcode/laplace.c with 100% similarity]
libcelt/laplace.h [moved from libentcode/laplace.h with 100% similarity]
libcelt/mfrngcod.h [moved from libentcode/mfrngcod.h with 100% similarity]
libcelt/mfrngdec.c [moved from libentcode/mfrngdec.c with 100% similarity]
libcelt/mfrngenc.c [moved from libentcode/mfrngenc.c with 100% similarity]
libcelt/probdec.c [moved from libentcode/probdec.c with 100% similarity]
libcelt/probdec.h [moved from libentcode/probdec.h with 100% similarity]
libcelt/probenc.c [moved from libentcode/probenc.c with 100% similarity]
libcelt/probenc.h [moved from libentcode/probenc.h with 100% similarity]
libcelt/probmod.c [moved from libentcode/probmod.c with 100% similarity]
libcelt/probmod.h [moved from libentcode/probmod.h with 100% similarity]
libcelt/rangedec.c [moved from libentcode/rangedec.c with 100% similarity]
libcelt/rangeenc.c [moved from libentcode/rangeenc.c with 100% similarity]
libentcode/Makefile.am [deleted file]
tests/Makefile.am [new file with mode: 0644]
tests/ectest.c [moved from libentcode/ectest.c with 70% similarity]

index eb41049..a55fb9b 100644 (file)
@@ -5,7 +5,7 @@
 AUTOMAKE_OPTIONS = 1.6
 
 #Fools KDevelop into including all files
-SUBDIRS = libentcode libcelt
+SUBDIRS = libcelt tests
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = celt.pc 
index b35836b..98cc008 100644 (file)
@@ -10,5 +10,5 @@ Description: CELT is a low-delay audio codec
 Version: @CELT_VERSION@
 Requires:
 Conflicts:
-Libs: -L${libdir} -lcelt -lentcode -lm
+Libs: -L${libdir} -lcelt -lm
 Cflags: -I${includedir}
index d4dd606..3f21bba 100644 (file)
@@ -121,7 +121,7 @@ fi
 AC_SUBST(SIZE16)
 AC_SUBST(SIZE32)
 
-AC_OUTPUT([Makefile libcelt/Makefile libentcode/Makefile celt.pc])
+AC_OUTPUT([Makefile libcelt/Makefile tests/Makefile celt.pc])
 
 if test "x$src" = "x"; then 
 echo "**IMPORTANT**"
index 65f1c4f..ea383cf 100644 (file)
@@ -10,20 +10,22 @@ pkginclude_HEADERS = celt.h
 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 \
-       psy.c quant_bands.c quant_pitch.c rate.c smallft.c vq.c
+libcelt_la_SOURCES = bands.c bitrdec.c bitree.c bitrenc.c celt.c cwrs.c \
+       ecintrin.h entcode.c  entdec.c entenc.c fftwrap.c laplace.c mdct.c \
+       modes.c pitch.c psy.c quant_bands.c quant_pitch.c rangedec.c \
+       rangeenc.c rate.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 cwrs.h fftwrap.h mdct.h modes.h \
-       os_support.h pgain_table.h pitch.h psy.h quant_bands.h quant_pitch.h rate.h \
-       smallft.h vq.h
+noinst_HEADERS = arch.h bands.h bitrdec.h bitree.h bitrenc.h cwrs.h \
+       ecintrin.h entcode.h entdec.h entenc.h fftwrap.h laplace.h \
+       mfrngcod.h mdct.h modes.h os_support.h pgain_table.h pitch.h psy.h \
+       quant_bands.h quant_pitch.h rate.h smallft.h vq.h
 
 noinst_PROGRAMS = testcelt
 testcelt_SOURCES = testcelt.c
-testcelt_LDADD = $(top_builddir)/libentcode/libentcode.la \
-       libcelt.la
-INCLUDES = -I$(top_srcdir)/libentcode
-libcelt_la_LIBADD = $(top_builddir)/libentcode/libentcode.la
+testcelt_LDADD = libcelt.la
+INCLUDES = 
+libcelt_la_LIBADD = 
similarity index 100%
rename from libentcode/bitrdec.c
rename to libcelt/bitrdec.c
similarity index 100%
rename from libentcode/bitrdec.h
rename to libcelt/bitrdec.h
similarity index 100%
rename from libentcode/bitree.c
rename to libcelt/bitree.c
similarity index 100%
rename from libentcode/bitree.h
rename to libcelt/bitree.h
similarity index 100%
rename from libentcode/bitrenc.c
rename to libcelt/bitrenc.c
similarity index 100%
rename from libentcode/bitrenc.h
rename to libcelt/bitrenc.h
index e2af3a7..cf82f28 100644 (file)
@@ -37,7 +37,7 @@
 #include "fftwrap.h"
 #include "bands.h"
 #include "modes.h"
-#include "probenc.h"
+#include "entcode.h"
 #include "quant_pitch.h"
 #include "quant_bands.h"
 #include "psy.h"
similarity index 100%
rename from libentcode/ecintrin.h
rename to libcelt/ecintrin.h
similarity index 100%
rename from libentcode/entcode.c
rename to libcelt/entcode.c
similarity index 100%
rename from libentcode/entcode.h
rename to libcelt/entcode.h
similarity index 100%
rename from libentcode/entdec.c
rename to libcelt/entdec.c
similarity index 100%
rename from libentcode/entdec.h
rename to libcelt/entdec.h
similarity index 100%
rename from libentcode/entenc.c
rename to libcelt/entenc.c
similarity index 100%
rename from libentcode/entenc.h
rename to libcelt/entenc.h
similarity index 100%
rename from libentcode/laplace.c
rename to libcelt/laplace.c
similarity index 100%
rename from libentcode/laplace.h
rename to libcelt/laplace.h
similarity index 100%
rename from libentcode/mfrngcod.h
rename to libcelt/mfrngcod.h
similarity index 100%
rename from libentcode/mfrngdec.c
rename to libcelt/mfrngdec.c
similarity index 100%
rename from libentcode/mfrngenc.c
rename to libcelt/mfrngenc.c
similarity index 100%
rename from libentcode/probdec.c
rename to libcelt/probdec.c
similarity index 100%
rename from libentcode/probdec.h
rename to libcelt/probdec.h
similarity index 100%
rename from libentcode/probenc.c
rename to libcelt/probenc.c
similarity index 100%
rename from libentcode/probenc.h
rename to libcelt/probenc.h
similarity index 100%
rename from libentcode/probmod.c
rename to libcelt/probmod.c
similarity index 100%
rename from libentcode/probmod.h
rename to libcelt/probmod.h
similarity index 100%
rename from libentcode/rangedec.c
rename to libcelt/rangedec.c
similarity index 100%
rename from libentcode/rangeenc.c
rename to libcelt/rangeenc.c
diff --git a/libentcode/Makefile.am b/libentcode/Makefile.am
deleted file mode 100644 (file)
index 043f8a1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-INCLUDES = 
-METASOURCES = AUTO
-lib_LTLIBRARIES = libentcode.la
-libentcode_la_SOURCES = bitrdec.c bitree.c bitrenc.c ecintrin.h entcode.c \
-       entdec.c entenc.c laplace.c rangedec.c rangeenc.c probdec.c probenc.c probmod.c
-bin_PROGRAMS = ectest
-ectest_SOURCES = ectest.c
-ectest_LDADD = libentcode.la
-noinst_HEADERS = bitrdec.h bitree.h bitrenc.h ecintrin.h entcode.h entdec.h \
-       entenc.h laplace.h mfrngcod.h probdec.h probenc.h probmod.h
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644 (file)
index 0000000..b1abeef
--- /dev/null
@@ -0,0 +1,8 @@
+INCLUDES = -I$(top_srcdir)/libcelt
+METASOURCES = AUTO
+
+TESTS = ectest
+
+bin_PROGRAMS = ectest
+ectest_SOURCES = ectest.c
+ectest_LDADD = $(top_builddir)/libcelt/libcelt.la
similarity index 70%
rename from libentcode/ectest.c
rename to tests/ectest.c
index 0f0fae8..b8d2803 100644 (file)
@@ -1,15 +1,15 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <math.h>
-#include "probenc.h"
-#include "probdec.h"
 #include "bitrenc.h"
+#include "entcode.h"
+#include "entenc.h"
+#include "entdec.h"
 
 int main(int _argc,char **_argv){
   ec_byte_buffer buf;
   ec_enc         enc;
   ec_dec         dec;
-  ec_probmod     mod;
   ec_uint64      sym64;
   long           nbits;
   long           nbits2;
@@ -53,26 +53,6 @@ int main(int _argc,char **_argv){
       }
     }
   }
-  for(sz=1;sz<256;sz++){
-    ec_probmod_init_full(&mod,sz,1,sz+(sz>>1),NULL);
-    for(i=0;i<sz;i++){
-      s=((unsigned)(i*45678901+7))%sz;
-      entropy+=(log(mod.ft)-log(ec_bitree_get_freq(mod.bitree,s)))*M_LOG2E;
-      ec_probmod_write(&mod,&enc,s);
-    }
-    ec_probmod_clear(&mod);
-  }
-  for(sz=11;sz<256;sz++){
-    ec_probmod_init_full(&mod,sz,1,sz+(sz>>1),NULL);
-    for(i=0;i<sz;i++){
-      s=((unsigned)(i*45678901+7))%sz;
-      entropy+=(log(ec_bitree_get_cumul(mod.bitree,EC_MINI(s+6,sz))-
-       ec_bitree_get_cumul(mod.bitree,EC_MAXI(s-5,0)))-
-       log(ec_bitree_get_freq(mod.bitree,s)))*M_LOG2E;
-      ec_probmod_write_range(&mod,&enc,s,EC_MAXI(s-5,0),EC_MINI(s+6,sz));
-    }
-    ec_probmod_clear(&mod);
-  }
   nbits=ec_enc_tell(&enc,4);
   ec_enc_done(&enc);
   fprintf(stderr,
@@ -109,30 +89,6 @@ int main(int _argc,char **_argv){
       }
     }
   }
-  for(sz=1;sz<256;sz++){
-    ec_probmod_init_full(&mod,sz,1,sz+(sz>>1),NULL);
-    for(i=0;i<sz;i++){
-      s=((unsigned)(i*45678901+7))%sz;
-      sym=ec_probmod_read(&mod,&dec);
-      if(sym!=s){
-        fprintf(stderr,"Decoded %i instead of %i with sz of %i.\n",sym,s,sz);
-        return -1;
-      }
-    }
-    ec_probmod_clear(&mod);
-  }
-  for(sz=11;sz<256;sz++){
-    ec_probmod_init_full(&mod,sz,1,sz+(sz>>1),NULL);
-    for(i=0;i<sz;i++){
-      s=((unsigned)(i*45678901+7))%sz;
-      sym=ec_probmod_read_range(&mod,&dec,EC_MAXI(s-5,0),EC_MINI(s+6,sz));
-      if(sym!=s){
-        fprintf(stderr,"Decoded %i instead of %i with sz of %i.\n",sym,s,sz);
-        return -1;
-      }
-    }
-    ec_probmod_clear(&mod);
-  }
   nbits2=ec_dec_tell(&dec,4);
   if(nbits!=nbits2){
     fprintf(stderr,