[xiph-cvs] cvs commit: speex/src speexdec.c speexenc.c
Jean-Marc Valin
jm at xiph.org
Thu Dec 4 13:29:19 PST 2003
jm 03/12/04 16:29:19
Modified: . configure.in
libspeex cb_search.c cb_search.h exc_10_16_table.c
exc_10_32_table.c exc_20_32_table.c
exc_5_256_table.c exc_5_64_table.c
exc_8_128_table.c filters.c filters.h fixed_debug.h
gain_table.c gain_table_lbr.c hexc_10_32_table.c
hexc_table.c high_lsp_tables.c lbr_48k_tables.c
lsp_tables_nb.c ltp.c ltp.h modes.c modes.h
nb_celp.c nb_celp.h preprocess.c sb_celp.c
sb_celp.h speex.h speex_header.c speex_header.h
stereo.c vq.c vq.h
src speexdec.c speexenc.c
Log:
Added const's all over the place
Revision Changes Path
1.60 +3 -0 speex/configure.in
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/speex/configure.in,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- configure.in 1 Dec 2003 03:03:19 -0000 1.59
+++ configure.in 4 Dec 2003 21:29:17 -0000 1.60
@@ -26,6 +26,9 @@
AM_PROG_LIBTOOL
AC_C_BIGENDIAN
+AC_C_CONST
+AC_C_INLINE
+
AC_CHECK_HEADERS(sys/soundcard.h sys/audioio.h)
AC_ARG_ENABLE(ogg,
<p><p>1.104 +7 -7 speex/libspeex/cb_search.c
Index: cb_search.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/cb_search.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -r1.103 -r1.104
--- cb_search.c 30 Nov 2003 05:46:03 -0000 1.103
+++ cb_search.c 4 Dec 2003 21:29:17 -0000 1.104
@@ -42,7 +42,7 @@
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
-void *par, /* Codebook/search parameters*/
+const void *par, /* Codebook/search parameters*/
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
@@ -63,7 +63,7 @@
spx_word16_t **ot, **nt;
int **nind, **oind;
int *ind;
- signed char *shape_cb;
+ const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect;
split_cb_params *params;
int N=2;
@@ -133,7 +133,7 @@
for (i=0;i<shape_cb_size;i++)
{
spx_word16_t *res;
- signed char *shape;
+ const signed char *shape;
res = resp+i*subvect_size;
shape = shape_cb+i*subvect_size;
@@ -333,7 +333,7 @@
void split_cb_shape_sign_unquant(
spx_sig_t *exc,
-void *par, /* non-overlapping codebook */
+const void *par, /* non-overlapping codebook */
int nsf, /* number of samples in subframe */
SpeexBits *bits,
char *stack
@@ -341,7 +341,7 @@
{
int i,j;
int *ind, *signs;
- signed char *shape_cb;
+ const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect;
split_cb_params *params;
int have_sign;
@@ -392,7 +392,7 @@
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
-void *par, /* Codebook/search parameters*/
+const void *par, /* Codebook/search parameters*/
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
@@ -416,7 +416,7 @@
void noise_codebook_unquant(
spx_sig_t *exc,
-void *par, /* non-overlapping codebook */
+const void *par, /* non-overlapping codebook */
int nsf, /* number of samples in subframe */
SpeexBits *bits,
char *stack
<p><p>1.31 +5 -5 speex/libspeex/cb_search.h
Index: cb_search.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/cb_search.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- cb_search.h 8 Oct 2003 04:40:41 -0000 1.30
+++ cb_search.h 4 Dec 2003 21:29:17 -0000 1.31
@@ -39,7 +39,7 @@
typedef struct split_cb_params {
int subvect_size;
int nb_subvect;
- signed char *shape_cb;
+ const signed char *shape_cb;
int shape_bits;
int have_sign;
} split_cb_params;
@@ -50,7 +50,7 @@
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
-void *par, /* Codebook/search parameters*/
+const void *par, /* Codebook/search parameters*/
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
@@ -62,7 +62,7 @@
void split_cb_shape_sign_unquant(
spx_sig_t *exc,
-void *par, /* non-overlapping codebook */
+const void *par, /* non-overlapping codebook */
int nsf, /* number of samples in subframe */
SpeexBits *bits,
char *stack
@@ -74,7 +74,7 @@
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
-void *par, /* Codebook/search parameters*/
+const void *par, /* Codebook/search parameters*/
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
@@ -87,7 +87,7 @@
void noise_codebook_unquant(
spx_sig_t *exc,
-void *par, /* non-overlapping codebook */
+const void *par, /* non-overlapping codebook */
int nsf, /* number of samples in subframe */
SpeexBits *bits,
char *stack
<p><p>1.5 +1 -1 speex/libspeex/exc_10_16_table.c
Index: exc_10_16_table.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/exc_10_16_table.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- exc_10_16_table.c 5 Feb 2003 06:01:52 -0000 1.4
+++ exc_10_16_table.c 4 Dec 2003 21:29:17 -0000 1.5
@@ -31,7 +31,7 @@
*/
-signed char exc_10_16_table[160] = {
+const signed char exc_10_16_table[160] = {
22,39,14,44,11,35,-2,23,-4,6,
46,-28,13,-27,-23,12,4,20,-5,9,
37,-18,-23,23,0,9,-6,-20,4,-1,
<p><p>1.7 +1 -1 speex/libspeex/exc_10_32_table.c
Index: exc_10_32_table.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/exc_10_32_table.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- exc_10_32_table.c 5 Feb 2003 06:01:52 -0000 1.6
+++ exc_10_32_table.c 4 Dec 2003 21:29:17 -0000 1.7
@@ -31,7 +31,7 @@
*/
-signed char exc_10_32_table[320] = {
+const signed char exc_10_32_table[320] = {
7,17,17,27,25,22,12,4,-3,0,
28,-36,39,-24,-15,3,-9,15,-5,10,
31,-28,11,31,-21,9,-11,-11,-2,-7,
<p><p>1.5 +1 -1 speex/libspeex/exc_20_32_table.c
Index: exc_20_32_table.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/exc_20_32_table.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- exc_20_32_table.c 5 Feb 2003 06:01:52 -0000 1.4
+++ exc_20_32_table.c 4 Dec 2003 21:29:17 -0000 1.5
@@ -31,7 +31,7 @@
*/
-signed char exc_20_32_table[640] = {
+const signed char exc_20_32_table[640] = {
12,32,25,46,36,33,9,14,-3,6,1,-8,0,-10,-5,-7,-7,-7,-5,-5,
31,-27,24,-32,-4,10,-11,21,-3,19,23,-9,22,24,-10,-1,-10,-13,-7,-11,
42,-33,31,19,-8,0,-10,-16,1,-21,-17,10,-8,14,8,4,11,-2,5,-2,
<p><p>1.6 +1 -1 speex/libspeex/exc_5_256_table.c
Index: exc_5_256_table.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/exc_5_256_table.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- exc_5_256_table.c 31 Jan 2003 01:42:53 -0000 1.5
+++ exc_5_256_table.c 4 Dec 2003 21:29:17 -0000 1.6
@@ -31,7 +31,7 @@
*/
-signed char exc_5_256_table[1280] = {
+const signed char exc_5_256_table[1280] = {
-8,-37,5,-43,5,
73,61,39,12,-3,
-61,-32,2,42,30,
<p><p>1.8 +1 -1 speex/libspeex/exc_5_64_table.c
Index: exc_5_64_table.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/exc_5_64_table.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- exc_5_64_table.c 31 Jan 2003 01:42:53 -0000 1.7
+++ exc_5_64_table.c 4 Dec 2003 21:29:17 -0000 1.8
@@ -31,7 +31,7 @@
*/
-signed char exc_5_64_table[320]={
+const signed char exc_5_64_table[320]={
1,5,-15,49,-66,
-48,-4,50,-44,7,
37,16,-18,25,-26,
<p><p>1.7 +1 -1 speex/libspeex/exc_8_128_table.c
Index: exc_8_128_table.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/exc_8_128_table.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- exc_8_128_table.c 5 Feb 2003 06:01:52 -0000 1.6
+++ exc_8_128_table.c 4 Dec 2003 21:29:17 -0000 1.7
@@ -31,7 +31,7 @@
*/
-signed char exc_8_128_table[1024] = {
+const signed char exc_8_128_table[1024] = {
-14,9,13,-32,2,-10,31,-10,
-8,-8,6,-4,-1,10,-64,23,
6,20,13,6,8,-22,16,34,
<p><p>1.74 +19 -19 speex/libspeex/filters.c
Index: filters.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/filters.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- filters.c 1 Dec 2003 01:00:47 -0000 1.73
+++ filters.c 4 Dec 2003 21:29:17 -0000 1.74
@@ -38,7 +38,7 @@
#include "ltp.h"
#ifdef FIXED_POINT
-void bw_lpc(spx_word16_t gamma, spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order)
+void bw_lpc(spx_word16_t gamma, const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order)
{
int i;
spx_word16_t tmp=gamma;
@@ -50,7 +50,7 @@
}
}
#else
-void bw_lpc(spx_word16_t gamma, spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order)
+void bw_lpc(spx_word16_t gamma, const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order)
{
int i;
float tmp=1;
@@ -67,7 +67,7 @@
#ifdef FIXED_POINT
/* FIXME: These functions are ugly and probably introduce too much error */
-void signal_mul(spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
+void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
{
int i;
for (i=0;i<len;i++)
@@ -76,7 +76,7 @@
}
}
-void signal_div(spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
+void signal_div(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
{
int i;
spx_word16_t scale_1;
@@ -94,14 +94,14 @@
#else
-void signal_mul(spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
+void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
{
int i;
for (i=0;i<len;i++)
y[i] = scale*x[i];
}
-void signal_div(spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
+void signal_div(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
{
int i;
float scale_1 = 1/scale;
@@ -114,7 +114,7 @@
#ifdef FIXED_POINT
-int normalize16(spx_sig_t *x, spx_word16_t *y, int max_scale, int len)
+int normalize16(const spx_sig_t *x, spx_word16_t *y, int max_scale, int len)
{
int i;
spx_sig_t max_val=1;
@@ -142,7 +142,7 @@
return sig_shift;
}
-spx_word16_t compute_rms(spx_sig_t *x, int len)
+spx_word16_t compute_rms(const spx_sig_t *x, int len)
{
int i;
spx_word32_t sum=0;
@@ -184,7 +184,7 @@
}
-void filter_mem2(spx_sig_t *x, spx_coef_t *num, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
+void filter_mem2(const spx_sig_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
{
int i,j;
spx_sig_t xi,yi,nyi;
@@ -205,7 +205,7 @@
}
}
-void iir_mem2(spx_sig_t *x, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
+void iir_mem2(const spx_sig_t *x, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
{
int i,j;
spx_word32_t xi,yi,nyi;
@@ -227,7 +227,7 @@
}
-void fir_mem2(spx_sig_t *x, spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
+void fir_mem2(const spx_sig_t *x, const spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
{
int i,j;
spx_word32_t xi,yi;
@@ -252,7 +252,7 @@
-spx_word16_t compute_rms(spx_sig_t *x, int len)
+spx_word16_t compute_rms(const spx_sig_t *x, int len)
{
int i;
float sum=0;
@@ -268,7 +268,7 @@
#else
-void filter_mem2(spx_sig_t *x, spx_coef_t *num, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
+void filter_mem2(const spx_sig_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
{
int i,j;
float xi,yi;
@@ -286,7 +286,7 @@
}
-void iir_mem2(spx_sig_t *x, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
+void iir_mem2(const spx_sig_t *x, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
{
int i,j;
for (i=0;i<N;i++)
@@ -303,7 +303,7 @@
#endif
-void fir_mem2(spx_sig_t *x, spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
+void fir_mem2(const spx_sig_t *x, const spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
{
int i,j;
float xi;
@@ -323,7 +323,7 @@
#endif
-void syn_percep_zero(spx_sig_t *xx, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack)
+void syn_percep_zero(const spx_sig_t *xx, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack)
{
int i;
spx_mem_t *mem = PUSH(stack,ord, spx_mem_t);
@@ -335,7 +335,7 @@
filter_mem2(y, awk1, awk2, y, N, ord, mem);
}
-void residue_percep_zero(spx_sig_t *xx, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack)
+void residue_percep_zero(const spx_sig_t *xx, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack)
{
int i;
spx_mem_t *mem = PUSH(stack,ord, spx_mem_t);
@@ -347,7 +347,7 @@
fir_mem2(y, awk2, y, N, ord, mem);
}
-void qmf_decomp(short *xx, spx_word16_t *aa, spx_sig_t *y1, spx_sig_t *y2, int N, int M, spx_word16_t *mem, char *stack)
+void qmf_decomp(const short *xx, const spx_word16_t *aa, spx_sig_t *y1, spx_sig_t *y2, int N, int M, spx_word16_t *mem, char *stack)
{
int i,j,k,M2;
spx_word16_t *a;
@@ -384,7 +384,7 @@
/* By segher */
-void fir_mem_up(spx_sig_t *x, spx_word16_t *a, spx_sig_t *y, int N, int M, spx_word32_t *mem, char *stack)
+void fir_mem_up(const spx_sig_t *x, const spx_word16_t *a, spx_sig_t *y, int N, int M, spx_word32_t *mem, char *stack)
/* assumptions:
all odd x[i] are zero -- well, actually they are left out of the array now
N and M are multiples of 4 */
<p><p>1.37 +13 -13 speex/libspeex/filters.h
Index: filters.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/filters.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- filters.h 1 Dec 2003 01:00:48 -0000 1.36
+++ filters.h 4 Dec 2003 21:29:17 -0000 1.37
@@ -35,13 +35,13 @@
#include "misc.h"
-spx_word16_t compute_rms(spx_sig_t *x, int len);
-void signal_mul(spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
-void signal_div(spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
+spx_word16_t compute_rms(const spx_sig_t *x, int len);
+void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
+void signal_div(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
#ifdef FIXED_POINT
-int normalize16(spx_sig_t *x, spx_word16_t *y, int max_scale, int len);
+int normalize16(const spx_sig_t *x, spx_word16_t *y, int max_scale, int len);
#endif
@@ -52,25 +52,25 @@
} CombFilterMem;
-void qmf_decomp(short *xx, spx_word16_t *aa, spx_sig_t *y1, spx_sig_t *y2, int N, int M, spx_word16_t *mem, char *stack);
-void fir_mem_up(spx_sig_t *x, spx_word16_t *a, spx_sig_t *y, int N, int M, spx_word32_t *mem, char *stack);
+void qmf_decomp(const short *xx, const spx_word16_t *aa, spx_sig_t *y1, spx_sig_t *y2, int N, int M, spx_word16_t *mem, char *stack);
+void fir_mem_up(const spx_sig_t *x, const spx_word16_t *a, spx_sig_t *y, int N, int M, spx_word32_t *mem, char *stack);
-void filter_mem2(spx_sig_t *x, spx_coef_t *num, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
-void fir_mem2(spx_sig_t *x, spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
-void iir_mem2(spx_sig_t *x, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
+void filter_mem2(const spx_sig_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
+void fir_mem2(const spx_sig_t *x, const spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
+void iir_mem2(const spx_sig_t *x, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
/* Apply bandwidth expansion on LPC coef */
-void bw_lpc(spx_word16_t gamma, spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
+void bw_lpc(spx_word16_t gamma, const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
/* FIR filter */
-void fir_decim_mem(spx_sig_t *x, float *a, spx_sig_t *y, int N, int M, float *mem);
+void fir_decim_mem(const spx_sig_t *x, const float *a, spx_sig_t *y, int N, int M, float *mem);
-void syn_percep_zero(spx_sig_t *x, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack);
+void syn_percep_zero(const spx_sig_t *x, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack);
-void residue_percep_zero(spx_sig_t *xx, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack);
+void residue_percep_zero(const spx_sig_t *xx, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack);
void comb_filter_mem_init (CombFilterMem *mem);
<p><p>1.6 +18 -18 speex/libspeex/fixed_debug.h
Index: fixed_debug.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/fixed_debug.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- fixed_debug.h 30 Nov 2003 05:46:03 -0000 1.5
+++ fixed_debug.h 4 Dec 2003 21:29:17 -0000 1.6
@@ -78,11 +78,11 @@
long long res;
if (!VERIFY_INT(a) || !VERIFY_INT(b))
{
- fprintf (stderr, "ADD32: inputs are not int: %d %d\n", a, b);
+ fprintf (stderr, "ADD32: inputs are not int: %d %d\n", (int)a, (int)b);
}
res = a+b;
if (!VERIFY_INT(res))
- fprintf (stderr, "ADD32: output is not int: %d\n", res);
+ fprintf (stderr, "ADD32: output is not int: %d\n", (int)res);
spx_mips++;
return res;
}
@@ -92,11 +92,11 @@
long long res;
if (!VERIFY_INT(a) || !VERIFY_INT(b))
{
- fprintf (stderr, "SUB32: inputs are not int: %d %d\n", a, b);
+ fprintf (stderr, "SUB32: inputs are not int: %d %d\n", (int)a, (int)b);
}
res = a-b;
if (!VERIFY_INT(res))
- fprintf (stderr, "SUB32: output is not int: %d\n", res);
+ fprintf (stderr, "SUB32: output is not int: %d\n", (int)res);
spx_mips++;
return res;
}
@@ -129,7 +129,7 @@
}
res = ((long long)a)*b;
if (!VERIFY_INT(res))
- fprintf (stderr, "MULT16_16: output is not int: %d\n", res);
+ fprintf (stderr, "MULT16_16: output is not int: %d\n", (int)res);
spx_mips++;
return res;
}
@@ -167,7 +167,7 @@
res = ((long long)a)*b;
res >>= 11;
if (!VERIFY_SHORT(res))
- fprintf (stderr, "MULT16_16_Q11: output is not short: %d*%d=%d\n", a, b, res);
+ fprintf (stderr, "MULT16_16_Q11: output is not short: %d*%d=%d\n", (int)a, (int)b, (int)res);
spx_mips++;
return res;
}
@@ -181,7 +181,7 @@
res = ((long long)a)*b;
res >>= 13;
if (!VERIFY_SHORT(res))
- fprintf (stderr, "MULT16_16_Q13: output is not short: %d*%d=%d\n", a, b, res);
+ fprintf (stderr, "MULT16_16_Q13: output is not short: %d*%d=%d\n", a, b, (int)res);
spx_mips++;
return res;
}
@@ -195,7 +195,7 @@
res = ((long long)a)*b;
res >>= 14;
if (!VERIFY_SHORT(res))
- fprintf (stderr, "MULT16_16_Q14: output is not short: %d\n", res);
+ fprintf (stderr, "MULT16_16_Q14: output is not short: %d\n", (int)res);
spx_mips++;
return res;
}
@@ -209,7 +209,7 @@
res = ((long long)a)*b;
res >>= 15;
if (!VERIFY_SHORT(res))
- fprintf (stderr, "MULT16_16_Q15: output is not short: %d\n", res);
+ fprintf (stderr, "MULT16_16_Q15: output is not short: %d\n", (int)res);
spx_mips++;
return res;
}
@@ -224,10 +224,10 @@
res = ((long long)a)*b;
res += 4096;
if (!VERIFY_INT(res))
- fprintf (stderr, "MULT16_16_P13: overflow: %d*%d=%d\n", a, b, res);
+ fprintf (stderr, "MULT16_16_P13: overflow: %d*%d=%d\n", a, b, (int)res);
res >>= 13;
if (!VERIFY_SHORT(res))
- fprintf (stderr, "MULT16_16_P13: output is not short: %d*%d=%d\n", a, b, res);
+ fprintf (stderr, "MULT16_16_P13: output is not short: %d*%d=%d\n", a, b, (int)res);
spx_mips++;
return res;
}
@@ -241,10 +241,10 @@
res = ((long long)a)*b;
res += 8192;
if (!VERIFY_INT(res))
- fprintf (stderr, "MULT16_16_P14: overflow: %d*%d=%d\n", a, b, res);
+ fprintf (stderr, "MULT16_16_P14: overflow: %d*%d=%d\n", a, b, (int)res);
res >>= 14;
if (!VERIFY_SHORT(res))
- fprintf (stderr, "MULT16_16_P14: output is not short: %d*%d=%d\n", a, b, res);
+ fprintf (stderr, "MULT16_16_P14: output is not short: %d*%d=%d\n", a, b, (int)res);
spx_mips++;
return res;
}
@@ -258,10 +258,10 @@
res = ((long long)a)*b;
res += 16384;
if (!VERIFY_INT(res))
- fprintf (stderr, "MULT16_16_P15: overflow: %d*%d=%d\n", a, b, res);
+ fprintf (stderr, "MULT16_16_P15: overflow: %d*%d=%d\n", a, b, (int)res);
res >>= 15;
if (!VERIFY_SHORT(res))
- fprintf (stderr, "MULT16_16_P15: output is not short: %d*%d=%d\n", a, b, res);
+ fprintf (stderr, "MULT16_16_P15: output is not short: %d*%d=%d\n", a, b, (int)res);
spx_mips++;
return res;
}
@@ -298,17 +298,17 @@
long long res;
if (b==0)
{
- fprintf(stderr, "DIV32: divide by zero: %d/%d\n", a, b);
+ fprintf(stderr, "DIV32: divide by zero: %d/%d\n", (int)a, (int)b);
return 0;
}
if (!VERIFY_INT(a) || !VERIFY_INT(b))
{
- fprintf (stderr, "DIV32: inputs are not int/short: %d %d\n", a, b);
+ fprintf (stderr, "DIV32: inputs are not int/short: %d %d\n", (int)a, (int)b);
}
res = a/b;
if (!VERIFY_INT(res))
- fprintf (stderr, "DIV32: output is not int: %d\n", res);
+ fprintf (stderr, "DIV32: output is not int: %d\n", (int)res);
spx_mips++;
return res;
}
<p><p>1.10 +1 -1 speex/libspeex/gain_table.c
Index: gain_table.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/gain_table.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- gain_table.c 31 Jan 2003 01:42:53 -0000 1.9
+++ gain_table.c 4 Dec 2003 21:29:17 -0000 1.10
@@ -29,7 +29,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-signed char gain_cdbk_nb[384] = {
+const signed char gain_cdbk_nb[384] = {
-32,-32,-32,
-28,-67,-5,
-42,-6,-32,
<p><p>1.8 +1 -1 speex/libspeex/gain_table_lbr.c
Index: gain_table_lbr.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/gain_table_lbr.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- gain_table_lbr.c 31 Jan 2003 01:42:53 -0000 1.7
+++ gain_table_lbr.c 4 Dec 2003 21:29:17 -0000 1.8
@@ -29,7 +29,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-signed char gain_cdbk_lbr[96] = {
+const signed char gain_cdbk_lbr[96] = {
-32,-32,-32,
-31,-58,-16,
-41,-24,-43,
<p><p>1.6 +1 -1 speex/libspeex/hexc_10_32_table.c
Index: hexc_10_32_table.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/hexc_10_32_table.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- hexc_10_32_table.c 3 Jun 2003 21:21:56 -0000 1.5
+++ hexc_10_32_table.c 4 Dec 2003 21:29:17 -0000 1.6
@@ -30,7 +30,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-signed char hexc_10_32_table[320] = {
+const signed char hexc_10_32_table[320] = {
-3, -2, -1, 0, -4, 5, 35, -40, -9, 13,
-44, 5, -27, -1, -7, 6, -11, 7, -8, 7,
19, -14, 15, -4, 9, -10, 10, -8, 10, -9,
<p><p>1.13 +1 -1 speex/libspeex/hexc_table.c
Index: hexc_table.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/hexc_table.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- hexc_table.c 13 Jun 2003 03:59:46 -0000 1.12
+++ hexc_table.c 4 Dec 2003 21:29:17 -0000 1.13
@@ -30,7 +30,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-signed char hexc_table[1024] = {
+const signed char hexc_table[1024] = {
-24, 21, -20, 5, -5, -7, 14, -10,
2, -27, 16, -20, 0, -32, 26, 19,
8, -11, -41, 31, 28, -27, -32, 34,
<p><p>1.6 +2 -2 speex/libspeex/high_lsp_tables.c
Index: high_lsp_tables.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/high_lsp_tables.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- high_lsp_tables.c 31 Jan 2003 01:42:53 -0000 1.5
+++ high_lsp_tables.c 4 Dec 2003 21:29:17 -0000 1.6
@@ -29,7 +29,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-signed char high_lsp_cdbk[512]={
+const signed char high_lsp_cdbk[512]={
39,12,-14,-20,-29,-61,-67,-76,
-32,-71,-67,68,77,46,34,5,
-13,-48,-46,-72,-81,-84,-60,-58,
@@ -96,7 +96,7 @@
-42,-74,-48,21,-4,70,52,10};
-signed char high_lsp_cdbk2[512]={
+const signed char high_lsp_cdbk2[512]={
-36,-62,6,-9,-10,-14,-56,23,
1,-26,23,-48,-17,12,8,-7,
23,29,-36,-28,-6,-29,-17,-5,
<p><p>1.3 +4 -4 speex/libspeex/lbr_48k_tables.c
Index: lbr_48k_tables.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/lbr_48k_tables.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- lbr_48k_tables.c 21 Nov 2003 03:06:42 -0000 1.2
+++ lbr_48k_tables.c 4 Dec 2003 21:29:17 -0000 1.3
@@ -33,7 +33,7 @@
int dummy_epic_48k_variable=0;
#ifdef EPIC_48K
-signed char gain_cdbk_ulbr[192] = {
+const signed char gain_cdbk_ulbr[192] = {
-31, -48, -30,
-19, -10, -18,
-33, -22, -45,
@@ -101,7 +101,7 @@
};
-signed char exc_12_32_table[384] = {
+const signed char exc_12_32_table[384] = {
34, 55, 9, 55, 4, 44, -2, 25, 4, -6, 13, -22,
20, 26, -13, -56, -37, 18, 5, 28, 4, 10, 6, -7,
37, -24, -31, 22, 12, -6, -4, -7, 2, 0, -3, -2,
@@ -137,7 +137,7 @@
};
-signed char cdbk_lsp_vlbr[5120]={
+const signed char cdbk_lsp_vlbr[5120]={
23, 34, 108, 100, 102, 82, 69, 48, 52, 25,
0, -37, -55, -78, -111, -79, 58, 57, 45, 32,
27, -9, -12, -14, -41, -29, -17, -41, 44, 35,
@@ -652,7 +652,7 @@
-14, -53, -59, -17, 55, 79, 64, 39, 43, 10,
};
-signed char cdbk_lsp2_vlbr[160]={
+const signed char cdbk_lsp2_vlbr[160]={
-20, -30, -24, 17, 7, -13, -21, 61, 56, 16,
12, 1, 10, 77, 32, 3, 7, 3, -25, -31,
-4, 2, -36, -83, 18, 5, -5, 5, 11, 23,
<p><p>1.7 +5 -5 speex/libspeex/lsp_tables_nb.c
Index: lsp_tables_nb.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/lsp_tables_nb.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- lsp_tables_nb.c 31 Jan 2003 01:42:53 -0000 1.6
+++ lsp_tables_nb.c 4 Dec 2003 21:29:17 -0000 1.7
@@ -29,7 +29,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-signed char cdbk_nb[640]={
+const signed char cdbk_nb[640]={
30,19,38,34,40,32,46,43,58,43,
5,-18,-25,-40,-33,-55,-52,20,34,28,
-20,-63,-97,-92,61,53,47,49,53,75,
@@ -95,7 +95,7 @@
-6,-41,-67,6,-2,-9,19,2,85,74,
-22,-67,-84,-71,-50,3,11,-9,2,62};
-signed char cdbk_nb_low1[320]={
+const signed char cdbk_nb_low1[320]={
-34,-52,-15,45,2,
23,21,52,24,-33,
-9,-1,9,-44,-41,
@@ -161,7 +161,7 @@
13,20,20,-19,-22,
-2,-8,2,51,-51};
-signed char cdbk_nb_low2[320]={
+const signed char cdbk_nb_low2[320]={
-6,53,-21,-24,4,
26,17,-4,-37,25,
17,-36,-13,31,3,
@@ -227,7 +227,7 @@
-23,-29,-16,1,-3,
-8,-10,31,64,-65};
-signed char cdbk_nb_high1[320]={
+const signed char cdbk_nb_high1[320]={
-26,-8,29,21,4,
19,-39,33,-7,-36,
56,54,48,40,29,
@@ -293,7 +293,7 @@
29,17,8,-29,-39,
-69,18,15,-15,-5};
-signed char cdbk_nb_high2[320]={
+const signed char cdbk_nb_high2[320]={
11,47,16,-9,-46,
-32,26,-64,34,-5,
38,-7,47,20,2,
<p><p>1.107 +8 -8 speex/libspeex/ltp.c
Index: ltp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/ltp.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -r1.106 -r1.107
--- ltp.c 30 Nov 2003 16:43:24 -0000 1.106
+++ ltp.c 4 Dec 2003 21:29:17 -0000 1.107
@@ -187,7 +187,7 @@
spx_coef_t awk1[], /* Weighted LPCs #1 for this subframe */
spx_coef_t awk2[], /* Weighted LPCs #2 for this subframe */
spx_sig_t exc[], /* Excitation */
-void *par,
+const void *par,
int pitch, /* Pitch value */
int p, /* Number of LPC coeffs */
int nsf, /* Number of samples in subframe */
@@ -206,7 +206,7 @@
spx_word32_t corr[3];
spx_word32_t A[3][3];
int gain_cdbk_size;
- signed char *gain_cdbk;
+ const signed char *gain_cdbk;
spx_word16_t gain[3];
spx_word64_t err;
@@ -322,7 +322,7 @@
{
spx_word32_t C[9];
- signed char *ptr=gain_cdbk;
+ const signed char *ptr=gain_cdbk;
int best_cdbk=0;
spx_word32_t best_sum=0;
C[0]=corr[2];
@@ -412,7 +412,7 @@
spx_coef_t awk1[], /* Weighted LPCs #1 for this subframe */
spx_coef_t awk2[], /* Weighted LPCs #2 for this subframe */
spx_sig_t exc[], /* Excitation */
-void *par,
+const void *par,
int start, /* Smallest pitch value allowed */
int end, /* Largest pitch value allowed */
spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
@@ -490,7 +490,7 @@
int start, /* Smallest pitch value allowed */
int end, /* Largest pitch value allowed */
spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
-void *par,
+const void *par,
int nsf, /* Number of samples in subframe */
int *pitch_val,
spx_word16_t *gain_val,
@@ -506,7 +506,7 @@
int pitch;
int gain_index;
spx_word16_t gain[3];
- signed char *gain_cdbk;
+ const signed char *gain_cdbk;
int gain_cdbk_size;
ltp_params *params;
@@ -615,7 +615,7 @@
spx_coef_t awk1[], /* Weighted LPCs #1 for this subframe */
spx_coef_t awk2[], /* Weighted LPCs #2 for this subframe */
spx_sig_t exc[], /* Excitation */
-void *par,
+const void *par,
int start, /* Smallest pitch value allowed */
int end, /* Largest pitch value allowed */
spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
@@ -646,7 +646,7 @@
int start, /* Smallest pitch value allowed */
int end, /* Largest pitch value allowed */
spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
-void *par,
+const void *par,
int nsf, /* Number of samples in subframe */
int *pitch_val,
spx_word16_t *gain_val,
<p><p>1.40 +5 -5 speex/libspeex/ltp.h
Index: ltp.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/ltp.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- ltp.h 29 Nov 2003 02:45:02 -0000 1.39
+++ ltp.h 4 Dec 2003 21:29:18 -0000 1.40
@@ -34,7 +34,7 @@
#include "misc.h"
typedef struct ltp_params {
- signed char *gain_cdbk;
+ const signed char *gain_cdbk;
int gain_bits;
int pitch_bits;
} ltp_params;
@@ -56,7 +56,7 @@
spx_coef_t awk1[], /* Weighted LPCs #1 for this subframe */
spx_coef_t awk2[], /* Weighted LPCs #2 for this subframe */
spx_sig_t exc[], /* Overlapping codebook */
-void *par,
+const void *par,
int start, /* Smallest pitch value allowed */
int end, /* Largest pitch value allowed */
spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
@@ -76,7 +76,7 @@
int start, /* Smallest pitch value allowed */
int end, /* Largest pitch value allowed */
spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
-void *par,
+const void *par,
int nsf, /* Number of samples in subframe */
int *pitch_val,
spx_word16_t *gain_val,
@@ -96,7 +96,7 @@
spx_coef_t awk1[], /* Weighted LPCs #1 for this subframe */
spx_coef_t awk2[], /* Weighted LPCs #2 for this subframe */
spx_sig_t exc[], /* Excitation */
-void *par,
+const void *par,
int start, /* Smallest pitch value allowed */
int end, /* Largest pitch value allowed */
spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
@@ -116,7 +116,7 @@
int start, /* Smallest pitch value allowed */
int end, /* Largest pitch value allowed */
spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
-void *par,
+const void *par,
int nsf, /* Number of samples in subframe */
int *pitch_val,
spx_word16_t *gain_val,
<p><p>1.111 +57 -57 speex/libspeex/modes.c
Index: modes.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/modes.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- modes.c 8 Oct 2003 05:03:47 -0000 1.110
+++ modes.c 4 Dec 2003 21:29:18 -0000 1.111
@@ -45,53 +45,53 @@
#define NULL 0
#endif
-SpeexMode *speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode};
+const SpeexMode *speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode};
/* Extern declarations for all codebooks we use here */
-extern signed char gain_cdbk_nb[];
-extern signed char gain_cdbk_lbr[];
-extern signed char hexc_table[];
-extern signed char exc_5_256_table[];
-extern signed char exc_5_64_table[];
-extern signed char exc_8_128_table[];
-extern signed char exc_10_32_table[];
-extern signed char exc_10_16_table[];
-extern signed char exc_20_32_table[];
-extern signed char hexc_10_32_table[];
+extern const signed char gain_cdbk_nb[];
+extern const signed char gain_cdbk_lbr[];
+extern const signed char hexc_table[];
+extern const signed char exc_5_256_table[];
+extern const signed char exc_5_64_table[];
+extern const signed char exc_8_128_table[];
+extern const signed char exc_10_32_table[];
+extern const signed char exc_10_16_table[];
+extern const signed char exc_20_32_table[];
+extern const signed char hexc_10_32_table[];
-static int nb_mode_query(void *mode, int request, void *ptr);
-static int wb_mode_query(void *mode, int request, void *ptr);
+static int nb_mode_query(const void *mode, int request, void *ptr);
+static int wb_mode_query(const void *mode, int request, void *ptr);
/* Parameters for Long-Term Prediction (LTP)*/
-static ltp_params ltp_params_nb = {
+static const ltp_params ltp_params_nb = {
gain_cdbk_nb,
7,
7
};
/* Parameters for Long-Term Prediction (LTP)*/
-static ltp_params ltp_params_vlbr = {
+static const ltp_params ltp_params_vlbr = {
gain_cdbk_lbr,
5,
0
};
/* Parameters for Long-Term Prediction (LTP)*/
-static ltp_params ltp_params_lbr = {
+static const ltp_params ltp_params_lbr = {
gain_cdbk_lbr,
5,
7
};
/* Parameters for Long-Term Prediction (LTP)*/
-static ltp_params ltp_params_med = {
+static const ltp_params ltp_params_med = {
gain_cdbk_lbr,
5,
7
};
/* Split-VQ innovation parameters for very low bit-rate narrowband */
-static split_cb_params split_cb_nb_vlbr = {
+static const split_cb_params split_cb_nb_vlbr = {
10, /*subvect_size*/
4, /*nb_subvect*/
exc_10_16_table, /*shape_cb*/
@@ -100,7 +100,7 @@
};
/* Split-VQ innovation parameters for very low bit-rate narrowband */
-static split_cb_params split_cb_nb_ulbr = {
+static const split_cb_params split_cb_nb_ulbr = {
20, /*subvect_size*/
2, /*nb_subvect*/
exc_20_32_table, /*shape_cb*/
@@ -109,7 +109,7 @@
};
/* Split-VQ innovation parameters for low bit-rate narrowband */
-static split_cb_params split_cb_nb_lbr = {
+static const split_cb_params split_cb_nb_lbr = {
10, /*subvect_size*/
4, /*nb_subvect*/
exc_10_32_table, /*shape_cb*/
@@ -119,7 +119,7 @@
/* Split-VQ innovation parameters narrowband */
-static split_cb_params split_cb_nb = {
+static const split_cb_params split_cb_nb = {
5, /*subvect_size*/
8, /*nb_subvect*/
exc_5_64_table, /*shape_cb*/
@@ -128,7 +128,7 @@
};
/* Split-VQ innovation parameters narrowband */
-static split_cb_params split_cb_nb_med = {
+static const split_cb_params split_cb_nb_med = {
8, /*subvect_size*/
5, /*nb_subvect*/
exc_8_128_table, /*shape_cb*/
@@ -137,7 +137,7 @@
};
/* Split-VQ innovation for low-band wideband */
-static split_cb_params split_cb_sb = {
+static const split_cb_params split_cb_sb = {
5, /*subvect_size*/
8, /*nb_subvect*/
exc_5_256_table, /*shape_cb*/
@@ -146,7 +146,7 @@
};
/* Split-VQ innovation for high-band wideband */
-static split_cb_params split_cb_high = {
+static const split_cb_params split_cb_high = {
8, /*subvect_size*/
5, /*nb_subvect*/
hexc_table, /*shape_cb*/
@@ -156,7 +156,7 @@
/* Split-VQ innovation for high-band wideband */
-static split_cb_params split_cb_high_lbr = {
+static const split_cb_params split_cb_high_lbr = {
10, /*subvect_size*/
4, /*nb_subvect*/
hexc_10_32_table, /*shape_cb*/
@@ -165,7 +165,7 @@
};
/* 2150 bps "vocoder-like" mode for comfort noise */
-static SpeexSubmode nb_submode1 = {
+static const SpeexSubmode nb_submode1 = {
0,
1,
0,
@@ -186,7 +186,7 @@
};
/* 3.95 kbps very low bit-rate mode */
-static SpeexSubmode nb_submode8 = {
+static const SpeexSubmode nb_submode8 = {
0,
1,
0,
@@ -208,7 +208,7 @@
};
/* 5.95 kbps very low bit-rate mode */
-static SpeexSubmode nb_submode2 = {
+static const SpeexSubmode nb_submode2 = {
0,
0,
0,
@@ -230,7 +230,7 @@
};
/* 8 kbps low bit-rate mode */
-static SpeexSubmode nb_submode3 = {
+static const SpeexSubmode nb_submode3 = {
-1,
0,
1,
@@ -252,7 +252,7 @@
};
/* 11 kbps medium bit-rate mode */
-static SpeexSubmode nb_submode4 = {
+static const SpeexSubmode nb_submode4 = {
-1,
0,
1,
@@ -274,7 +274,7 @@
};
/* 15 kbps high bit-rate mode */
-static SpeexSubmode nb_submode5 = {
+static const SpeexSubmode nb_submode5 = {
-1,
0,
3,
@@ -296,7 +296,7 @@
};
/* 18.2 high bit-rate mode */
-static SpeexSubmode nb_submode6 = {
+static const SpeexSubmode nb_submode6 = {
-1,
0,
3,
@@ -318,7 +318,7 @@
};
/* 24.6 kbps high bit-rate mode */
-static SpeexSubmode nb_submode7 = {
+static const SpeexSubmode nb_submode7 = {
-1,
0,
3,
@@ -341,7 +341,7 @@
/* Default mode for narrowband */
-static SpeexNBMode nb_mode = {
+static const SpeexNBMode nb_mode = {
160, /*frameSize*/
40, /*subframeSize*/
10, /*lpcSize*/
@@ -363,7 +363,7 @@
/* Default mode for narrowband */
-SpeexMode speex_nb_mode = {
+const SpeexMode speex_nb_mode = {
&nb_mode,
nb_mode_query,
"narrowband",
@@ -382,7 +382,7 @@
/* Wideband part */
-static SpeexSubmode wb_submode1 = {
+static const SpeexSubmode wb_submode1 = {
0,
0,
1,
@@ -404,7 +404,7 @@
};
-static SpeexSubmode wb_submode2 = {
+static const SpeexSubmode wb_submode2 = {
0,
0,
1,
@@ -426,7 +426,7 @@
};
-static SpeexSubmode wb_submode3 = {
+static const SpeexSubmode wb_submode3 = {
0,
0,
1,
@@ -447,7 +447,7 @@
192
};
-static SpeexSubmode wb_submode4 = {
+static const SpeexSubmode wb_submode4 = {
0,
0,
1,
@@ -470,7 +470,7 @@
/* Split-band wideband CELP mode*/
-static SpeexSBMode sb_wb_mode = {
+static const SpeexSBMode sb_wb_mode = {
&speex_nb_mode,
160, /*frameSize*/
40, /*subframeSize*/
@@ -490,7 +490,7 @@
};
-SpeexMode speex_wb_mode = {
+const SpeexMode speex_wb_mode = {
&sb_wb_mode,
wb_mode_query,
"wideband (sub-band CELP)",
@@ -513,7 +513,7 @@
/* Split-band "ultra-wideband" (32 kbps) CELP mode*/
-static SpeexSBMode sb_uwb_mode = {
+static const SpeexSBMode sb_uwb_mode = {
&speex_wb_mode,
320, /*frameSize*/
80, /*subframeSize*/
@@ -533,7 +533,7 @@
};
-SpeexMode speex_uwb_mode = {
+const SpeexMode speex_uwb_mode = {
&sb_uwb_mode,
wb_mode_query,
"ultra-wideband (sub-band CELP)",
@@ -554,17 +554,17 @@
#ifdef EPIC_48K
-extern signed char gain_cdbk_ulbr[];
-extern signed char exc_12_32_table[];
+extern const signed char gain_cdbk_ulbr[];
+extern const signed char exc_12_32_table[];
/* Parameters for Long-Term Prediction (LTP)*/
-static ltp_params ltp_params_48k = {
+static const ltp_params ltp_params_48k = {
gain_cdbk_ulbr,
3,
0
};
-static split_cb_params split_cb_nb_48k = {
+static const split_cb_params split_cb_nb_48k = {
12, /*subvect_size*/
4, /*nb_subvect*/
exc_12_32_table, /*shape_cb*/
@@ -574,7 +574,7 @@
/* 4.8 kbps very low bit-rate mode */
-static SpeexSubmode nb_48k_submode = {
+static const SpeexSubmode nb_48k_submode = {
0,
0,
0,
@@ -597,7 +597,7 @@
/* Special, non-standard 4.8 kbps mode */
-static SpeexNBMode nb_48k_mode = {
+static const SpeexNBMode nb_48k_mode = {
240, /*frameSize*/
48, /*subframeSize*/
10, /*lpcSize*/
@@ -616,7 +616,7 @@
/* Default mode for narrowband */
-SpeexMode speex_nb_48k_mode = {
+const SpeexMode speex_nb_48k_mode = {
&nb_48k_mode,
nb_mode_query,
"narrowband 4.8 kbps",
@@ -637,12 +637,12 @@
-void *speex_encoder_init(SpeexMode *mode)
+void *speex_encoder_init(const SpeexMode *mode)
{
return mode->enc_init(mode);
}
-void *speex_decoder_init(SpeexMode *mode)
+void *speex_decoder_init(const SpeexMode *mode)
{
return mode->dec_init(mode);
}
@@ -680,9 +680,9 @@
-static int nb_mode_query(void *mode, int request, void *ptr)
+static int nb_mode_query(const void *mode, int request, void *ptr)
{
- SpeexNBMode *m = (SpeexNBMode*)mode;
+ const SpeexNBMode *m = (const SpeexNBMode*)mode;
switch (request)
{
@@ -704,9 +704,9 @@
return 0;
}
-static int wb_mode_query(void *mode, int request, void *ptr)
+static int wb_mode_query(const void *mode, int request, void *ptr)
{
- SpeexSBMode *m = (SpeexSBMode*)mode;
+ const SpeexSBMode *m = (const SpeexSBMode*)mode;
switch (request)
{
@@ -729,7 +729,7 @@
}
-int speex_mode_query(SpeexMode *mode, int request, void *ptr)
+int speex_mode_query(const SpeexMode *mode, int request, void *ptr)
{
return mode->query(mode->mode, request, ptr);
}
<p><p>1.50 +9 -9 speex/libspeex/modes.h
Index: modes.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/modes.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- modes.h 29 Nov 2003 02:45:02 -0000 1.49
+++ modes.h 4 Dec 2003 21:29:18 -0000 1.50
@@ -56,20 +56,20 @@
/** Long-term predictor quantization */
typedef int (*ltp_quant_func)(spx_sig_t *, spx_sig_t *, spx_coef_t *, spx_coef_t *,
- spx_coef_t *, spx_sig_t *, void *, int, int, spx_word16_t,
+ spx_coef_t *, spx_sig_t *, const void *, int, int, spx_word16_t,
int, int, SpeexBits*, char *, spx_sig_t *, spx_sig_t *, int, int);
/** Long-term un-quantize */
-typedef void (*ltp_unquant_func)(spx_sig_t *, int, int, spx_word16_t, void *, int, int *,
+typedef void (*ltp_unquant_func)(spx_sig_t *, int, int, spx_word16_t, const void *, int, int *,
spx_word16_t *, SpeexBits*, char*, int, int, spx_word16_t, int);
/** Innovation quantization function */
-typedef void (*innovation_quant_func)(spx_sig_t *, spx_coef_t *, spx_coef_t *, spx_coef_t *, void *, int, int,
+typedef void (*innovation_quant_func)(spx_sig_t *, spx_coef_t *, spx_coef_t *, spx_coef_t *, const void *, int, int,
spx_sig_t *, spx_sig_t *, SpeexBits *, char *, int);
/** Innovation unquantization function */
-typedef void (*innovation_unquant_func)(spx_sig_t *, void *, int, SpeexBits*, char *);
+typedef void (*innovation_unquant_func)(spx_sig_t *, const void *, int, SpeexBits*, char *);
/** Description of a Speex sub-mode (wither narrowband or wideband */
typedef struct SpeexSubmode {
@@ -84,12 +84,12 @@
/*Lont-term predictor functions*/
ltp_quant_func ltp_quant; /**< Long-term predictor (pitch) quantizer */
ltp_unquant_func ltp_unquant; /**< Long-term predictor (pitch) un-quantizer */
- void *ltp_params; /**< Pitch parameters (options) */
+ const void *ltp_params; /**< Pitch parameters (options) */
/*Quantization of innovation*/
innovation_quant_func innovation_quant; /**< Innovation quantization */
innovation_unquant_func innovation_unquant; /**< Innovation un-quantization */
- void *innovation_params; /**< Innovation quantization parameters*/
+ const void *innovation_params; /**< Innovation quantization parameters*/
/*Synthesis filter enhancement*/
float lpc_enh_k1; /**< Enhancer constant */
@@ -117,7 +117,7 @@
int lbr48k; /**< 1 for the special 4.8 kbps mode */
#endif
- SpeexSubmode *submodes[NB_SUBMODES]; /**< Sub-mode data for the mode */
+ const SpeexSubmode *submodes[NB_SUBMODES]; /**< Sub-mode data for the mode */
int defaultSubmode; /**< Default sub-mode to use when encoding */
int quality_map[11]; /**< Mode corresponding to each quality setting */
} SpeexNBMode;
@@ -125,7 +125,7 @@
/** Struct defining the encoding/decoding mode for SB-CELP (wideband) */
typedef struct SpeexSBMode {
- SpeexMode *nb_mode; /**< Embedded narrowband mode */
+ const SpeexMode *nb_mode; /**< Embedded narrowband mode */
int frameSize; /**< Size of frames used for encoding */
int subframeSize; /**< Size of sub-frames used for encoding */
int lpcSize; /**< Order of LPC filter */
@@ -136,7 +136,7 @@
float lpc_floor; /**< Noise floor for LPC analysis */
float folding_gain;
- SpeexSubmode *submodes[SB_SUBMODES]; /**< Sub-mode data for the mode */
+ const SpeexSubmode *submodes[SB_SUBMODES]; /**< Sub-mode data for the mode */
int defaultSubmode; /**< Default sub-mode to use when encoding */
int low_quality_map[11]; /**< Mode corresponding to each quality setting */
int quality_map[11]; /**< Mode corresponding to each quality setting */
<p><p>1.162 +13 -13 speex/libspeex/nb_celp.c
Index: nb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -r1.161 -r1.162
--- nb_celp.c 30 Nov 2003 05:46:03 -0000 1.161
+++ nb_celp.c 4 Dec 2003 21:29:18 -0000 1.162
@@ -58,11 +58,11 @@
#ifdef FIXED_POINT
-spx_word32_t ol_gain_table[32]={18900, 25150, 33468, 44536, 59265, 78865, 104946, 139653, 185838, 247297, 329081, 437913, 582736, 775454, 1031906, 1373169, 1827293, 2431601, 3235761, 4305867, 5729870, 7624808, 10146425, 13501971, 17967238, 23909222, 31816294, 42338330, 56340132, 74972501, 99766822, 132760927};
-spx_word16_t exc_gain_quant_scal3_bound[7]={1841, 3883, 6051, 8062, 10444, 13580, 18560};
-spx_word16_t exc_gain_quant_scal3[8]={1002, 2680, 5086, 7016, 9108, 11781, 15380, 21740};
-spx_word16_t exc_gain_quant_scal1_bound[1]={14385};
-spx_word16_t exc_gain_quant_scal1[2]={11546, 17224};
+const spx_word32_t ol_gain_table[32]={18900, 25150, 33468, 44536, 59265, 78865, 104946, 139653, 185838, 247297, 329081, 437913, 582736, 775454, 1031906, 1373169, 1827293, 2431601, 3235761, 4305867, 5729870, 7624808, 10146425, 13501971, 17967238, 23909222, 31816294, 42338330, 56340132, 74972501, 99766822, 132760927};
+const spx_word16_t exc_gain_quant_scal3_bound[7]={1841, 3883, 6051, 8062, 10444, 13580, 18560};
+const spx_word16_t exc_gain_quant_scal3[8]={1002, 2680, 5086, 7016, 9108, 11781, 15380, 21740};
+const spx_word16_t exc_gain_quant_scal1_bound[1]={14385};
+const spx_word16_t exc_gain_quant_scal1[2]={11546, 17224};
#define LSP_MARGIN 16
#define LSP_DELTA1 6553
@@ -70,10 +70,10 @@
#else
-float exc_gain_quant_scal3_bound[7]={0.112338, 0.236980, 0.369316, 0.492054, 0.637471, 0.828874, 1.132784};
-float exc_gain_quant_scal3[8]={0.061130, 0.163546, 0.310413, 0.428220, 0.555887, 0.719055, 0.938694, 1.326874};
-float exc_gain_quant_scal1_bound[1]={0.87798};
-float exc_gain_quant_scal1[2]={0.70469, 1.05127};
+const float exc_gain_quant_scal3_bound[7]={0.112338, 0.236980, 0.369316, 0.492054, 0.637471, 0.828874, 1.132784};
+const float exc_gain_quant_scal3[8]={0.061130, 0.163546, 0.310413, 0.428220, 0.555887, 0.719055, 0.938694, 1.326874};
+const float exc_gain_quant_scal1_bound[1]={0.87798};
+const float exc_gain_quant_scal1[2]={0.70469, 1.05127};
#define LSP_MARGIN .002
#define LSP_DELTA1 .2
@@ -86,10 +86,10 @@
#define sqr(x) ((x)*(x))
-void *nb_encoder_init(SpeexMode *m)
+void *nb_encoder_init(const SpeexMode *m)
{
EncState *st;
- SpeexNBMode *mode;
+ const SpeexNBMode *mode;
int i;
mode=(SpeexNBMode *)m->mode;
@@ -936,10 +936,10 @@
}
-void *nb_decoder_init(SpeexMode *m)
+void *nb_decoder_init(const SpeexMode *m)
{
DecState *st;
- SpeexNBMode *mode;
+ const SpeexNBMode *mode;
int i;
mode=(SpeexNBMode*)m->mode;
<p><p>1.64 +6 -6 speex/libspeex/nb_celp.h
Index: nb_celp.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.h,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- nb_celp.h 29 Nov 2003 07:03:58 -0000 1.63
+++ nb_celp.h 4 Dec 2003 21:29:18 -0000 1.64
@@ -44,7 +44,7 @@
/**Structure representing the full state of the narrowband encoder*/
typedef struct EncState {
- SpeexMode *mode; /**< Mode corresponding to the state */
+ const SpeexMode *mode; /**< Mode corresponding to the state */
int first; /**< Is this the first frame? */
int frameSize; /**< Size of frames */
int subframeSize; /**< Size of sub-frames */
@@ -115,14 +115,14 @@
int sampling_rate;
int encode_submode;
- SpeexSubmode **submodes; /**< Sub-mode data */
+ const SpeexSubmode * const *submodes; /**< Sub-mode data */
int submodeID; /**< Activated sub-mode */
int submodeSelect; /**< Mode chosen by the user (may differ from submodeID if VAD is on) */
} EncState;
/**Structure representing the full state of the narrowband decoder*/
typedef struct DecState {
- SpeexMode *mode; /**< Mode corresponding to the state */
+ const SpeexMode *mode; /**< Mode corresponding to the state */
int first; /**< Is this the first frame? */
int count_lost; /**< Was the last frame lost? */
int frameSize; /**< Size of frames */
@@ -161,7 +161,7 @@
int pitch_gain_buf_idx; /**< Tail of the buffer */
int encode_submode;
- SpeexSubmode **submodes; /**< Sub-mode data */
+ const SpeexSubmode * const *submodes; /**< Sub-mode data */
int submodeID; /**< Activated sub-mode */
int lpc_enh_enabled; /**< 1 when LPC enhancer is on, 0 otherwise */
CombFilterMem *comb_mem;
@@ -179,7 +179,7 @@
} DecState;
/** Initializes encoder state*/
-void *nb_encoder_init(SpeexMode *m);
+void *nb_encoder_init(const SpeexMode *m);
/** De-allocates encoder state resources*/
void nb_encoder_destroy(void *state);
@@ -189,7 +189,7 @@
/** Initializes decoder state*/
-void *nb_decoder_init(SpeexMode *m);
+void *nb_decoder_init(const SpeexMode *m);
/** De-allocates decoder state resources*/
void nb_decoder_destroy(void *state);
<p><p>1.18 +1 -1 speex/libspeex/preprocess.c
Index: preprocess.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/preprocess.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- preprocess.c 8 Oct 2003 05:03:47 -0000 1.17
+++ preprocess.c 4 Dec 2003 21:29:18 -0000 1.18
@@ -90,7 +90,7 @@
{
int ind;
float integer, frac;
- static float table[21] = {
+ static const float table[21] = {
0.82157, 1.02017, 1.20461, 1.37534, 1.53363, 1.68092, 1.81865,
1.94811, 2.07038, 2.18638, 2.29688, 2.40255, 2.50391, 2.60144,
2.69551, 2.78647, 2.87458, 2.96015, 3.04333, 3.12431, 3.20326};
<p><p>1.161 +9 -9 speex/libspeex/sb_celp.c
Index: sb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -r1.160 -r1.161
--- sb_celp.c 30 Nov 2003 07:11:36 -0000 1.160
+++ sb_celp.c 4 Dec 2003 21:29:18 -0000 1.161
@@ -54,7 +54,7 @@
#define SUBMODE(x) st->submodes[st->submodeID]->x
#ifdef FIXED_POINT
-spx_word16_t gc_quant_bound[16] = {125, 164, 215, 282, 370, 484, 635, 832, 1090, 1428, 1871, 2452, 3213, 4210, 5516, 7228};
+static const spx_word16_t gc_quant_bound[16] = {125, 164, 215, 282, 370, 484, 635, 832, 1090, 1428, 1871, 2452, 3213, 4210, 5516, 7228};
#define LSP_MARGIN 410
#define LSP_DELTA1 6553
#define LSP_DELTA2 1638
@@ -70,13 +70,13 @@
#define QMF_ORDER 64
#ifdef FIXED_POINT
-static spx_word16_t h0[64] = {2, -7, -7, 18, 15, -39, -25, 75, 35, -130, -41, 212, 38, -327, -17, 483, -32, -689, 124, 956, -283, -1307, 543, 1780, -973, -2467, 1733, 3633, -3339, -6409, 9059, 30153, 30153, 9059, -6409, -3339, 3633, 1733, -2467, -973, 1780, 543, -1307, -283, 956, 124, -689, -32, 483, -17, -327, 38, 212, -41, -130, 35, 75, -25, -39, 15, 18, -7, -7, 2};
+static const spx_word16_t h0[64] = {2, -7, -7, 18, 15, -39, -25, 75, 35, -130, -41, 212, 38, -327, -17, 483, -32, -689, 124, 956, -283, -1307, 543, 1780, -973, -2467, 1733, 3633, -3339, -6409, 9059, 30153, 30153, 9059, -6409, -3339, 3633, 1733, -2467, -973, 1780, 543, -1307, -283, 956, 124, -689, -32, 483, -17, -327, 38, 212, -41, -130, 35, 75, -25, -39, 15, 18, -7, -7, 2};
-static spx_word16_t h1[64] = {2, 7, -7, -18, 15, 39, -25, -75, 35, 130, -41, -212, 38, 327, -17, -483, -32, 689, 124, -956, -283, 1307, 543, -1780, -973, 2467, 1733, -3633, -3339, 6409, 9059, -30153, 30153, -9059, -6409, 3339, 3633, -1733, -2467, 973, 1780, -543, -1307, 283, 956, -124, -689, 32, 483, 17, -327, -38, 212, 41, -130, -35, 75, 25, -39, -15, 18, 7, -7, -2};
+static const spx_word16_t h1[64] = {2, 7, -7, -18, 15, 39, -25, -75, 35, 130, -41, -212, 38, 327, -17, -483, -32, 689, 124, -956, -283, 1307, 543, -1780, -973, 2467, 1733, -3633, -3339, 6409, 9059, -30153, 30153, -9059, -6409, 3339, 3633, -1733, -2467, 973, 1780, -543, -1307, 283, 956, -124, -689, 32, 483, 17, -327, -38, 212, 41, -130, -35, 75, 25, -39, -15, 18, 7, -7, -2};
#else
-static float h0[64] = {
+static const float h0[64] = {
3.596189e-05, -0.0001123515,
-0.0001104587, 0.0002790277,
0.0002298438, -0.0005953563,
@@ -111,7 +111,7 @@
-0.0001123515, 3.596189e-05
};
-static float h1[64] = {
+static const float h1[64] = {
3.596189e-05, 0.0001123515,
-0.0001104587, -0.0002790277,
0.0002298438, 0.0005953563,
@@ -167,11 +167,11 @@
}
}
-void *sb_encoder_init(SpeexMode *m)
+void *sb_encoder_init(const SpeexMode *m)
{
int i;
SBEncState *st;
- SpeexSBMode *mode;
+ const SpeexSBMode *mode;
st = (SBEncState*)speex_alloc(sizeof(SBEncState)+10000*sizeof(spx_sig_t));
st->mode = m;
@@ -709,10 +709,10 @@
-void *sb_decoder_init(SpeexMode *m)
+void *sb_decoder_init(const SpeexMode *m)
{
SBDecState *st;
- SpeexSBMode *mode;
+ const SpeexSBMode *mode;
st = (SBDecState*)speex_alloc(sizeof(SBDecState)+6000*sizeof(spx_sig_t));
st->mode = m;
mode=(SpeexSBMode*)m->mode;
<p><p>1.51 +6 -6 speex/libspeex/sb_celp.h
Index: sb_celp.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- sb_celp.h 27 Nov 2003 08:42:07 -0000 1.50
+++ sb_celp.h 4 Dec 2003 21:29:18 -0000 1.51
@@ -42,7 +42,7 @@
/**Structure representing the full state of the sub-band encoder*/
typedef struct SBEncState {
- SpeexMode *mode; /**< Pointer to the mode (containing for vtable info) */
+ const SpeexMode *mode; /**< Pointer to the mode (containing for vtable info) */
void *st_low; /**< State of the low-band (narrowband) encoder */
int full_frame_size; /**< Length of full-band frames*/
int frame_size; /**< Length of high-band frames*/
@@ -100,7 +100,7 @@
float relative_quality;
int encode_submode;
- SpeexSubmode **submodes;
+ const SpeexSubmode * const *submodes;
int submodeID;
int submodeSelect;
int complexity;
@@ -111,7 +111,7 @@
/**Structure representing the full state of the sub-band decoder*/
typedef struct SBDecState {
- SpeexMode *mode; /**< Pointer to the mode (containing for vtable info) */
+ const SpeexMode *mode; /**< Pointer to the mode (containing for vtable info) */
void *st_low; /**< State of the low-band (narrowband) encoder */
int full_frame_size;
int frame_size;
@@ -138,13 +138,13 @@
spx_word32_t *pi_gain;
int encode_submode;
- SpeexSubmode **submodes;
+ const SpeexSubmode * const *submodes;
int submodeID;
} SBDecState;
/**Initializes encoder state*/
-void *sb_encoder_init(SpeexMode *m);
+void *sb_encoder_init(const SpeexMode *m);
/**De-allocates encoder state resources*/
void sb_encoder_destroy(void *state);
@@ -154,7 +154,7 @@
/**Initializes decoder state*/
-void *sb_decoder_init(SpeexMode *m);
+void *sb_decoder_init(const SpeexMode *m);
/**De-allocates decoder state resources*/
void sb_decoder_destroy(void *state);
<p><p>1.79 +12 -12 speex/libspeex/speex.h
Index: speex.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/speex.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- speex.h 8 Oct 2003 05:03:47 -0000 1.78
+++ speex.h 4 Dec 2003 21:29:18 -0000 1.79
@@ -167,7 +167,7 @@
/* Prototypes for mode function pointers */
/** Encoder state initialization function */
-typedef void *(*encoder_init_func)(struct SpeexMode *mode);
+typedef void *(*encoder_init_func)(const struct SpeexMode *mode);
/** Encoder state destruction function */
typedef void (*encoder_destroy_func)(void *st);
@@ -179,7 +179,7 @@
typedef int (*encoder_ctl_func)(void *state, int request, void *ptr);
/** Decoder state initialization function */
-typedef void *(*decoder_init_func)(struct SpeexMode *mode);
+typedef void *(*decoder_init_func)(const struct SpeexMode *mode);
/** Decoder state destruction function */
typedef void (*decoder_destroy_func)(void *st);
@@ -192,12 +192,12 @@
/** Query function for a mode */
-typedef int (*mode_query_func)(void *mode, int request, void *ptr);
+typedef int (*mode_query_func)(const void *mode, int request, void *ptr);
/** Struct defining a Speex mode */
typedef struct SpeexMode {
/** Pointer to the low-level mode data */
- void *mode;
+ const void *mode;
/** Pointer to the mode query function */
mode_query_func query;
@@ -247,7 +247,7 @@
* @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
* @return A newly created encoder
*/
-void *speex_encoder_init(SpeexMode *mode);
+void *speex_encoder_init(const SpeexMode *mode);
/** Frees all resources associated to an existing Speex encoder state.
* @param state Encoder state to be destroyed */
@@ -279,7 +279,7 @@
* @param mode Speex mode (one of speex_nb_mode or speex_wb_mode)
* @return A newly created decoder state
*/
-void *speex_decoder_init(SpeexMode *mode);
+void *speex_decoder_init(const SpeexMode *mode);
/** Frees all resources associated to an existing decoder state.
*
@@ -313,25 +313,25 @@
* @param request ioctl-type request (one of the SPEEX_* macros)
* @param ptr Data exchanged to-from function
*/
-int speex_mode_query(SpeexMode *mode, int request, void *ptr);
+int speex_mode_query(const SpeexMode *mode, int request, void *ptr);
/** Default narrowband mode */
-extern SpeexMode speex_nb_mode;
+extern const SpeexMode speex_nb_mode;
/** Default wideband mode */
-extern SpeexMode speex_wb_mode;
+extern const SpeexMode speex_wb_mode;
/** Default "ultra-wideband" mode */
-extern SpeexMode speex_uwb_mode;
+extern const SpeexMode speex_uwb_mode;
#ifdef EPIC_48K
/** 4.8 kbps narrowband mode */
-extern SpeexMode speex_nb_48k_mode;
+extern const SpeexMode speex_nb_48k_mode;
#endif
/** List of all modes available */
-extern SpeexMode *speex_mode_list[SPEEX_NB_MODES];
+extern const SpeexMode *speex_mode_list[SPEEX_NB_MODES];
#ifdef __cplusplus
}
<p><p>1.13 +1 -1 speex/libspeex/speex_header.c
Index: speex_header.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/speex_header.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- speex_header.c 13 Jan 2003 22:29:41 -0000 1.12
+++ speex_header.c 4 Dec 2003 21:29:18 -0000 1.13
@@ -62,7 +62,7 @@
} SpeexHeader;
*/
-void speex_init_header(SpeexHeader *header, int rate, int nb_channels, SpeexMode *m)
+void speex_init_header(SpeexHeader *header, int rate, int nb_channels, const SpeexMode *m)
{
int i;
char *h="Speex ";
<p><p>1.16 +1 -1 speex/libspeex/speex_header.h
Index: speex_header.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/speex_header.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- speex_header.h 23 Jan 2003 07:29:39 -0000 1.15
+++ speex_header.h 4 Dec 2003 21:29:18 -0000 1.16
@@ -66,7 +66,7 @@
} SpeexHeader;
/** Initializes a SpeexHeader using basic information */
-void speex_init_header(SpeexHeader *header, int rate, int nb_channels, struct SpeexMode *m);
+void speex_init_header(SpeexHeader *header, int rate, int nb_channels, const struct SpeexMode *m);
/** Creates the header packet from the header itself (mostly involves endianness conversion) */
char *speex_header_to_packet(SpeexHeader *header, int *size);
<p><p>1.8 +1 -1 speex/libspeex/stereo.c
Index: stereo.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/stereo.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- stereo.c 8 Oct 2003 05:03:47 -0000 1.7
+++ stereo.c 4 Dec 2003 21:29:18 -0000 1.8
@@ -35,7 +35,7 @@
#include <math.h>
/*float e_ratio_quant[4] = {1, 1.26, 1.587, 2};*/
-static float e_ratio_quant[4] = {.25f, .315f, .397f, .5f};
+static const float e_ratio_quant[4] = {.25f, .315f, .397f, .5f};
void speex_encode_stereo(short *data, int frame_size, SpeexBits *bits)
{
<p><p>1.16 +5 -5 speex/libspeex/vq.c
Index: vq.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/vq.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- vq.c 12 Nov 2003 07:30:18 -0000 1.15
+++ vq.c 4 Dec 2003 21:29:18 -0000 1.16
@@ -32,7 +32,7 @@
#include "vq.h"
-int scal_quant(spx_word16_t in, spx_word16_t *boundary, int entries)
+int scal_quant(spx_word16_t in, const spx_word16_t *boundary, int entries)
{
int i=0;
while (i<entries-1 && in>boundary[0])
@@ -43,7 +43,7 @@
return i;
}
-int scal_quant32(spx_word32_t in, spx_word32_t *boundary, int entries)
+int scal_quant32(spx_word32_t in, const spx_word32_t *boundary, int entries)
{
int i=0;
while (i<entries-1 && in>boundary[0])
@@ -55,7 +55,7 @@
}
/*Finds the index of the entry in a codebook that best matches the input*/
-int vq_index(float *in, float *codebook, int len, int entries)
+int vq_index(float *in, const float *codebook, int len, int entries)
{
int i,j;
float min_dist=0;
@@ -79,7 +79,7 @@
/*Finds the indices of the n-best entries in a codebook*/
-void vq_nbest(spx_word16_t *in, spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist)
+void vq_nbest(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist)
{
int i,j,k,used;
used = 0;
@@ -108,7 +108,7 @@
}
/*Finds the indices of the n-best entries in a codebook with sign*/
-void vq_nbest_sign(spx_word16_t *in, spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist)
+void vq_nbest_sign(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist)
{
int i,j,k, sign, used;
used=0;
<p><p>1.13 +5 -5 speex/libspeex/vq.h
Index: vq.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/vq.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- vq.h 12 Nov 2003 07:30:18 -0000 1.12
+++ vq.h 4 Dec 2003 21:29:18 -0000 1.13
@@ -35,13 +35,13 @@
#include "misc.h"
-int scal_quant(spx_word16_t in, spx_word16_t *boundary, int entries);
-int scal_quant32(spx_word32_t in, spx_word32_t *boundary, int entries);
+int scal_quant(spx_word16_t in, const spx_word16_t *boundary, int entries);
+int scal_quant32(spx_word32_t in, const spx_word32_t *boundary, int entries);
-int vq_index(float *in, float *codebook, int len, int entries);
+int vq_index(float *in, const float *codebook, int len, int entries);
-void vq_nbest(spx_word16_t *in, spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist);
+void vq_nbest(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist);
-void vq_nbest_sign(spx_word16_t *in, spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist);
+void vq_nbest_sign(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist);
#endif
<p><p>1.85 +1 -1 speex/src/speexdec.c
Index: speexdec.c
===================================================================
RCS file: /usr/local/cvsroot/speex/src/speexdec.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- speexdec.c 13 Nov 2003 20:39:06 -0000 1.84
+++ speexdec.c 4 Dec 2003 21:29:19 -0000 1.85
@@ -295,7 +295,7 @@
static void *process_header(ogg_packet *op, int enh_enabled, int *frame_size, int *rate, int *nframes, int forceMode, int *channels, SpeexStereoState *stereo, int *extra_headers)
{
void *st;
- SpeexMode *mode;
+ const SpeexMode *mode;
SpeexHeader *header;
int modeID;
SpeexCallback callback;
<p><p>1.83 +1 -1 speex/src/speexenc.c
Index: speexenc.c
===================================================================
RCS file: /usr/local/cvsroot/speex/src/speexenc.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -r1.82 -r1.83
--- speexenc.c 8 Oct 2003 05:03:48 -0000 1.82
+++ speexenc.c 4 Dec 2003 21:29:19 -0000 1.83
@@ -214,7 +214,7 @@
int vad_enabled=0;
int dtx_enabled=0;
int nbBytes;
- SpeexMode *mode=NULL;
+ const SpeexMode *mode=NULL;
void *st;
SpeexBits bits;
char cbits[MAX_FRAME_BYTES];
<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