From 93e47388c0b1b85ae489cd6144442e6fa0d97a33 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Fri, 22 Oct 2010 06:55:10 +0000 Subject: [PATCH] patch from Bruce for portability to embedded environments git-svn-id: https://svn.code.sf.net/p/freetel/code@205 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2/README | 11 +++++++++-- codec2/src/Makefile.am | 1 - codec2/src/Makefile.in | 1 - codec2/src/defines.h | 7 ------- codec2/src/dump.h | 2 ++ codec2/src/four1.c | 5 ++--- codec2/src/nlp.h | 2 ++ codec2/src/phase.c | 1 + codec2/src/sine.h | 3 +++ codec2/unittest/tcodec2.c | 1 + 10 files changed, 20 insertions(+), 14 deletions(-) diff --git a/codec2/README b/codec2/README index 2490fcf1..687ef141 100644 --- a/codec2/README +++ b/codec2/README @@ -9,8 +9,9 @@ For more information please see: Quickstart ---------- -$ cd codec2/src +$ ./configure $ make +$ cd src $ ./c2enc ../raw/hts1a.raw hts1a_c2.bit $ ./c2dec hts1a_c2.bit hts1a_c2.raw $ ../script/menu.sh ../raw/hts1a.raw hts1a_c2.raw @@ -19,6 +20,12 @@ For playback testing, menu.sh requires either the 'play', 'aplay' or 'ossplay' programs to be installed (see http://sox.sourceforge.net/, http://www.alsa-project.org/, or http://www.opensound.com/ respectively). +To enable dump files build using: + +$ make clean +$ CFLAGS=-DDUMP ./configure +$ make + Programs -------- @@ -40,4 +47,4 @@ Directories raw - speech files in raw format (16 bits signed linear 8 KHz) unittest - unit test source code wav - speech files in wave file format - + voicing - hand estimated voicing files diff --git a/codec2/src/Makefile.am b/codec2/src/Makefile.am index 7453de8f..8451899d 100644 --- a/codec2/src/Makefile.am +++ b/codec2/src/Makefile.am @@ -56,7 +56,6 @@ phase.h \ quantise.h \ comp.h \ dump.h \ -globals.h \ lpc.h \ nlp.h \ postfilter.h \ diff --git a/codec2/src/Makefile.in b/codec2/src/Makefile.in index 8828ef47..13b95b55 100644 --- a/codec2/src/Makefile.in +++ b/codec2/src/Makefile.in @@ -251,7 +251,6 @@ phase.h \ quantise.h \ comp.h \ dump.h \ -globals.h \ lpc.h \ nlp.h \ postfilter.h \ diff --git a/codec2/src/defines.h b/codec2/src/defines.h index 93b4d853..679acb79 100644 --- a/codec2/src/defines.h +++ b/codec2/src/defines.h @@ -63,13 +63,6 @@ \*---------------------------------------------------------------------------*/ -/* Complex number */ - -typedef struct { - float real; - float imag; -} COMP; - /* Structure to hold model parameters for one frame */ typedef struct { diff --git a/codec2/src/dump.h b/codec2/src/dump.h index 9f59a558..aebda415 100644 --- a/codec2/src/dump.h +++ b/codec2/src/dump.h @@ -26,6 +26,8 @@ #ifndef __DUMP__ #define __DUMP__ +#include "comp.h" + void dump_on(char filename_prefix[]); void dump_off(); diff --git a/codec2/src/four1.c b/codec2/src/four1.c index 1c1ede59..7713ff1f 100644 --- a/codec2/src/four1.c +++ b/codec2/src/four1.c @@ -13,9 +13,8 @@ #define SWAP(a,b) tempr=(a);(a)=(b);(b)=tempr -void four1(data,nn,isign) -float data[]; -int nn,isign; +void +four1(float * data, int nn, int isign) { int n,mmax,m,j,istep,i; double wtemp,wr,wpr,wpi,wi,theta; diff --git a/codec2/src/nlp.h b/codec2/src/nlp.h index 5348ba59..88a3733d 100644 --- a/codec2/src/nlp.h +++ b/codec2/src/nlp.h @@ -28,6 +28,8 @@ #ifndef __NLP__ #define __NLP__ +#include "comp.h" + void *nlp_create(); void nlp_destroy(void *nlp_state); float nlp(void *nlp_state, float Sn[], int n, int m, int pmin, int pmax, diff --git a/codec2/src/phase.c b/codec2/src/phase.c index e8cee7ec..d9210815 100644 --- a/codec2/src/phase.c +++ b/codec2/src/phase.c @@ -28,6 +28,7 @@ #include "defines.h" #include "phase.h" #include "four1.h" +#include "comp.h" #include #include diff --git a/codec2/src/sine.h b/codec2/src/sine.h index 78e9e10f..d56ac983 100644 --- a/codec2/src/sine.h +++ b/codec2/src/sine.h @@ -28,6 +28,9 @@ #ifndef __SINE__ #define __SINE__ +#include "defines.h" +#include "comp.h" + void make_analysis_window(float w[], COMP W[]); void dft_speech(COMP Sw[], float Sn[], float w[]); void two_stage_pitch_refinement(MODEL *model, COMP Sw[]); diff --git a/codec2/unittest/tcodec2.c b/codec2/unittest/tcodec2.c index b95dd449..dc1eda57 100644 --- a/codec2/unittest/tcodec2.c +++ b/codec2/unittest/tcodec2.c @@ -31,6 +31,7 @@ #include #include #include "defines.h" +#include "comp.h" #include "codec2.h" #include "quantise.h" #include "interp.h" -- 2.25.1