[xiph-commits] r11803 - in trunk/speex: . include/speex libspeex src

jm at svn.xiph.org jm at svn.xiph.org
Mon Aug 28 03:11:38 PDT 2006


Author: jm
Date: 2006-08-28 03:11:26 -0700 (Mon, 28 Aug 2006)
New Revision: 11803

Modified:
   trunk/speex/TODO
   trunk/speex/include/speex/speex_jitter.h
   trunk/speex/libspeex/nb_celp.c
   trunk/speex/libspeex/nb_celp.h
   trunk/speex/libspeex/sb_celp.c
   trunk/speex/libspeex/speex.c
   trunk/speex/libspeex/speex_callbacks.c
   trunk/speex/libspeex/testenc.c
   trunk/speex/libspeex/testenc_uwb.c
   trunk/speex/libspeex/testenc_wb.c
   trunk/speex/src/speexdec.c
   trunk/speex/src/speexenc.c
   trunk/speex/src/wav_io.c
   trunk/speex/src/wav_io.h
Log:
Changed part of the API to use spx_int32_t instead of int (works better on 
16-bit architectures)


Modified: trunk/speex/TODO
===================================================================
--- trunk/speex/TODO	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/TODO	2006-08-28 10:11:26 UTC (rev 11803)
@@ -1,13 +1,4 @@
-For 1.1.13:
-Input buffer in new enhancer
-(remove the if's in loops in interp_pitch())
-Fix --force-nb
-Fix wideband PLC
-change filter structure in vorbis-psy (use the numerator=LPC version)
-Fix overflow in mdf
-
-Later:
-use 16-bit version of the filters in ltp.c
+Better saturation handling in mdf?
 get rid of crap that shouldn't be exposed in speex.h
 
 Would be nice:

Modified: trunk/speex/include/speex/speex_jitter.h
===================================================================
--- trunk/speex/include/speex/speex_jitter.h	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/include/speex/speex_jitter.h	2006-08-28 10:11:26 UTC (rev 11803)
@@ -91,7 +91,7 @@
    int valid_bits;                                                        /**< True if Speex bits are valid        */
    JitterBuffer *packets;
    void *dec;                                                             /**< Pointer to Speex decoder            */
-   int frame_size;                                                        /**< Frame size of Speex decoder         */
+   spx_int32_t frame_size;                                                        /**< Frame size of Speex decoder         */
 } SpeexJitter;
 
 /** Initialise jitter buffer */

Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/libspeex/nb_celp.c	2006-08-28 10:11:26 UTC (rev 11803)
@@ -490,7 +490,7 @@
       /*  delta_qual*=.1*(3+st->vbr_quality);*/
       if (st->vbr_enabled) 
       {
-         int mode;
+         spx_int32_t mode;
          int choice=0;
          float min_diff=100;
          mode = 8;
@@ -540,7 +540,7 @@
          
          if (st->abr_enabled)
          {
-            int bitrate;
+            spx_int32_t bitrate;
             speex_encoder_ctl(state, SPEEX_GET_BITRATE, &bitrate);
             st->abr_drift+=(bitrate-st->abr_enabled);
             st->abr_drift2 = .95*st->abr_drift2 + .05*(bitrate-st->abr_enabled);
@@ -1759,40 +1759,40 @@
    switch(request)
    {
    case SPEEX_GET_FRAME_SIZE:
-      (*(int*)ptr) = st->frameSize;
+      (*(spx_int32_t*)ptr) = st->frameSize;
       break;
    case SPEEX_SET_LOW_MODE:
    case SPEEX_SET_MODE:
-      st->submodeSelect = st->submodeID = (*(int*)ptr);
+      st->submodeSelect = st->submodeID = (*(spx_int32_t*)ptr);
       break;
    case SPEEX_GET_LOW_MODE:
    case SPEEX_GET_MODE:
-      (*(int*)ptr) = st->submodeID;
+      (*(spx_int32_t*)ptr) = st->submodeID;
       break;
    case SPEEX_SET_VBR:
-      st->vbr_enabled = (*(int*)ptr);
+      st->vbr_enabled = (*(spx_int32_t*)ptr);
       break;
    case SPEEX_GET_VBR:
-      (*(int*)ptr) = st->vbr_enabled;
+      (*(spx_int32_t*)ptr) = st->vbr_enabled;
       break;
    case SPEEX_SET_VAD:
-      st->vad_enabled = (*(int*)ptr);
+      st->vad_enabled = (*(spx_int32_t*)ptr);
       break;
    case SPEEX_GET_VAD:
-      (*(int*)ptr) = st->vad_enabled;
+      (*(spx_int32_t*)ptr) = st->vad_enabled;
       break;
    case SPEEX_SET_DTX:
-      st->dtx_enabled = (*(int*)ptr);
+      st->dtx_enabled = (*(spx_int32_t*)ptr);
       break;
    case SPEEX_GET_DTX:
-      (*(int*)ptr) = st->dtx_enabled;
+      (*(spx_int32_t*)ptr) = st->dtx_enabled;
       break;
    case SPEEX_SET_ABR:
       st->abr_enabled = (*(spx_int32_t*)ptr);
       st->vbr_enabled = st->abr_enabled!=0;
       if (st->vbr_enabled) 
       {
-         int i=10;
+         spx_int32_t i=10;
          spx_int32_t rate, target;
          float vbr_qual;
          target = (*(spx_int32_t*)ptr);
@@ -1834,7 +1834,7 @@
       }
       break;
    case SPEEX_SET_COMPLEXITY:
-      st->complexity = (*(int*)ptr);
+      st->complexity = (*(spx_int32_t*)ptr);
       if (st->complexity<0)
          st->complexity=0;
       break;
@@ -1843,7 +1843,7 @@
       break;
    case SPEEX_SET_BITRATE:
       {
-         int i=10;
+         spx_int32_t i=10;
          spx_int32_t rate, target;
          target = (*(spx_int32_t*)ptr);
          while (i>=0)
@@ -1884,21 +1884,21 @@
       }
       break;
    case SPEEX_SET_SUBMODE_ENCODING:
-      st->encode_submode = (*(int*)ptr);
+      st->encode_submode = (*(spx_int32_t*)ptr);
       break;
    case SPEEX_GET_SUBMODE_ENCODING:
-      (*(int*)ptr) = st->encode_submode;
+      (*(spx_int32_t*)ptr) = st->encode_submode;
       break;
    case SPEEX_GET_LOOKAHEAD:
-      (*(int*)ptr)=(st->windowSize-st->frameSize);
+      (*(spx_int32_t*)ptr)=(st->windowSize-st->frameSize);
       break;
    case SPEEX_SET_PLC_TUNING:
-      st->plc_tuning = (*(int*)ptr);
+      st->plc_tuning = (*(spx_int32_t*)ptr);
       if (st->plc_tuning>100)
          st->plc_tuning=100;
       break;
    case SPEEX_GET_PLC_TUNING:
-      (*(int*)ptr)=(st->plc_tuning);
+      (*(spx_int32_t*)ptr)=(st->plc_tuning);
       break;
    case SPEEX_SET_VBR_MAX_BITRATE:
       st->vbr_max = (*(spx_int32_t*)ptr);
@@ -1954,20 +1954,20 @@
    {
    case SPEEX_SET_LOW_MODE:
    case SPEEX_SET_MODE:
-      st->submodeID = (*(int*)ptr);
+      st->submodeID = (*(spx_int32_t*)ptr);
       break;
    case SPEEX_GET_LOW_MODE:
    case SPEEX_GET_MODE:
-      (*(int*)ptr) = st->submodeID;
+      (*(spx_int32_t*)ptr) = st->submodeID;
       break;
    case SPEEX_SET_ENH:
-      st->lpc_enh_enabled = *((int*)ptr);
+      st->lpc_enh_enabled = *((spx_int32_t*)ptr);
       break;
    case SPEEX_GET_ENH:
-      *((int*)ptr) = st->lpc_enh_enabled;
+      *((spx_int32_t*)ptr) = st->lpc_enh_enabled;
       break;
    case SPEEX_GET_FRAME_SIZE:
-      (*(int*)ptr) = st->frameSize;
+      (*(spx_int32_t*)ptr) = st->frameSize;
       break;
    case SPEEX_GET_BITRATE:
       if (st->submodes[st->submodeID])
@@ -2007,13 +2007,13 @@
       }
       break;
    case SPEEX_SET_SUBMODE_ENCODING:
-      st->encode_submode = (*(int*)ptr);
+      st->encode_submode = (*(spx_int32_t*)ptr);
       break;
    case SPEEX_GET_SUBMODE_ENCODING:
-      (*(int*)ptr) = st->encode_submode;
+      (*(spx_int32_t*)ptr) = st->encode_submode;
       break;
    case SPEEX_GET_LOOKAHEAD:
-      (*(int*)ptr)=st->subframeSize;
+      (*(spx_int32_t*)ptr)=st->subframeSize;
       break;
    case SPEEX_SET_HIGHPASS:
       st->highpass_enabled = (*(spx_int32_t*)ptr);
@@ -2039,7 +2039,7 @@
       }
       break;
    case SPEEX_GET_DTX_STATUS:
-      *((int*)ptr) = st->dtx_enabled;
+      *((spx_int32_t*)ptr) = st->dtx_enabled;
       break;
    case SPEEX_SET_INNOVATION_SAVE:
       st->innov_save = (spx_sig_t*)ptr;

Modified: trunk/speex/libspeex/nb_celp.h
===================================================================
--- trunk/speex/libspeex/nb_celp.h	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/libspeex/nb_celp.h	2006-08-28 10:11:26 UTC (rev 11803)
@@ -101,7 +101,7 @@
    VBRState *vbr;                /**< State of the VBR data */
    float  vbr_quality;           /**< Quality setting for VBR encoding */
    float  relative_quality;      /**< Relative quality that will be needed by VBR */
-   int    vbr_enabled;           /**< 1 for enabling VBR, 0 otherwise */
+   spx_int32_t vbr_enabled;      /**< 1 for enabling VBR, 0 otherwise */
    spx_int32_t vbr_max;          /**< Max bit-rate allowed in VBR mode */
    int    vad_enabled;           /**< 1 for enabling VAD, 0 otherwise */
    int    dtx_enabled;           /**< 1 for enabling DTX, 0 otherwise */

Modified: trunk/speex/libspeex/sb_celp.c
===================================================================
--- trunk/speex/libspeex/sb_celp.c	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/libspeex/sb_celp.c	2006-08-28 10:11:26 UTC (rev 11803)
@@ -226,6 +226,7 @@
 void *sb_encoder_init(const SpeexMode *m)
 {
    int i;
+   spx_int32_t tmp;
    SBEncState *st;
    const SpeexSBMode *mode;
 
@@ -254,10 +255,10 @@
    st->submodes=mode->submodes;
    st->submodeSelect = st->submodeID=mode->defaultSubmode;
    
-   i=9;
-   speex_encoder_ctl(st->st_low, SPEEX_SET_QUALITY, &i);
-   i=1;
-   speex_encoder_ctl(st->st_low, SPEEX_SET_WIDEBAND, &i);
+   tmp=9;
+   speex_encoder_ctl(st->st_low, SPEEX_SET_QUALITY, &tmp);
+   tmp=1;
+   speex_encoder_ctl(st->st_low, SPEEX_SET_WIDEBAND, &tmp);
 
    st->lag_factor = mode->lag_factor;
    st->lpc_floor = mode->lpc_floor;
@@ -386,7 +387,7 @@
    VARDECL(spx_word32_t *low_pi_gain);
    VARDECL(spx_word16_t *low_exc);
    const SpeexSBMode *mode;
-   int dtx;
+   spx_int32_t dtx;
    spx_word16_t *in = (spx_word16_t*)vin;
 
    st = (SBEncState*)state;
@@ -501,7 +502,7 @@
       /*if (ratio>-2)*/
       if (st->vbr_enabled) 
       {
-         int modeid;
+         spx_int32_t modeid;
          modeid = mode->nb_modes-1;
          st->relative_quality+=1.0*(ratio+2);
 	 if (st->relative_quality<-1)
@@ -523,7 +524,7 @@
          speex_encoder_ctl(state, SPEEX_SET_HIGH_MODE, &modeid);
          if (st->abr_enabled)
          {
-            int bitrate;
+            spx_int32_t bitrate;
             speex_encoder_ctl(state, SPEEX_GET_BITRATE, &bitrate);
             st->abr_drift+=(bitrate-st->abr_enabled);
             st->abr_drift2 = .95*st->abr_drift2 + .05*(bitrate-st->abr_enabled);
@@ -836,7 +837,7 @@
 
 void *sb_decoder_init(const SpeexMode *m)
 {
-   int tmp;
+   spx_int32_t tmp;
    SBDecState *st;
    const SpeexSBMode *mode;
    st = (SBDecState*)speex_alloc(sizeof(SBDecState));
@@ -991,7 +992,7 @@
    VARDECL(spx_word32_t *low_pi_gain);
    VARDECL(spx_word16_t *low_exc);
    VARDECL(spx_coef_t *ak);
-   int dtx;
+   spx_int32_t dtx;
    const SpeexSBMode *mode;
    spx_word16_t *out = (spx_word16_t*)vout;
    
@@ -1256,10 +1257,10 @@
    switch(request)
    {
    case SPEEX_GET_FRAME_SIZE:
-      (*(int*)ptr) = st->full_frame_size;
+      (*(spx_int32_t*)ptr) = st->full_frame_size;
       break;
    case SPEEX_SET_HIGH_MODE:
-      st->submodeSelect = st->submodeID = (*(int*)ptr);
+      st->submodeSelect = st->submodeID = (*(spx_int32_t*)ptr);
       break;
    case SPEEX_SET_LOW_MODE:
       speex_encoder_ctl(st->st_low, SPEEX_SET_LOW_MODE, ptr);
@@ -1277,22 +1278,22 @@
       speex_encoder_ctl(st, SPEEX_SET_QUALITY, ptr);
       break;
    case SPEEX_SET_VBR:
-      st->vbr_enabled = (*(int*)ptr);
+      st->vbr_enabled = (*(spx_int32_t*)ptr);
       speex_encoder_ctl(st->st_low, SPEEX_SET_VBR, ptr);
       break;
    case SPEEX_GET_VBR:
-      (*(int*)ptr) = st->vbr_enabled;
+      (*(spx_int32_t*)ptr) = st->vbr_enabled;
       break;
    case SPEEX_SET_VAD:
-      st->vad_enabled = (*(int*)ptr);
+      st->vad_enabled = (*(spx_int32_t*)ptr);
       speex_encoder_ctl(st->st_low, SPEEX_SET_VAD, ptr);
       break;
    case SPEEX_GET_VAD:
-      (*(int*)ptr) = st->vad_enabled;
+      (*(spx_int32_t*)ptr) = st->vad_enabled;
       break;
    case SPEEX_SET_VBR_QUALITY:
       {
-         int q;
+         spx_int32_t q;
          float qual = (*(float*)ptr)+.6;
          st->vbr_quality = (*(float*)ptr);
          if (qual>10)
@@ -1313,7 +1314,7 @@
       speex_encoder_ctl(st->st_low, SPEEX_SET_VBR, &st->vbr_enabled);
       if (st->vbr_enabled) 
       {
-         int i=10, rate, target;
+         spx_int32_t i=10, rate, target;
          float vbr_qual;
          target = (*(spx_int32_t*)ptr);
          while (i>=0)
@@ -1339,8 +1340,8 @@
       break;
    case SPEEX_SET_QUALITY:
       {
-         int nb_qual;
-         int quality = (*(int*)ptr);
+         spx_int32_t nb_qual;
+         int quality = (*(spx_int32_t*)ptr);
          if (quality < 0)
             quality = 0;
          if (quality > 10)
@@ -1352,16 +1353,16 @@
       break;
    case SPEEX_SET_COMPLEXITY:
       speex_encoder_ctl(st->st_low, SPEEX_SET_COMPLEXITY, ptr);
-      st->complexity = (*(int*)ptr);
+      st->complexity = (*(spx_int32_t*)ptr);
       if (st->complexity<1)
          st->complexity=1;
       break;
    case SPEEX_GET_COMPLEXITY:
-      (*(int*)ptr) = st->complexity;
+      (*(spx_int32_t*)ptr) = st->complexity;
       break;
    case SPEEX_SET_BITRATE:
       {
-         int i=10;
+         spx_int32_t i=10;
          spx_int32_t rate, target;
          target = (*(spx_int32_t*)ptr);
          while (i>=0)
@@ -1409,15 +1410,15 @@
       }
       break;
    case SPEEX_SET_SUBMODE_ENCODING:
-      st->encode_submode = (*(int*)ptr);
+      st->encode_submode = (*(spx_int32_t*)ptr);
       speex_encoder_ctl(st->st_low, SPEEX_SET_SUBMODE_ENCODING, &ptr);
       break;
    case SPEEX_GET_SUBMODE_ENCODING:
-      (*(int*)ptr) = st->encode_submode;
+      (*(spx_int32_t*)ptr) = st->encode_submode;
       break;
    case SPEEX_GET_LOOKAHEAD:
       speex_encoder_ctl(st->st_low, SPEEX_GET_LOOKAHEAD, ptr);
-      (*(int*)ptr) = 2*(*(int*)ptr) + QMF_ORDER - 1;
+      (*(spx_int32_t*)ptr) = 2*(*(int*)ptr) + QMF_ORDER - 1;
       break;
    case SPEEX_SET_PLC_TUNING:
       speex_encoder_ctl(st->st_low, SPEEX_SET_PLC_TUNING, ptr);
@@ -1517,7 +1518,7 @@
    switch(request)
    {
    case SPEEX_SET_HIGH_MODE:
-      st->submodeID = (*(int*)ptr);
+      st->submodeID = (*(spx_int32_t*)ptr);
       break;
    case SPEEX_SET_LOW_MODE:
       speex_decoder_ctl(st->st_low, SPEEX_SET_LOW_MODE, ptr);
@@ -1526,20 +1527,20 @@
       speex_decoder_ctl(st->st_low, SPEEX_GET_LOW_MODE, ptr);
       break;
    case SPEEX_GET_FRAME_SIZE:
-      (*(int*)ptr) = st->full_frame_size;
+      (*(spx_int32_t*)ptr) = st->full_frame_size;
       break;
    case SPEEX_SET_ENH:
       speex_decoder_ctl(st->st_low, request, ptr);
-      st->lpc_enh_enabled = *((int*)ptr);
+      st->lpc_enh_enabled = *((spx_int32_t*)ptr);
       break;
    case SPEEX_GET_ENH:
-      *((int*)ptr) = st->lpc_enh_enabled;
+      *((spx_int32_t*)ptr) = st->lpc_enh_enabled;
       break;
    case SPEEX_SET_MODE:
    case SPEEX_SET_QUALITY:
       {
-         int nb_qual;
-         int quality = (*(int*)ptr);
+         spx_int32_t nb_qual;
+         int quality = (*(spx_int32_t*)ptr);
          if (quality < 0)
             quality = 0;
          if (quality > 10)
@@ -1583,15 +1584,15 @@
       }
       break;
    case SPEEX_SET_SUBMODE_ENCODING:
-      st->encode_submode = (*(int*)ptr);
+      st->encode_submode = (*(spx_int32_t*)ptr);
       speex_decoder_ctl(st->st_low, SPEEX_SET_SUBMODE_ENCODING, &ptr);
       break;
    case SPEEX_GET_SUBMODE_ENCODING:
-      (*(int*)ptr) = st->encode_submode;
+      (*(spx_int32_t*)ptr) = st->encode_submode;
       break;
    case SPEEX_GET_LOOKAHEAD:
       speex_decoder_ctl(st->st_low, SPEEX_GET_LOOKAHEAD, ptr);
-      (*(int*)ptr) = 2*(*(int*)ptr);
+      (*(spx_int32_t*)ptr) = 2*(*(spx_int32_t*)ptr);
       break;
    case SPEEX_SET_HIGHPASS:
       speex_decoder_ctl(st->st_low, SPEEX_SET_HIGHPASS, ptr);

Modified: trunk/speex/libspeex/speex.c
===================================================================
--- trunk/speex/libspeex/speex.c	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/libspeex/speex.c	2006-08-28 10:11:26 UTC (rev 11803)
@@ -86,7 +86,7 @@
 int speex_encode(void *state, float *in, SpeexBits *bits)
 {
    int i;
-   int N;
+   spx_int32_t N;
    spx_int16_t short_in[MAX_IN_SAMPLES];
    speex_encoder_ctl(state, SPEEX_GET_FRAME_SIZE, &N);
    for (i=0;i<N;i++)
@@ -111,7 +111,7 @@
 int speex_decode(void *state, SpeexBits *bits, float *out)
 {
    int i, ret;
-   int N;
+   spx_int32_t N;
    spx_int16_t short_out[MAX_IN_SAMPLES];
    speex_decoder_ctl(state, SPEEX_GET_FRAME_SIZE, &N);
    ret = (*((SpeexMode**)state))->dec(state, bits, short_out);
@@ -136,7 +136,7 @@
 int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits)
 {
    int i;
-   int N;
+   spx_int32_t N;
    float float_in[MAX_IN_SAMPLES];
    speex_encoder_ctl(state, SPEEX_GET_FRAME_SIZE, &N);
    for (i=0;i<N;i++)
@@ -152,7 +152,7 @@
 int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out)
 {
    int i;
-   int N;
+   spx_int32_t N;
    float float_out[MAX_IN_SAMPLES];
    int ret;
    speex_decoder_ctl(state, SPEEX_GET_FRAME_SIZE, &N);

Modified: trunk/speex/libspeex/speex_callbacks.c
===================================================================
--- trunk/speex/libspeex/speex_callbacks.c	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/libspeex/speex_callbacks.c	2006-08-28 10:11:26 UTC (rev 11803)
@@ -73,7 +73,7 @@
 
 int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data)
 {
-   int m;
+   spx_int32_t m;
    m = speex_bits_unpack_unsigned(bits, 4);
    speex_encoder_ctl(data, SPEEX_SET_MODE, &m);
    return 0;
@@ -81,7 +81,7 @@
 
 int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data)
 {
-   int m;
+   spx_int32_t m;
    m = speex_bits_unpack_unsigned(bits, 4);
    speex_encoder_ctl(data, SPEEX_SET_LOW_MODE, &m);
    return 0;
@@ -89,7 +89,7 @@
 
 int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data)
 {
-   int m;
+   spx_int32_t m;
    m = speex_bits_unpack_unsigned(bits, 4);
    speex_encoder_ctl(data, SPEEX_SET_HIGH_MODE, &m);
    return 0;
@@ -97,7 +97,7 @@
 
 int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data)
 {
-   int vbr;
+   spx_int32_t vbr;
    vbr = speex_bits_unpack_unsigned(bits, 1);
    speex_encoder_ctl(data, SPEEX_SET_VBR, &vbr);
    return 0;
@@ -105,7 +105,7 @@
 
 int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data)
 {
-   int enh;
+   spx_int32_t enh;
    enh = speex_bits_unpack_unsigned(bits, 1);
    speex_decoder_ctl(data, SPEEX_SET_ENH, &enh);
    return 0;
@@ -113,7 +113,7 @@
 
 int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data)
 {
-   int qual;
+   float qual;
    qual = speex_bits_unpack_unsigned(bits, 4);
    speex_encoder_ctl(data, SPEEX_SET_VBR_QUALITY, &qual);
    return 0;

Modified: trunk/speex/libspeex/testenc.c
===================================================================
--- trunk/speex/libspeex/testenc.c	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/libspeex/testenc.c	2006-08-28 10:11:26 UTC (rev 11803)
@@ -27,7 +27,7 @@
    void *st;
    void *dec;
    SpeexBits bits;
-   int tmp;
+   spx_int32_t tmp;
    int bitCount=0;
    int skip_group_delay;
    SpeexCallback callback;

Modified: trunk/speex/libspeex/testenc_uwb.c
===================================================================
--- trunk/speex/libspeex/testenc_uwb.c	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/libspeex/testenc_uwb.c	2006-08-28 10:11:26 UTC (rev 11803)
@@ -28,7 +28,7 @@
    void *st;
    void *dec;
    SpeexBits bits;
-   int tmp;
+   spx_int32_t tmp;
    int bitCount=0;
    int skip_group_delay;
    SpeexCallback callback;

Modified: trunk/speex/libspeex/testenc_wb.c
===================================================================
--- trunk/speex/libspeex/testenc_wb.c	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/libspeex/testenc_wb.c	2006-08-28 10:11:26 UTC (rev 11803)
@@ -28,7 +28,7 @@
    void *st;
    void *dec;
    SpeexBits bits;
-   int tmp;
+   spx_int32_t tmp;
    int bitCount=0;
    int skip_group_delay;
    SpeexCallback callback;

Modified: trunk/speex/src/speexdec.c
===================================================================
--- trunk/speex/src/speexdec.c	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/src/speexdec.c	2006-08-28 10:11:26 UTC (rev 11803)
@@ -299,7 +299,7 @@
    printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n");
 }
 
-static void *process_header(ogg_packet *op, int enh_enabled, int *frame_size, int *granule_frame_size, int *rate, int *nframes, int forceMode, int *channels, SpeexStereoState *stereo, int *extra_headers, int quiet)
+static void *process_header(ogg_packet *op, spx_int32_t enh_enabled, spx_int32_t *frame_size, int *granule_frame_size, spx_int32_t *rate, int *nframes, int forceMode, int *channels, SpeexStereoState *stereo, int *extra_headers, int quiet)
 {
    void *st;
    const SpeexMode *mode;
@@ -459,7 +459,7 @@
    SpeexStereoState stereo = SPEEX_STEREO_STATE_INIT;
    int channels=-1;
    int rate=0;
-   int extra_headers;
+   int extra_headers=0;
    int wav_format=0;
    int lookahead;
    int speex_serialno = -1;
@@ -693,7 +693,7 @@
                      speex_decode_stereo_int(output, frame_size, &stereo);
 
                   if (print_bitrate) {
-                     int tmp;
+                     spx_int32_t tmp;
                      char ch=13;
                      speex_decoder_ctl(st, SPEEX_GET_BITRATE, &tmp);
                      fputc (ch, stderr);

Modified: trunk/speex/src/speexenc.c
===================================================================
--- trunk/speex/src/speexenc.c	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/src/speexenc.c	2006-08-28 10:11:26 UTC (rev 11803)
@@ -80,7 +80,7 @@
 #define MAX_FRAME_BYTES 2000
 
 /* Convert input audio bits, endians and channels */
-static int read_samples(FILE *fin,int frame_size, int bits, int channels, int lsb, short * input, char *buff, int *size)
+static int read_samples(FILE *fin,int frame_size, int bits, int channels, int lsb, short * input, char *buff, spx_int32_t *size)
 {   
    unsigned char in[MAX_FRAME_BYTES*2];
    int i;
@@ -253,13 +253,13 @@
    char *inFile, *outFile;
    FILE *fin, *fout;
    short input[MAX_FRAME_SIZE];
-   int frame_size;
+   spx_int32_t frame_size;
    int quiet=0;
-   int vbr_enabled=0;
+   spx_int32_t vbr_enabled=0;
    spx_int32_t vbr_max=0;
    int abr_enabled=0;
-   int vad_enabled=0;
-   int dtx_enabled=0;
+   spx_int32_t vad_enabled=0;
+   spx_int32_t dtx_enabled=0;
    int nbBytes;
    const SpeexMode *mode=NULL;
    int modeID = -1;
@@ -300,10 +300,11 @@
       {0, 0, 0, 0}
    };
    int print_bitrate=0;
-   int rate=0, size;
+   spx_int32_t rate=0;
+   spx_int32_t size;
    int chan=1;
    int fmt=16;
-   int quality=-1;
+   spx_int32_t quality=-1;
    float vbr_quality=-1;
    int lsb=1;
    ogg_stream_state os;
@@ -314,20 +315,20 @@
    int id=-1;
    SpeexHeader header;
    int nframes=1;
-   int complexity=3;
+   spx_int32_t complexity=3;
    char *vendor_string = "Encoded with Speex " SPEEX_VERSION;
    char *comments;
    int comments_length;
    int close_in=0, close_out=0;
    int eos=0;
-   int bitrate=0;
+   spx_int32_t bitrate=0;
    double cumul_bits=0, enc_frames=0;
    char first_bytes[12];
    int wave_input=0;
-   int tmp;
+   spx_int32_t tmp;
    SpeexPreprocessState *preprocess = NULL;
    int denoise_enabled=0, agc_enabled=0;
-   int lookahead = 0;
+   spx_int32_t lookahead = 0;
    
    comment_init(&comments, &comments_length, vendor_string);
 

Modified: trunk/speex/src/wav_io.c
===================================================================
--- trunk/speex/src/wav_io.c	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/src/wav_io.c	2006-08-28 10:11:26 UTC (rev 11803)
@@ -71,13 +71,13 @@
 }
 
 
-int read_wav_header(FILE *file, int *rate, int *channels, int *format, int *size)
+int read_wav_header(FILE *file, int *rate, int *channels, int *format, spx_int32_t *size)
 {
    char ch[5];
-   int itmp;
-   short stmp;
-   int bpersec;
-   short balign;
+   spx_int32_t itmp;
+   spx_int16_t stmp;
+   spx_int32_t bpersec;
+   spx_int16_t balign;
    int skip_bytes;
    int i;
 
@@ -221,8 +221,8 @@
 void write_wav_header(FILE *file, int rate, int channels, int format, int size)
 {
    char ch[5];
-   int itmp;
-   short stmp;
+   spx_int32_t itmp;
+   spx_int16_t stmp;
 
    ch[4]=0;
 

Modified: trunk/speex/src/wav_io.h
===================================================================
--- trunk/speex/src/wav_io.h	2006-08-27 18:32:52 UTC (rev 11802)
+++ trunk/speex/src/wav_io.h	2006-08-28 10:11:26 UTC (rev 11803)
@@ -39,7 +39,7 @@
 unsigned short le_short(unsigned short s);
 spx_uint32_t le_int(spx_uint32_t i);
 
-int read_wav_header(FILE *file, int *rate, int *channels, int *format, int *size);
+int read_wav_header(FILE *file, int *rate, int *channels, int *format, spx_int32_t *size);
 
 void write_wav_header(FILE *file, int rate, int channels, int format, int size);
 



More information about the commits mailing list