experimental dLSP quantiser, sounds OK at 32 bits/frame
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 18 Nov 2010 05:22:50 +0000 (05:22 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 18 Nov 2010 05:22:50 +0000 (05:22 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@243 01035d8c-6547-0410-b346-abe4f91aad63

17 files changed:
codec2/src/Makefile.am
codec2/src/Makefile.in
codec2/src/c2sim.c
codec2/src/codebook/dlsp1.txt [new file with mode: 0644]
codec2/src/codebook/dlsp10.txt [new file with mode: 0644]
codec2/src/codebook/dlsp2.txt [new file with mode: 0644]
codec2/src/codebook/dlsp3.txt [new file with mode: 0644]
codec2/src/codebook/dlsp4.txt [new file with mode: 0644]
codec2/src/codebook/dlsp5.txt [new file with mode: 0644]
codec2/src/codebook/dlsp6.txt [new file with mode: 0644]
codec2/src/codebook/dlsp7.txt [new file with mode: 0644]
codec2/src/codebook/dlsp8.txt [new file with mode: 0644]
codec2/src/codebook/dlsp9.txt [new file with mode: 0644]
codec2/src/defines.h
codec2/src/generate_codebook.c
codec2/src/quantise.c
codec2/src/quantise.h

index 6a9378916febfe14bdb54b35c6cbf92e46663128..1aec25caa966adbcc424efccdd5a8c97e1ff5db5 100644 (file)
@@ -4,6 +4,9 @@ NAME = codec2
 AM_CPPFLAGS = $(AM_CFLAGS)
 
 D=codebook
+
+# lsp quantisers
+
 CODEBOOKS= \
   $D/lsp1.txt \
   $D/lsp2.txt \
@@ -16,17 +19,35 @@ CODEBOOKS= \
   $D/lsp9.txt \
   $D/lsp10.txt
 
+# lspd quantisers
+
+CODEBOOKSD= \
+  $D/dlsp1.txt \
+  $D/dlsp2.txt \
+  $D/dlsp3.txt \
+  $D/dlsp4.txt \
+  $D/dlsp5.txt \
+  $D/dlsp6.txt \
+  $D/dlsp7.txt \
+  $D/dlsp8.txt \
+  $D/dlsp9.txt \
+  $D/dlsp10.txt
+
 noinst_PROGRAMS = generate_codebook
 
 codebook.$(OBJEXT): codebook.c
+codebookd.$(OBJEXT): codebookd.c
 
 codebook.lo: codebook.c
 
 codebook.c: generate_codebook $(CODEBOOKS)
-       ./generate_codebook $(CODEBOOKS) > codebook.c
+       ./generate_codebook lsp_cb $(CODEBOOKS) > codebook.c
+
+codebookd.c: generate_codebook $(CODEBOOKSD)
+       ./generate_codebook  lsp_cbd $(CODEBOOKSD) > codebookd.c
 
 clean-local:
-       -rm -f codebook.c
+       -rm -f codebook.c codebookd.c
 
 lib_LTLIBRARIES        = libcodec2.la
 libcodec2_la_SOURCES = dump.c \
@@ -41,7 +62,8 @@ lsp.c \
 phase.c \
 quantise.c \
 pack.c \
-codebook.c
+codebook.c \
+codebookd.c
 
 libcodec2_la_CFLAGS = $(AM_CFLAGS)
 libcodec2_la_LDFLAGS = $(LIBS)
index b1d5107179dd149d99743915f3220f45b00a587c..1efebb03f22a9b491647a715fa5265733535dd40 100644 (file)
@@ -67,7 +67,7 @@ am_libcodec2_la_OBJECTS = libcodec2_la-dump.lo libcodec2_la-lpc.lo \
        libcodec2_la-four1.lo libcodec2_la-interp.lo \
        libcodec2_la-lsp.lo libcodec2_la-phase.lo \
        libcodec2_la-quantise.lo libcodec2_la-pack.lo \
-       libcodec2_la-codebook.lo
+       libcodec2_la-codebook.lo libcodec2_la-codebookd.lo
 libcodec2_la_OBJECTS = $(am_libcodec2_la_OBJECTS)
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
@@ -217,6 +217,8 @@ AUTOMAKE_OPTS = gnu
 NAME = codec2
 AM_CPPFLAGS = $(AM_CFLAGS)
 D = codebook
+
+# lsp quantisers
 CODEBOOKS = \
   $D/lsp1.txt \
   $D/lsp2.txt \
@@ -229,6 +231,20 @@ CODEBOOKS = \
   $D/lsp9.txt \
   $D/lsp10.txt
 
+
+# lspd quantisers
+CODEBOOKSD = \
+  $D/dlsp1.txt \
+  $D/dlsp2.txt \
+  $D/dlsp3.txt \
+  $D/dlsp4.txt \
+  $D/dlsp5.txt \
+  $D/dlsp6.txt \
+  $D/dlsp7.txt \
+  $D/dlsp8.txt \
+  $D/dlsp9.txt \
+  $D/dlsp10.txt
+
 lib_LTLIBRARIES = libcodec2.la
 libcodec2_la_SOURCES = dump.c \
 lpc.c \
@@ -242,7 +258,8 @@ lsp.c \
 phase.c \
 quantise.c \
 pack.c \
-codebook.c
+codebook.c \
+codebookd.c
 
 libcodec2_la_CFLAGS = $(AM_CFLAGS)
 libcodec2_la_LDFLAGS = $(LIBS)
@@ -398,6 +415,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c2sim.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_codebook.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcodec2_la-codebook.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcodec2_la-codebookd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcodec2_la-codec2.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcodec2_la-dump.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcodec2_la-four1.Plo@am__quote@
@@ -523,6 +541,13 @@ libcodec2_la-codebook.lo: codebook.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcodec2_la_CFLAGS) $(CFLAGS) -c -o libcodec2_la-codebook.lo `test -f 'codebook.c' || echo '$(srcdir)/'`codebook.c
 
+libcodec2_la-codebookd.lo: codebookd.c
+@am__fastdepCC_TRUE@   if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcodec2_la_CFLAGS) $(CFLAGS) -MT libcodec2_la-codebookd.lo -MD -MP -MF "$(DEPDIR)/libcodec2_la-codebookd.Tpo" -c -o libcodec2_la-codebookd.lo `test -f 'codebookd.c' || echo '$(srcdir)/'`codebookd.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/libcodec2_la-codebookd.Tpo" "$(DEPDIR)/libcodec2_la-codebookd.Plo"; else rm -f "$(DEPDIR)/libcodec2_la-codebookd.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='codebookd.c' object='libcodec2_la-codebookd.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcodec2_la_CFLAGS) $(CFLAGS) -c -o libcodec2_la-codebookd.lo `test -f 'codebookd.c' || echo '$(srcdir)/'`codebookd.c
+
 mostlyclean-libtool:
        -rm -f *.lo
 
