Ignore:
Timestamp:
Nov 23, 2006 10:19:46 AM (17 years ago)
Author:
bennylp
Message:

Updated Speex to their latest SVN (1.2-beta). AEC seems
to work much better now and take less CPU, so I increased
default tail length in PJSUA to 800ms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/speex/nb_celp.c

    r628 r823  
    1 /* Copyright (C) 2002 Jean-Marc Valin  
     1/* Copyright (C) 2002-2006 Jean-Marc Valin  
    22   File: nb_celp.c 
    33 
     
    8888#else 
    8989 
    90 const float exc_gain_quant_scal3_bound[7]={0.112338, 0.236980, 0.369316, 0.492054, 0.637471, 0.828874, 1.132784}; 
    91 const float exc_gain_quant_scal3[8]={0.061130, 0.163546, 0.310413, 0.428220, 0.555887, 0.719055, 0.938694, 1.326874}; 
    92 const float exc_gain_quant_scal1_bound[1]={0.87798}; 
    93 const float exc_gain_quant_scal1[2]={0.70469, 1.05127}; 
    94  
    95 #define LSP_MARGIN .002 
    96 #define LSP_DELTA1 .2 
    97 #define LSP_DELTA2 .05 
     90const float exc_gain_quant_scal3_bound[7]={0.112338f, 0.236980f, 0.369316f, 0.492054f, 0.637471f, 0.828874f, 1.132784f}; 
     91const float exc_gain_quant_scal3[8]={0.061130f, 0.163546f, 0.310413f, 0.428220f, 0.555887f, 0.719055f, 0.938694f, 1.326874f}; 
     92const float exc_gain_quant_scal1_bound[1]={0.87798f}; 
     93const float exc_gain_quant_scal1[2]={0.70469f, 1.05127f}; 
     94 
     95#define LSP_MARGIN .002f 
     96#define LSP_DELTA1 .2f 
     97#define LSP_DELTA2 .05f 
    9898 
    9999#endif 
     
    151151#ifdef VORBIS_PSYCHO 
    152152   st->psy = vorbis_psy_init(8000, 256); 
    153    st->curve = speex_alloc(128*sizeof(float)); 
    154    st->old_curve = speex_alloc(128*sizeof(float)); 
    155    st->psy_window = speex_alloc(256*sizeof(float)); 
     153   st->curve = (float*)speex_alloc(128*sizeof(float)); 
     154   st->old_curve = (float*)speex_alloc(128*sizeof(float)); 
     155   st->psy_window = (float*)speex_alloc(256*sizeof(float)); 
    156156#endif 
    157157 
     
    159159 
    160160   /* Allocating input buffer */ 
    161    st->winBuf = speex_alloc((st->windowSize-st->frameSize)*sizeof(spx_word16_t)); 
     161   st->winBuf = (spx_word16_t*)speex_alloc((st->windowSize-st->frameSize)*sizeof(spx_word16_t)); 
    162162   /* Allocating excitation buffer */ 
    163    st->excBuf = speex_alloc((mode->frameSize+mode->pitchEnd+2)*sizeof(spx_word16_t)); 
     163   st->excBuf = (spx_word16_t*)speex_alloc((mode->frameSize+mode->pitchEnd+2)*sizeof(spx_word16_t)); 
    164164   st->exc = st->excBuf + mode->pitchEnd + 2; 
    165    st->swBuf = speex_alloc((mode->frameSize+mode->pitchEnd+2)*sizeof(spx_word16_t)); 
     165   st->swBuf = (spx_word16_t*)speex_alloc((mode->frameSize+mode->pitchEnd+2)*sizeof(spx_word16_t)); 
    166166   st->sw = st->swBuf + mode->pitchEnd + 2; 
    167167 
     
    169169    
    170170   /* Create the window for autocorrelation (lag-windowing) */ 
    171    st->lagWindow = speex_alloc((st->lpcSize+1)*sizeof(spx_word16_t)); 
     171   st->lagWindow = (spx_word16_t*)speex_alloc((st->lpcSize+1)*sizeof(spx_word16_t)); 
    172172   for (i=0;i<st->lpcSize+1;i++) 
    173173      st->lagWindow[i]=16384*exp(-.5*sqr(2*M_PI*st->lag_factor*i)); 
    174174 
    175    st->old_lsp = speex_alloc((st->lpcSize)*sizeof(spx_lsp_t)); 
    176    st->old_qlsp = speex_alloc((st->lpcSize)*sizeof(spx_lsp_t)); 
     175   st->old_lsp = (spx_lsp_t*)speex_alloc((st->lpcSize)*sizeof(spx_lsp_t)); 
     176   st->old_qlsp = (spx_lsp_t*)speex_alloc((st->lpcSize)*sizeof(spx_lsp_t)); 
    177177   st->first = 1; 
    178178   for (i=0;i<st->lpcSize;i++) 
     
    181181   } 
    182182 
    183    st->mem_sp = speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); 
    184    st->mem_sw = speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); 
    185    st->mem_sw_whole = speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); 
    186    st->mem_exc = speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); 
    187    st->mem_exc2 = speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); 
    188  
    189    st->pi_gain = speex_alloc((st->nbSubframes)*sizeof(spx_word32_t)); 
     183   st->mem_sp = (spx_mem_t*)speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); 
     184   st->mem_sw = (spx_mem_t*)speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); 
     185   st->mem_sw_whole = (spx_mem_t*)speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); 
     186   st->mem_exc = (spx_mem_t*)speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); 
     187   st->mem_exc2 = (spx_mem_t*)speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); 
     188 
     189   st->pi_gain = (spx_word32_t*)speex_alloc((st->nbSubframes)*sizeof(spx_word32_t)); 
    190190   st->innov_save = NULL; 
    191191    
    192    st->pitch = speex_alloc((st->nbSubframes)*sizeof(int)); 
    193  
    194    st->vbr = speex_alloc(sizeof(VBRState)); 
     192   st->pitch = (int*)speex_alloc((st->nbSubframes)*sizeof(int)); 
     193 
     194   st->vbr = (VBRState*)speex_alloc(sizeof(VBRState)); 
    195195   vbr_init(st->vbr); 
    196196   st->vbr_quality = 8; 
     
    206206   st->sampling_rate=8000; 
    207207   st->dtx_count=0; 
    208  
     208   st->isWideband = 0; 
     209   st->highpass_enabled = 1; 
     210    
    209211#ifdef ENABLE_VALGRIND 
    210212   VALGRIND_MAKE_READABLE(st, (st->stack-(char*)st)); 
     
    279281   int ol_pitch_id=0; 
    280282#endif 
    281    spx_word16_t *in = vin; 
     283   spx_word16_t *in = (spx_word16_t*)vin; 
    282284 
    283285   st=(EncState *)state; 
     
    298300   speex_move(st->swBuf, st->swBuf+st->frameSize, (st->max_pitch+2)*sizeof(spx_word16_t)); 
    299301 
     302   if (st->highpass_enabled) 
     303      highpass(in, in, st->frameSize, (st->isWideband?HIGHPASS_WIDEBAND:HIGHPASS_NARROWBAND)|HIGHPASS_INPUT, st->mem_hp); 
     304    
    300305   { 
    301306      VARDECL(spx_word16_t *w_sig); 
     
    486491      if (st->vbr_enabled)  
    487492      { 
    488          int mode; 
     493         spx_int32_t mode; 
    489494         int choice=0; 
    490495         float min_diff=100; 
     
    536541         if (st->abr_enabled) 
    537542         { 
    538             int bitrate; 
     543            spx_int32_t bitrate; 
    539544            speex_encoder_ctl(state, SPEEX_GET_BITRATE, &bitrate); 
    540545            st->abr_drift+=(bitrate-st->abr_enabled); 
     
    834839            st->mem_sw[i]=mem[i]; 
    835840       
    836       /* Compute target signal */ 
     841      /* Compute target signal (saturation prevents overflows on clipped input speech) */ 
    837842      for (i=0;i<st->subframeSize;i++) 
    838          target[i]=SUB16(sw[i],PSHR32(ringing[i],1)); 
     843         target[i]=EXTRACT16(SATURATE(SUB32(sw[i],PSHR32(ringing[i],1)),32767)); 
    839844 
    840845      /* Reset excitation */ 
     
    904909            innov[i]=0; 
    905910          
     911         /* FIXME: Make sure this is save from overflows (so far so good) */ 
    906912         for (i=0;i<st->subframeSize;i++) 
    907             real_exc[i] = SUB16(real_exc[i], PSHR32(exc32[i],SIG_SHIFT-1)); 
     913            real_exc[i] = SUB16(real_exc[i], EXTRACT16(PSHR32(exc32[i],SIG_SHIFT-1))); 
    908914 
    909915         ener = SHL32(EXTEND32(compute_rms16(real_exc, st->subframeSize)),SIG_SHIFT); 
     
    956962 
    957963            for (i=0;i<st->subframeSize;i++) 
    958                exc[i] = EXTRACT16(PSHR32(ADD32(SHL32(exc32[i],1),innov[i]),SIG_SHIFT)); 
     964               exc[i] = EXTRACT16(SATURATE32(PSHR32(ADD32(SHL32(exc32[i],1),innov[i]),SIG_SHIFT),32767)); 
    959965         } else { 
    960966            speex_error("No fixed codebook"); 
     
    10771083   st->lpc_enh_enabled=1; 
    10781084 
    1079    st->excBuf = speex_alloc((st->frameSize + 2*st->max_pitch + st->subframeSize + 12)*sizeof(spx_word16_t)); 
     1085   st->excBuf = (spx_word16_t*)speex_alloc((st->frameSize + 2*st->max_pitch + st->subframeSize + 12)*sizeof(spx_word16_t)); 
    10801086   st->exc = st->excBuf + 2*st->max_pitch + st->subframeSize + 6; 
    10811087   for (i=0;i<st->frameSize + st->max_pitch + 1;i++) 
    10821088      st->excBuf[i]=0; 
    10831089 
    1084    st->interp_qlpc = speex_alloc(st->lpcSize*sizeof(spx_coef_t)); 
    1085    st->old_qlsp = speex_alloc(st->lpcSize*sizeof(spx_lsp_t)); 
    1086    st->mem_sp = speex_alloc(st->lpcSize*sizeof(spx_mem_t)); 
    1087    st->pi_gain = speex_alloc((st->nbSubframes)*sizeof(spx_word32_t)); 
     1090   st->interp_qlpc = (spx_coef_t*)speex_alloc(st->lpcSize*sizeof(spx_coef_t)); 
     1091   st->old_qlsp = (spx_lsp_t*)speex_alloc(st->lpcSize*sizeof(spx_lsp_t)); 
     1092   st->mem_sp = (spx_mem_t*)speex_alloc(st->lpcSize*sizeof(spx_mem_t)); 
     1093   st->pi_gain = (spx_word32_t*)speex_alloc((st->nbSubframes)*sizeof(spx_word32_t)); 
    10881094   st->last_pitch = 40; 
    10891095   st->count_lost=0; 
     
    11031109   st->voc_offset=0; 
    11041110   st->dtx_enabled=0; 
     1111   st->isWideband = 0; 
     1112   st->highpass_enabled = 1; 
     1113 
    11051114#ifdef ENABLE_VALGRIND 
    11061115   VALGRIND_MAKE_READABLE(st, (st->stack-(char*)st)); 
     
    11381147static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack) 
    11391148{ 
    1140    int i, sub; 
     1149   int i; 
    11411150   int pitch_val; 
    11421151   spx_word16_t pitch_gain; 
     
    11441153   spx_word16_t gain_med; 
    11451154   spx_word16_t innov_gain; 
     1155   spx_word16_t noise_gain; 
    11461156    
    11471157   if (st->count_lost<10) 
     
    11641174      pitch_gain=.85; 
    11651175#endif 
    1166  
    11671176   pitch_gain = MULT16_16_Q15(fact,pitch_gain) + VERY_SMALL; 
    1168  
     1177   /* FIXME: This was rms of innovation (not exc) */ 
     1178   innov_gain = compute_rms16(st->exc, st->frameSize); 
     1179   noise_gain = MULT16_16_Q15(innov_gain, MULT16_16_Q15(fact, SUB16(Q15ONE,MULT16_16_Q15(pitch_gain,pitch_gain)))); 
    11691180   /* Shift all buffers by one frame */ 
    11701181   speex_move(st->excBuf, st->excBuf+st->frameSize, (2*st->max_pitch + st->subframeSize + 12)*sizeof(spx_word16_t)); 
    1171    for (sub=0;sub<st->nbSubframes;sub++) 
    1172    { 
    1173       int offset; 
    1174       spx_word16_t *sp; 
    1175       spx_word16_t *exc; 
    1176       /* Offset relative to start of frame */ 
    1177       offset = st->subframeSize*sub; 
    1178       /* Original signal */ 
    1179       sp=out+offset; 
    1180       /* Excitation */ 
    1181       exc=st->exc+offset; 
    1182       /* Excitation after post-filter*/ 
    1183          
    1184       /* Make up a plausible excitation */ 
    1185       /* FIXME: THIS CAN BE IMPROVED */ 
    1186       /*if (pitch_gain>.95) 
    1187         pitch_gain=.95;*/ 
    1188        
    1189       /* FIXME: This was rms of innovation (not exc) */ 
    1190       innov_gain = compute_rms16(st->exc, st->frameSize); 
    1191       pitch_val = st->last_pitch + SHR32((spx_int32_t)speex_rand(1+st->count_lost, &st->seed),SIG_SHIFT); 
    1192       if (pitch_val > st->max_pitch) 
    1193          pitch_val = st->max_pitch; 
    1194       if (pitch_val < st->min_pitch) 
    1195          pitch_val = st->min_pitch; 
    1196       for (i=0;i<st->subframeSize;i++) 
    1197       { 
    1198          /* FIXME: Second term need to be 16-bit */ 
    1199          exc[i]= MULT16_16_Q15(pitch_gain, (exc[i-pitch_val]+VERY_SMALL)) +  
    1200                MULT16_16_Q15(fact, MULT16_16_Q15(SHL(Q15ONE,15)-SHL(MULT16_16(pitch_gain,pitch_gain),1),speex_rand(innov_gain, &st->seed))); 
    1201       } 
    1202       for (i=0;i<st->subframeSize;i++) 
    1203          sp[i]=exc[i-st->subframeSize]; 
    1204       iir_mem16(sp, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,  
    1205                 st->mem_sp, stack); 
    1206  
    1207       bw_lpc(QCONST16(.98,15), st->interp_qlpc, st->interp_qlpc, st->lpcSize); 
    1208    } 
     1182    
     1183 
     1184   pitch_val = st->last_pitch + SHR32((spx_int32_t)speex_rand(1+st->count_lost, &st->seed),SIG_SHIFT); 
     1185   if (pitch_val > st->max_pitch) 
     1186      pitch_val = st->max_pitch; 
     1187   if (pitch_val < st->min_pitch) 
     1188      pitch_val = st->min_pitch; 
     1189   for (i=0;i<st->frameSize;i++) 
     1190   { 
     1191      st->exc[i]= MULT16_16_Q15(pitch_gain, (st->exc[i-pitch_val]+VERY_SMALL)) +  
     1192            speex_rand(noise_gain, &st->seed); 
     1193   } 
     1194 
     1195   for (i=0;i<st->frameSize;i++) 
     1196      out[i]=st->exc[i-st->subframeSize]; 
     1197   bw_lpc(QCONST16(.98,15), st->interp_qlpc, st->interp_qlpc, st->lpcSize); 
     1198   iir_mem16(out, st->interp_qlpc, out, st->frameSize, st->lpcSize,  
     1199             st->mem_sp, stack); 
     1200   highpass(out, out, st->frameSize, HIGHPASS_NARROWBAND|HIGHPASS_OUTPUT, st->mem_hp); 
    12091201    
    12101202   st->first = 0; 
     
    12391231   int ol_pitch_id=0; 
    12401232#endif 
    1241    spx_word16_t *out = vout; 
     1233   spx_word16_t *out = (spx_word16_t*)vout; 
    12421234   VARDECL(spx_lsp_t *interp_qlsp); 
    12431235 
     
    14361428      qe = speex_bits_unpack_unsigned(bits, 5); 
    14371429#ifdef FIXED_POINT 
     1430      /* FIXME: Perhaps we could slightly lower the gain here when the output is going to saturate? */ 
    14381431      ol_gain = MULT16_32_Q15(28406,ol_gain_table[qe]); 
    14391432#else 
     
    15851578         { 
    15861579            /*Fixed codebook contribution*/ 
    1587             SUBMODE(innovation_unquant)(innov, SUBMODE(innovation_params), st->subframeSize, bits, stack); 
     1580            SUBMODE(innovation_unquant)(innov, SUBMODE(innovation_params), st->subframeSize, bits, stack, &st->seed); 
    15881581         } else { 
    15891582            speex_error("No fixed codebook"); 
     
    16291622         } else { 
    16301623            for (i=0;i<st->subframeSize;i++) 
    1631                exc[i]=PSHR32(ADD32(SHL32(exc32[i],1),innov[i]),SIG_SHIFT); 
     1624               exc[i]=EXTRACT16(SATURATE32(PSHR32(ADD32(SHL32(exc32[i],1),innov[i]),SIG_SHIFT),32767)); 
    16321625            /*print_vec(exc, 40, "innov");*/ 
    16331626         } 
     
    16451638            for (i=0;i<st->subframeSize;i++) 
    16461639               innov2[i]=0; 
    1647             SUBMODE(innovation_unquant)(innov2, SUBMODE(innovation_params), st->subframeSize, bits, stack); 
     1640            SUBMODE(innovation_unquant)(innov2, SUBMODE(innovation_params), st->subframeSize, bits, stack, &st->seed); 
    16481641            signal_mul(innov2, innov2, MULT16_32_Q15(QCONST16(0.454545,15),ener), st->subframeSize); 
    16491642            for (i=0;i<st->subframeSize;i++) 
    1650                exc[i] = ADD16(exc[i],PSHR32(innov2[i],SIG_SHIFT)); 
     1643               exc[i] = EXTRACT16(SATURATE32(ADD32(EXTEND32(exc[i]),PSHR32(innov2[i],SIG_SHIFT)),32767)); 
    16511644            if (innov_save) 
    16521645            { 
     
    16791672      gain32 = PDIV32(ol_gain, ADD16(exc_ener,1)); 
    16801673#ifdef FIXED_POINT 
    1681       if (gain32 > 32768) 
    1682          gain32 = 32768; 
     1674      if (gain32 > 32767) 
     1675         gain32 = 32767; 
    16831676      gain = EXTRACT16(gain32); 
    16841677#else 
     
    17351728   } 
    17361729 
     1730   if (st->highpass_enabled) 
     1731      highpass(out, out, st->frameSize, (st->isWideband?HIGHPASS_WIDEBAND:HIGHPASS_NARROWBAND)|HIGHPASS_OUTPUT, st->mem_hp); 
    17371732   /*for (i=0;i<st->frameSize;i++) 
    17381733     printf ("%d\n", (int)st->frame[i]);*/ 
     
    17671762   { 
    17681763   case SPEEX_GET_FRAME_SIZE: 
    1769       (*(int*)ptr) = st->frameSize; 
     1764      (*(spx_int32_t*)ptr) = st->frameSize; 
    17701765      break; 
    17711766   case SPEEX_SET_LOW_MODE: 
    17721767   case SPEEX_SET_MODE: 
    1773       st->submodeSelect = st->submodeID = (*(int*)ptr); 
     1768      st->submodeSelect = st->submodeID = (*(spx_int32_t*)ptr); 
    17741769      break; 
    17751770   case SPEEX_GET_LOW_MODE: 
    17761771   case SPEEX_GET_MODE: 
    1777       (*(int*)ptr) = st->submodeID; 
     1772      (*(spx_int32_t*)ptr) = st->submodeID; 
    17781773      break; 
    17791774   case SPEEX_SET_VBR: 
    1780       st->vbr_enabled = (*(int*)ptr); 
     1775      st->vbr_enabled = (*(spx_int32_t*)ptr); 
    17811776      break; 
    17821777   case SPEEX_GET_VBR: 
    1783       (*(int*)ptr) = st->vbr_enabled; 
     1778      (*(spx_int32_t*)ptr) = st->vbr_enabled; 
    17841779      break; 
    17851780   case SPEEX_SET_VAD: 
    1786       st->vad_enabled = (*(int*)ptr); 
     1781      st->vad_enabled = (*(spx_int32_t*)ptr); 
    17871782      break; 
    17881783   case SPEEX_GET_VAD: 
    1789       (*(int*)ptr) = st->vad_enabled; 
     1784      (*(spx_int32_t*)ptr) = st->vad_enabled; 
    17901785      break; 
    17911786   case SPEEX_SET_DTX: 
    1792       st->dtx_enabled = (*(int*)ptr); 
     1787      st->dtx_enabled = (*(spx_int32_t*)ptr); 
    17931788      break; 
    17941789   case SPEEX_GET_DTX: 
    1795       (*(int*)ptr) = st->dtx_enabled; 
     1790      (*(spx_int32_t*)ptr) = st->dtx_enabled; 
    17961791      break; 
    17971792   case SPEEX_SET_ABR: 
     
    18001795      if (st->vbr_enabled)  
    18011796      { 
    1802          int i=10; 
     1797         spx_int32_t i=10; 
    18031798         spx_int32_t rate, target; 
    18041799         float vbr_qual; 
     
    18331828   case SPEEX_SET_QUALITY: 
    18341829      { 
    1835          int quality = (*(int*)ptr); 
     1830         int quality = (*(spx_int32_t*)ptr); 
    18361831         if (quality < 0) 
    18371832            quality = 0; 
     
    18421837      break; 
    18431838   case SPEEX_SET_COMPLEXITY: 
    1844       st->complexity = (*(int*)ptr); 
     1839      st->complexity = (*(spx_int32_t*)ptr); 
    18451840      if (st->complexity<0) 
    18461841         st->complexity=0; 
     
    18511846   case SPEEX_SET_BITRATE: 
    18521847      { 
    1853          int i=10; 
     1848         spx_int32_t i=10; 
    18541849         spx_int32_t rate, target; 
    18551850         target = (*(spx_int32_t*)ptr); 
     
    18921887      break; 
    18931888   case SPEEX_SET_SUBMODE_ENCODING: 
    1894       st->encode_submode = (*(int*)ptr); 
     1889      st->encode_submode = (*(spx_int32_t*)ptr); 
    18951890      break; 
    18961891   case SPEEX_GET_SUBMODE_ENCODING: 
    1897       (*(int*)ptr) = st->encode_submode; 
     1892      (*(spx_int32_t*)ptr) = st->encode_submode; 
    18981893      break; 
    18991894   case SPEEX_GET_LOOKAHEAD: 
    1900       (*(int*)ptr)=(st->windowSize-st->frameSize); 
     1895      (*(spx_int32_t*)ptr)=(st->windowSize-st->frameSize); 
    19011896      break; 
    19021897   case SPEEX_SET_PLC_TUNING: 
    1903       st->plc_tuning = (*(int*)ptr); 
     1898      st->plc_tuning = (*(spx_int32_t*)ptr); 
    19041899      if (st->plc_tuning>100) 
    19051900         st->plc_tuning=100; 
    19061901      break; 
    19071902   case SPEEX_GET_PLC_TUNING: 
    1908       (*(int*)ptr)=(st->plc_tuning); 
     1903      (*(spx_int32_t*)ptr)=(st->plc_tuning); 
    19091904      break; 
    19101905   case SPEEX_SET_VBR_MAX_BITRATE: 
     
    19141909      (*(spx_int32_t*)ptr) = st->vbr_max; 
    19151910      break; 
    1916  
     1911   case SPEEX_SET_HIGHPASS: 
     1912      st->highpass_enabled = (*(spx_int32_t*)ptr); 
     1913      break; 
     1914   case SPEEX_GET_HIGHPASS: 
     1915      (*(spx_int32_t*)ptr) = st->highpass_enabled; 
     1916      break; 
    19171917 
    19181918   /* This is all internal stuff past this point */ 
     
    19371937      break; 
    19381938   case SPEEX_SET_INNOVATION_SAVE: 
    1939       st->innov_save = ptr; 
     1939      st->innov_save = (spx_sig_t*)ptr; 
     1940      break; 
     1941   case SPEEX_SET_WIDEBAND: 
     1942      st->isWideband = *((spx_int32_t*)ptr); 
    19401943      break; 
    19411944   default: 
     
    19541957   case SPEEX_SET_LOW_MODE: 
    19551958   case SPEEX_SET_MODE: 
    1956       st->submodeID = (*(int*)ptr); 
     1959      st->submodeID = (*(spx_int32_t*)ptr); 
    19571960      break; 
    19581961   case SPEEX_GET_LOW_MODE: 
    19591962   case SPEEX_GET_MODE: 
    1960       (*(int*)ptr) = st->submodeID; 
     1963      (*(spx_int32_t*)ptr) = st->submodeID; 
    19611964      break; 
    19621965   case SPEEX_SET_ENH: 
    1963       st->lpc_enh_enabled = *((int*)ptr); 
     1966      st->lpc_enh_enabled = *((spx_int32_t*)ptr); 
    19641967      break; 
    19651968   case SPEEX_GET_ENH: 
    1966       *((int*)ptr) = st->lpc_enh_enabled; 
     1969      *((spx_int32_t*)ptr) = st->lpc_enh_enabled; 
    19671970      break; 
    19681971   case SPEEX_GET_FRAME_SIZE: 
    1969       (*(int*)ptr) = st->frameSize; 
     1972      (*(spx_int32_t*)ptr) = st->frameSize; 
    19701973      break; 
    19711974   case SPEEX_GET_BITRATE: 
     
    20072010      break; 
    20082011   case SPEEX_SET_SUBMODE_ENCODING: 
    2009       st->encode_submode = (*(int*)ptr); 
     2012      st->encode_submode = (*(spx_int32_t*)ptr); 
    20102013      break; 
    20112014   case SPEEX_GET_SUBMODE_ENCODING: 
    2012       (*(int*)ptr) = st->encode_submode; 
     2015      (*(spx_int32_t*)ptr) = st->encode_submode; 
    20132016      break; 
    20142017   case SPEEX_GET_LOOKAHEAD: 
    2015       (*(int*)ptr)=st->subframeSize; 
    2016       break; 
     2018      (*(spx_int32_t*)ptr)=st->subframeSize; 
     2019      break; 
     2020   case SPEEX_SET_HIGHPASS: 
     2021      st->highpass_enabled = (*(spx_int32_t*)ptr); 
     2022      break; 
     2023   case SPEEX_GET_HIGHPASS: 
     2024      (*(spx_int32_t*)ptr) = st->highpass_enabled; 
     2025      break; 
     2026 
    20172027   case SPEEX_GET_PI_GAIN: 
    20182028      { 
     
    20322042      break; 
    20332043   case SPEEX_GET_DTX_STATUS: 
    2034       *((int*)ptr) = st->dtx_enabled; 
     2044      *((spx_int32_t*)ptr) = st->dtx_enabled; 
    20352045      break; 
    20362046   case SPEEX_SET_INNOVATION_SAVE: 
    2037       st->innov_save = ptr; 
     2047      st->innov_save = (spx_sig_t*)ptr; 
     2048      break; 
     2049   case SPEEX_SET_WIDEBAND: 
     2050      st->isWideband = *((spx_int32_t*)ptr); 
    20382051      break; 
    20392052   default: 
Note: See TracChangeset for help on using the changeset viewer.