[xiph-cvs] cvs commit: speex/libspeex quant_lsp.c quant_lsp.h sb_celp.c

Jean-Marc Valin jm at xiph.org
Fri Dec 5 06:59:50 PST 2003



jm          03/12/05 09:59:49

  Modified:    libspeex quant_lsp.c quant_lsp.h sb_celp.c
  Log:
  more const stuff, fixed a stupid bug in sb_decoder_ctl

Revision  Changes    Path
1.34      +8 -8      speex/libspeex/quant_lsp.c

Index: quant_lsp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/quant_lsp.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- quant_lsp.c	30 Nov 2003 16:35:21 -0000	1.33
+++ quant_lsp.c	5 Dec 2003 14:59:48 -0000	1.34
@@ -82,14 +82,14 @@
 }
 
 /* Note: x is modified*/
-static int lsp_quant(spx_word16_t *x, signed char *cdbk, int nbVec, int nbDim)
+static int lsp_quant(spx_word16_t *x, const signed char *cdbk, int nbVec, int nbDim)
 {
    int i,j;
    spx_word32_t dist;
    spx_word16_t tmp;
    spx_word32_t best_dist=0;
    int best_id=0;
-   signed char *ptr=cdbk;
+   const signed char *ptr=cdbk;
    for (i=0;i<nbVec;i++)
    {
       dist=0;
@@ -112,14 +112,14 @@
 }
 
 /* Note: x is modified*/
-static int lsp_weight_quant(spx_word16_t *x, spx_word16_t *weight, signed char *cdbk, int nbVec, int nbDim)
+static int lsp_weight_quant(spx_word16_t *x, spx_word16_t *weight, const signed char *cdbk, int nbVec, int nbDim)
 {
    int i,j;
    spx_word32_t dist;
    spx_word16_t tmp;
    spx_word32_t best_dist=0;
    int best_id=0;
-   signed char *ptr=cdbk;
+   const signed char *ptr=cdbk;
    for (i=0;i<nbVec;i++)
    {
       dist=0;
@@ -287,8 +287,8 @@
 }
 
 
-extern signed char high_lsp_cdbk[];
-extern signed char high_lsp_cdbk2[];
+extern const signed char high_lsp_cdbk[];
+extern const signed char high_lsp_cdbk2[];
 
 
 void lsp_quant_high(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits)
@@ -359,8 +359,8 @@
 
 #ifdef EPIC_48K
 
-extern signed char cdbk_lsp_vlbr[5120];
-extern signed char cdbk_lsp2_vlbr[160];
+extern const signed char cdbk_lsp_vlbr[5120];
+extern const signed char cdbk_lsp2_vlbr[160];
 
 void lsp_quant_48k(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits)
 {

<p><p>1.18      +5 -5      speex/libspeex/quant_lsp.h

Index: quant_lsp.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/quant_lsp.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- quant_lsp.h	9 Oct 2003 03:54:37 -0000	1.17
+++ quant_lsp.h	5 Dec 2003 14:59:48 -0000	1.18
@@ -45,11 +45,11 @@
 #define NB_CDBK_SIZE_HIGH2 64
 
 /*Narrowband codebooks*/
-extern signed char cdbk_nb[];
-extern signed char cdbk_nb_low1[];
-extern signed char cdbk_nb_low2[];
-extern signed char cdbk_nb_high1[];
-extern signed char cdbk_nb_high2[];
+extern const signed char cdbk_nb[];
+extern const signed char cdbk_nb_low1[];
+extern const signed char cdbk_nb_low2[];
+extern const signed char cdbk_nb_high1[];
+extern const signed char cdbk_nb_high2[];
 
 /* Quantizes narrowband LSPs with 30 bits */
 void lsp_quant_nb(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits);

<p><p>1.162     +1 -1      speex/libspeex/sb_celp.c

Index: sb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -r1.161 -r1.162
--- sb_celp.c	4 Dec 2003 21:29:18 -0000	1.161
+++ sb_celp.c	5 Dec 2003 14:59:48 -0000	1.162
@@ -1333,7 +1333,7 @@
       st->submodeID = (*(int*)ptr);
       break;
    case SPEEX_SET_LOW_MODE:
-      speex_encoder_ctl(st->st_low, SPEEX_SET_LOW_MODE, ptr);
+      speex_decoder_ctl(st->st_low, SPEEX_SET_LOW_MODE, ptr);
       break;
    case SPEEX_GET_LOW_MODE:
       speex_decoder_ctl(st->st_low, SPEEX_GET_LOW_MODE, ptr);

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list