@@ -727,14 +752,18 @@ uninstall-am: uninstall-binPROGRAMS uninstall-info-am \
 
 
 codebook.$(OBJEXT): codebook.c
+codebookd.$(OBJEXT): codebookd.c
 
 codebook.lo: codebook.c
 
 codebook.c: generate_codebook $(CODEBOOKS)
-       ./generate_codebook $(CODEBOOKS) > codebook.c
+       ./generate_codebook lsp_cb $(CODEBOOKS) > codebook.c
+
+codebookd.c: generate_codebook $(CODEBOOKSD)
+       ./generate_codebook  lsp_cbd $(CODEBOOKSD) > codebookd.c
 
 clean-local:
-       -rm -f codebook.c
+       -rm -f codebook.c codebookd.c
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 2ed87de3a743cc7edb692f14f540c3ac7aaa1637..ae320e95f7f3e4056ba65642bdcf0e8c51795490 100644 (file)
@@ -100,7 +100,7 @@ int main(int argc, char *argv[])
   float sum_snr;
 
   int lpc_model, order = 0;
-  int lsp, lsp_quantiser;
+  int lsp, dlsp, lsp_quantiser;
   float ak[LPC_MAX];
   COMP  Sw_[FFT_ENC];
   COMP  Ew[FFT_ENC]; 
@@ -157,6 +157,7 @@ int main(int argc, char *argv[])
      "usage: %s InputFile [-o OutputFile]\n"
      "\t[--lpc Order]\n"
      "\t[--lsp]\n"
+     "\t[--dlsp]\n"
      "\t[--phase0]\n"
      "\t[--postfilter]\n"
      "\t[--hand_voicing]\n"
@@ -206,6 +207,12 @@ int main(int argc, char *argv[])
 
   lsp = switch_present("--lsp",argc,argv);
   lsp_quantiser = 0;
+  if (lsp)
+      assert(order == LPC_ORD);
+
+  dlsp = switch_present("--dlsp",argc,argv);
+  if (dlsp)
+      assert(order == LPC_ORD);
 
   phase0 = switch_present("--phase0",argc,argv);
   if (phase0) {
@@ -262,7 +269,7 @@ int main(int argc, char *argv[])
 
     if (phase0) {
        float Wn[M];                    /* windowed speech samples */
-       float Rk[LPC_ORD+1];            /* autocorrelation coeffs  */
+       float Rk[LPC_MAX+1];            /* autocorrelation coeffs  */
        
 #ifdef DUMP
        dump_phase(&model.phi[0], model.L);
@@ -272,11 +279,8 @@ int main(int argc, char *argv[])
 
        for(i=0; i<M; i++)
            Wn[i] = Sn[i]*w[i];
-       autocorrelate(Wn,Rk,M,LPC_ORD);
-       levinson_durbin(Rk,ak,LPC_ORD);
-
-       if (lpc_model)
-           assert(order == LPC_ORD);
+       autocorrelate(Wn,Rk,M,order);
+       levinson_durbin(Rk,ak,order);
 
 #ifdef DUMP
        dump_ak(ak, LPC_ORD);
@@ -304,10 +308,10 @@ int main(int argc, char *argv[])
     /* optional LPC model amplitudes */
 
     if (lpc_model) {
-       int   lsp_indexes[LPC_ORD];
+       int   lsp_indexes[LPC_MAX];
 
        e = speech_to_uq_lsps(lsps, ak, Sn, w, order);
-       lpc_correction = need_lpc_correction(&model, ak, e);
+       lpc_correction = need_lpc_correction(&model, ak, e, order);
 
        if (lsp) {
            encode_lsps(lsp_indexes, lsps, LPC_ORD);
@@ -316,8 +320,15 @@ int main(int argc, char *argv[])
            lsp_to_lpc(lsps, ak, LPC_ORD);
        }
 
-       e = decode_energy(encode_energy(e));
-       model.Wo = decode_Wo(encode_Wo(model.Wo));
+       if (dlsp) {
+           float lsps_[LPC_ORD];
+
+           lspd_quantise(lsps, lsps_, LPC_ORD);
+           lsp_to_lpc(lsps_, ak, LPC_ORD);
+       }
+
+       //e = decode_energy(encode_energy(e));
+       //model.Wo = decode_Wo(encode_Wo(model.Wo));
 
        aks_to_M2(ak, order, &model, e, &snr, 1); 
        apply_lpc_correction(&model, lpc_correction);
@@ -355,14 +366,15 @@ int main(int argc, char *argv[])
            #endif
            
            if (phase0)
-               phase_synth_zero_order(&interp_model, ak_interp, ex_phase);     
+               phase_synth_zero_order(&interp_model, ak_interp, ex_phase,
+                                      order);  
            if (postfilt)
                postfilter(&interp_model, &bg_est);
            synth_one_frame(buf, &interp_model, Sn_, Pn);
            if (fout != NULL) fwrite(buf,sizeof(short),N,fout);
 
            if (phase0)
-               phase_synth_zero_order(&model, ak, ex_phase);   
+               phase_synth_zero_order(&model, ak, ex_phase, order);    
            if (postfilt)
                postfilter(&model, &bg_est);
            synth_one_frame(buf, &model, Sn_, Pn);
@@ -379,7 +391,7 @@ int main(int argc, char *argv[])
     }
     else {
        if (phase0)
-          phase_synth_zero_order(&model, ak, ex_phase);        
+           phase_synth_zero_order(&model, ak, ex_phase, order);        
        if (postfilt)
            postfilter(&model, &bg_est);
        synth_one_frame(buf, &model, Sn_, Pn);
diff --git a/codec2/src/codebook/dlsp1.txt b/codec2/src/codebook/dlsp1.txt
new file mode 100644 (file)
index 0000000..d126be7
--- /dev/null
@@ -0,0 +1,17 @@
+1 16
+225
+250
+275
+300
+325
+350
+375
+400
+425
+450
+475
+500
+525
+550
+575
+600
diff --git a/codec2/src/codebook/dlsp10.txt b/codec2/src/codebook/dlsp10.txt
new file mode 100644 (file)
index 0000000..dea9dd9
--- /dev/null
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/codec2/src/codebook/dlsp2.txt b/codec2/src/codebook/dlsp2.txt
new file mode 100644 (file)
index 0000000..234bf20
--- /dev/null
@@ -0,0 +1,17 @@
+1 16
+25
+50
+75
+100
+125
+150
+175
+200
+225
+250
+275
+300
+325
+350
+375
+400
diff --git a/codec2/src/codebook/dlsp3.txt b/codec2/src/codebook/dlsp3.txt
new file mode 100644 (file)
index 0000000..b2ee06d
--- /dev/null
@@ -0,0 +1,9 @@
+1 8
+50
+75
+100
+120
+150
+250
+350
+450
diff --git a/codec2/src/codebook/dlsp4.txt b/codec2/src/codebook/dlsp4.txt
new file mode 100644 (file)
index 0000000..dea9dd9
--- /dev/null
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/codec2/src/codebook/dlsp5.txt b/codec2/src/codebook/dlsp5.txt
new file mode 100644 (file)
index 0000000..dea9dd9
--- /dev/null
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/codec2/src/codebook/dlsp6.txt b/codec2/src/codebook/dlsp6.txt
new file mode 100644 (file)
index 0000000..dea9dd9
--- /dev/null
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/codec2/src/codebook/dlsp7.txt b/codec2/src/codebook/dlsp7.txt
new file mode 100644 (file)
index 0000000..dea9dd9
--- /dev/null
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/codec2/src/codebook/dlsp8.txt b/codec2/src/codebook/dlsp8.txt
new file mode 100644 (file)
index 0000000..dea9dd9
--- /dev/null
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/codec2/src/codebook/dlsp9.txt b/codec2/src/codebook/dlsp9.txt
new file mode 100644 (file)
index 0000000..dea9dd9
--- /dev/null
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
index 5d4f8bdcfade29abd3914ff7b447f490f562f30f..21bedd5c8e0e5b86a16dbc541a2bd888512ef3e8 100644 (file)
@@ -82,5 +82,6 @@ struct lsp_codebook {
     const float        *       cb;       /* The elements               */
 };
 extern const struct lsp_codebook lsp_cb[];
+extern const struct lsp_codebook lsp_cbd[];
 
 #endif
index 22df87a195ab9aad9955b64ad2cf8ccfeda39ccd..222f6d7e6f44a72256bb1aecb2cd31979fc84711 100644 (file)
@@ -29,7 +29,7 @@
 #include <math.h>
 
 static const char usage[] =
-"Usage: %s filename [filename ...]\n"
+"Usage: %s filename array_name [filename ...]\n"
 "\tCreate C code for codebook tables.\n";
 
 static const char format[] =
@@ -145,27 +145,27 @@ main(int argc, char * * argv)
     exit(1);
   }
 
-  for ( i = 0; i < argc - 1; i++ ) {
-    FILE *     in = fopen(argv[i + 1], "r");
+  for ( i = 0; i < argc - 2; i++ ) {
+    FILE *     in = fopen(argv[i + 2], "r");
 
     if ( in == NULL ) {
-      perror(argv[i + 1]);
+      perror(argv[i + 2]);
       exit(1);
     }
 
-    cb[i] = load(in, argv[i + 1]);
+    cb[i] = load(in, argv[i + 2]);
 
     fclose(in);
   }
 
   printf(header);
-  for ( i = 0; i < argc - 1; i++ ) {
-    printf("  /* %s */\n", argv[i + 1]);
+  for ( i = 0; i < argc - 2; i++ ) {
+    printf("  /* %s */\n", argv[i + 2]);
     dump_array(cb[i], i);
   }
-  printf("\nconst struct lsp_codebook lsp_cb[] = {\n");
-  for ( i = 0; i < argc - 1; i++ ) {
-    printf("  /* %s */\n", argv[i + 1]);
+  printf("\nconst struct lsp_codebook %s[] = {\n", argv[1]);
+  for ( i = 0; i < argc - 2; i++ ) {
+    printf("  /* %s */\n", argv[i + 2]);
     dump_structure(cb[i], i);
     printf(",\n");
   }
index f4646e695a61c33bb94d9b4fa7815ad80bb95a22..4b6e5eafb4743e1c1de38b3e91efd008978a91a9 100644 (file)
@@ -89,37 +89,6 @@ void quantise_uniform(float *val, float min, float max, int bits)
     printf("index %d  val_: %f\n", index, val[0]);
 }
 
-/*---------------------------------------------------------------------------*\
-                                                                             
-  lspd_quantise
-
-  Simulates differential lsp quantiser
-
-\*---------------------------------------------------------------------------*/
-
-void lsp_quantise(
-  float lsp[], 
-  float lsp_[],
-  int   order
-) 
-{
-    int   i;
-    float dlsp[LPC_MAX];
-    float dlsp_[LPC_MAX];
-
-    dlsp[0] = lsp[0];
-    for(i=1; i<order; i++)
-       dlsp[i] = lsp[i] - lsp[i-1];
-
-    for(i=0; i<order; i++)
-       dlsp_[i] = dlsp[i];
-
-    quantise_uniform(&dlsp_[0], 0.1, 0.5, 5);
-
-    lsp_[0] = dlsp_[0];
-    for(i=1; i<order; i++)
-       lsp_[i] = lsp_[i-1] + dlsp_[i];
-}
 #endif
 
 /*---------------------------------------------------------------------------*\
@@ -176,6 +145,69 @@ long quantise(const float * cb, float vec[], float w[], int k, int m, float *se)
    return(besti);
 }
 
+/*---------------------------------------------------------------------------*\
+                                                                             
+  lspd_quantise
+
+  Differential lsp quantiser
+
+\*---------------------------------------------------------------------------*/
+
+void lspd_quantise(
+  float lsp[], 
+  float lsp_[],
+  int   order
+) 
+{
+    int   i,k,m;
+    float lsp_hz[LPC_MAX];
+    float lsp__hz[LPC_MAX];
+    float dlsp[LPC_MAX];
+    float dlsp_[LPC_MAX];
+    float  wt[1];
+    const float *cb;
+    float se;
+    int   indexes[LPC_MAX];
+
+    /* convert from radians to Hz so we can use human readable
+       frequencies */
+
+    for(i=0; i<order; i++)
+       lsp_hz[i] = (4000.0/PI)*lsp[i];
+
+    dlsp[0] = lsp_hz[0];
+    for(i=1; i<order; i++)
+       dlsp[i] = lsp_hz[i] - lsp_hz[i-1];
+
+    /* simple uniform scalar quantisers */
+
+    wt[0] = 1.0;
+    for(i=0; i<order; i++) {
+       if (i) 
+           dlsp[i] = lsp_hz[i] - lsp__hz[i-1];     
+       else
+           dlsp[0] = lsp_hz[0];
+
+       k = lsp_cbd[i].k;
+       m = lsp_cbd[i].m;
+       cb = lsp_cbd[i].cb;
+       indexes[i] = quantise(cb, &dlsp[i], wt, k, m, &se);
+       dlsp_[i] = cb[indexes[i]*k];
+
+       if (i) 
+           lsp__hz[i] = lsp__hz[i-1] + dlsp_[i];
+       else
+           lsp__hz[0] = dlsp_[0];
+    }
+    for(; i<order; i++)
+       lsp__hz[i] = lsp__hz[i-1] + dlsp[i];
+    
+    /* convert back to radians */
+
+    for(i=0; i<order; i++)
+       lsp_[i] = (PI/4000.0)*lsp__hz[i];
+}
+
 void check_lsp_order(float lsp[], int lpc_order)
 {
     int   i;
@@ -604,7 +636,7 @@ void bw_expand_lsps(float lsp[],
 
 \*---------------------------------------------------------------------------*/
 
-int need_lpc_correction(MODEL *model, float ak[], float E)
+int need_lpc_correction(MODEL *model, float ak[], float E, int order)
 {
     MODEL  tmp;
     float  snr,E1;
@@ -616,7 +648,7 @@ int need_lpc_correction(MODEL *model, float ak[], float E)
     */
 
     memcpy(&tmp, model, sizeof(MODEL));
-    aks_to_M2(ak, LPC_ORD, &tmp, E, &snr, 0);   
+    aks_to_M2(ak, order, &tmp, E, &snr, 0);   
 
     /* 
        Attenuate fundamental by 30dB if F0 < 150 Hz and LPC modelling
@@ -736,7 +768,7 @@ void encode_amplitudes(int    lsp_indexes[],
 
     e = speech_to_uq_lsps(lsps, ak, Sn, w, LPC_ORD);
     encode_lsps(lsp_indexes, lsps, LPC_ORD);
-    *lpc_correction = need_lpc_correction(model, ak, e);
+    *lpc_correction = need_lpc_correction(model, ak, e, LPC_ORD);
     *energy_index = encode_energy(e);
 }
 
index f60372a5db6451ec69de115cabb6d94b71f3a3f0..0f49cf70e16a3827531576a5e4cf27e750d124ae 100644 (file)
@@ -44,6 +44,7 @@ float decode_Wo(int index);
 
 void encode_lsps(int indexes[], float lsp[], int order);
 void decode_lsps(float lsp[], int indexes[], int order);
+void lspd_quantise(float lsp[], float lsp_[], int order);
 
 int encode_energy(float e);
 float decode_energy(int index);
@@ -68,7 +69,7 @@ int  unpack(const unsigned char * bits, unsigned int *nbit, unsigned int index_b
 
 int lsp_bits(int i);
 
-int need_lpc_correction(MODEL *model, float ak[], float E);
+int need_lpc_correction(MODEL *model, float ak[], float E, int order);
 void apply_lpc_correction(MODEL *model, int lpc_correction);
 float speech_to_uq_lsps(float lsp[],
                        float ak[],