Changeset 823 for pjproject/trunk/pjmedia/src/pjmedia-codec/speex/nb_celp.c
- Timestamp:
- Nov 23, 2006 10:19:46 AM (17 years ago)
- 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 Valin1 /* Copyright (C) 2002-2006 Jean-Marc Valin 2 2 File: nb_celp.c 3 3 … … 88 88 #else 89 89 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 90 const float exc_gain_quant_scal3_bound[7]={0.112338f, 0.236980f, 0.369316f, 0.492054f, 0.637471f, 0.828874f, 1.132784f}; 91 const float exc_gain_quant_scal3[8]={0.061130f, 0.163546f, 0.310413f, 0.428220f, 0.555887f, 0.719055f, 0.938694f, 1.326874f}; 92 const float exc_gain_quant_scal1_bound[1]={0.87798f}; 93 const 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 98 98 99 99 #endif … … 151 151 #ifdef VORBIS_PSYCHO 152 152 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)); 156 156 #endif 157 157 … … 159 159 160 160 /* 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)); 162 162 /* 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)); 164 164 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)); 166 166 st->sw = st->swBuf + mode->pitchEnd + 2; 167 167 … … 169 169 170 170 /* 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)); 172 172 for (i=0;i<st->lpcSize+1;i++) 173 173 st->lagWindow[i]=16384*exp(-.5*sqr(2*M_PI*st->lag_factor*i)); 174 174 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)); 177 177 st->first = 1; 178 178 for (i=0;i<st->lpcSize;i++) … … 181 181 } 182 182 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)); 190 190 st->innov_save = NULL; 191 191 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)); 195 195 vbr_init(st->vbr); 196 196 st->vbr_quality = 8; … … 206 206 st->sampling_rate=8000; 207 207 st->dtx_count=0; 208 208 st->isWideband = 0; 209 st->highpass_enabled = 1; 210 209 211 #ifdef ENABLE_VALGRIND 210 212 VALGRIND_MAKE_READABLE(st, (st->stack-(char*)st)); … … 279 281 int ol_pitch_id=0; 280 282 #endif 281 spx_word16_t *in = vin;283 spx_word16_t *in = (spx_word16_t*)vin; 282 284 283 285 st=(EncState *)state; … … 298 300 speex_move(st->swBuf, st->swBuf+st->frameSize, (st->max_pitch+2)*sizeof(spx_word16_t)); 299 301 302 if (st->highpass_enabled) 303 highpass(in, in, st->frameSize, (st->isWideband?HIGHPASS_WIDEBAND:HIGHPASS_NARROWBAND)|HIGHPASS_INPUT, st->mem_hp); 304 300 305 { 301 306 VARDECL(spx_word16_t *w_sig); … … 486 491 if (st->vbr_enabled) 487 492 { 488 int mode;493 spx_int32_t mode; 489 494 int choice=0; 490 495 float min_diff=100; … … 536 541 if (st->abr_enabled) 537 542 { 538 int bitrate;543 spx_int32_t bitrate; 539 544 speex_encoder_ctl(state, SPEEX_GET_BITRATE, &bitrate); 540 545 st->abr_drift+=(bitrate-st->abr_enabled); … … 834 839 st->mem_sw[i]=mem[i]; 835 840 836 /* Compute target signal */841 /* Compute target signal (saturation prevents overflows on clipped input speech) */ 837 842 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)); 839 844 840 845 /* Reset excitation */ … … 904 909 innov[i]=0; 905 910 911 /* FIXME: Make sure this is save from overflows (so far so good) */ 906 912 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))); 908 914 909 915 ener = SHL32(EXTEND32(compute_rms16(real_exc, st->subframeSize)),SIG_SHIFT); … … 956 962 957 963 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)); 959 965 } else { 960 966 speex_error("No fixed codebook"); … … 1077 1083 st->lpc_enh_enabled=1; 1078 1084 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)); 1080 1086 st->exc = st->excBuf + 2*st->max_pitch + st->subframeSize + 6; 1081 1087 for (i=0;i<st->frameSize + st->max_pitch + 1;i++) 1082 1088 st->excBuf[i]=0; 1083 1089 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)); 1088 1094 st->last_pitch = 40; 1089 1095 st->count_lost=0; … … 1103 1109 st->voc_offset=0; 1104 1110 st->dtx_enabled=0; 1111 st->isWideband = 0; 1112 st->highpass_enabled = 1; 1113 1105 1114 #ifdef ENABLE_VALGRIND 1106 1115 VALGRIND_MAKE_READABLE(st, (st->stack-(char*)st)); … … 1138 1147 static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack) 1139 1148 { 1140 int i , sub;1149 int i; 1141 1150 int pitch_val; 1142 1151 spx_word16_t pitch_gain; … … 1144 1153 spx_word16_t gain_med; 1145 1154 spx_word16_t innov_gain; 1155 spx_word16_t noise_gain; 1146 1156 1147 1157 if (st->count_lost<10) … … 1164 1174 pitch_gain=.85; 1165 1175 #endif 1166 1167 1176 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)))); 1169 1180 /* Shift all buffers by one frame */ 1170 1181 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); 1209 1201 1210 1202 st->first = 0; … … 1239 1231 int ol_pitch_id=0; 1240 1232 #endif 1241 spx_word16_t *out = vout;1233 spx_word16_t *out = (spx_word16_t*)vout; 1242 1234 VARDECL(spx_lsp_t *interp_qlsp); 1243 1235 … … 1436 1428 qe = speex_bits_unpack_unsigned(bits, 5); 1437 1429 #ifdef FIXED_POINT 1430 /* FIXME: Perhaps we could slightly lower the gain here when the output is going to saturate? */ 1438 1431 ol_gain = MULT16_32_Q15(28406,ol_gain_table[qe]); 1439 1432 #else … … 1585 1578 { 1586 1579 /*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); 1588 1581 } else { 1589 1582 speex_error("No fixed codebook"); … … 1629 1622 } else { 1630 1623 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)); 1632 1625 /*print_vec(exc, 40, "innov");*/ 1633 1626 } … … 1645 1638 for (i=0;i<st->subframeSize;i++) 1646 1639 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); 1648 1641 signal_mul(innov2, innov2, MULT16_32_Q15(QCONST16(0.454545,15),ener), st->subframeSize); 1649 1642 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)); 1651 1644 if (innov_save) 1652 1645 { … … 1679 1672 gain32 = PDIV32(ol_gain, ADD16(exc_ener,1)); 1680 1673 #ifdef FIXED_POINT 1681 if (gain32 > 3276 8)1682 gain32 = 3276 8;1674 if (gain32 > 32767) 1675 gain32 = 32767; 1683 1676 gain = EXTRACT16(gain32); 1684 1677 #else … … 1735 1728 } 1736 1729 1730 if (st->highpass_enabled) 1731 highpass(out, out, st->frameSize, (st->isWideband?HIGHPASS_WIDEBAND:HIGHPASS_NARROWBAND)|HIGHPASS_OUTPUT, st->mem_hp); 1737 1732 /*for (i=0;i<st->frameSize;i++) 1738 1733 printf ("%d\n", (int)st->frame[i]);*/ … … 1767 1762 { 1768 1763 case SPEEX_GET_FRAME_SIZE: 1769 (*( int*)ptr) = st->frameSize;1764 (*(spx_int32_t*)ptr) = st->frameSize; 1770 1765 break; 1771 1766 case SPEEX_SET_LOW_MODE: 1772 1767 case SPEEX_SET_MODE: 1773 st->submodeSelect = st->submodeID = (*( int*)ptr);1768 st->submodeSelect = st->submodeID = (*(spx_int32_t*)ptr); 1774 1769 break; 1775 1770 case SPEEX_GET_LOW_MODE: 1776 1771 case SPEEX_GET_MODE: 1777 (*( int*)ptr) = st->submodeID;1772 (*(spx_int32_t*)ptr) = st->submodeID; 1778 1773 break; 1779 1774 case SPEEX_SET_VBR: 1780 st->vbr_enabled = (*( int*)ptr);1775 st->vbr_enabled = (*(spx_int32_t*)ptr); 1781 1776 break; 1782 1777 case SPEEX_GET_VBR: 1783 (*( int*)ptr) = st->vbr_enabled;1778 (*(spx_int32_t*)ptr) = st->vbr_enabled; 1784 1779 break; 1785 1780 case SPEEX_SET_VAD: 1786 st->vad_enabled = (*( int*)ptr);1781 st->vad_enabled = (*(spx_int32_t*)ptr); 1787 1782 break; 1788 1783 case SPEEX_GET_VAD: 1789 (*( int*)ptr) = st->vad_enabled;1784 (*(spx_int32_t*)ptr) = st->vad_enabled; 1790 1785 break; 1791 1786 case SPEEX_SET_DTX: 1792 st->dtx_enabled = (*( int*)ptr);1787 st->dtx_enabled = (*(spx_int32_t*)ptr); 1793 1788 break; 1794 1789 case SPEEX_GET_DTX: 1795 (*( int*)ptr) = st->dtx_enabled;1790 (*(spx_int32_t*)ptr) = st->dtx_enabled; 1796 1791 break; 1797 1792 case SPEEX_SET_ABR: … … 1800 1795 if (st->vbr_enabled) 1801 1796 { 1802 int i=10;1797 spx_int32_t i=10; 1803 1798 spx_int32_t rate, target; 1804 1799 float vbr_qual; … … 1833 1828 case SPEEX_SET_QUALITY: 1834 1829 { 1835 int quality = (*( int*)ptr);1830 int quality = (*(spx_int32_t*)ptr); 1836 1831 if (quality < 0) 1837 1832 quality = 0; … … 1842 1837 break; 1843 1838 case SPEEX_SET_COMPLEXITY: 1844 st->complexity = (*( int*)ptr);1839 st->complexity = (*(spx_int32_t*)ptr); 1845 1840 if (st->complexity<0) 1846 1841 st->complexity=0; … … 1851 1846 case SPEEX_SET_BITRATE: 1852 1847 { 1853 int i=10;1848 spx_int32_t i=10; 1854 1849 spx_int32_t rate, target; 1855 1850 target = (*(spx_int32_t*)ptr); … … 1892 1887 break; 1893 1888 case SPEEX_SET_SUBMODE_ENCODING: 1894 st->encode_submode = (*( int*)ptr);1889 st->encode_submode = (*(spx_int32_t*)ptr); 1895 1890 break; 1896 1891 case SPEEX_GET_SUBMODE_ENCODING: 1897 (*( int*)ptr) = st->encode_submode;1892 (*(spx_int32_t*)ptr) = st->encode_submode; 1898 1893 break; 1899 1894 case SPEEX_GET_LOOKAHEAD: 1900 (*( int*)ptr)=(st->windowSize-st->frameSize);1895 (*(spx_int32_t*)ptr)=(st->windowSize-st->frameSize); 1901 1896 break; 1902 1897 case SPEEX_SET_PLC_TUNING: 1903 st->plc_tuning = (*( int*)ptr);1898 st->plc_tuning = (*(spx_int32_t*)ptr); 1904 1899 if (st->plc_tuning>100) 1905 1900 st->plc_tuning=100; 1906 1901 break; 1907 1902 case SPEEX_GET_PLC_TUNING: 1908 (*( int*)ptr)=(st->plc_tuning);1903 (*(spx_int32_t*)ptr)=(st->plc_tuning); 1909 1904 break; 1910 1905 case SPEEX_SET_VBR_MAX_BITRATE: … … 1914 1909 (*(spx_int32_t*)ptr) = st->vbr_max; 1915 1910 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; 1917 1917 1918 1918 /* This is all internal stuff past this point */ … … 1937 1937 break; 1938 1938 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); 1940 1943 break; 1941 1944 default: … … 1954 1957 case SPEEX_SET_LOW_MODE: 1955 1958 case SPEEX_SET_MODE: 1956 st->submodeID = (*( int*)ptr);1959 st->submodeID = (*(spx_int32_t*)ptr); 1957 1960 break; 1958 1961 case SPEEX_GET_LOW_MODE: 1959 1962 case SPEEX_GET_MODE: 1960 (*( int*)ptr) = st->submodeID;1963 (*(spx_int32_t*)ptr) = st->submodeID; 1961 1964 break; 1962 1965 case SPEEX_SET_ENH: 1963 st->lpc_enh_enabled = *(( int*)ptr);1966 st->lpc_enh_enabled = *((spx_int32_t*)ptr); 1964 1967 break; 1965 1968 case SPEEX_GET_ENH: 1966 *(( int*)ptr) = st->lpc_enh_enabled;1969 *((spx_int32_t*)ptr) = st->lpc_enh_enabled; 1967 1970 break; 1968 1971 case SPEEX_GET_FRAME_SIZE: 1969 (*( int*)ptr) = st->frameSize;1972 (*(spx_int32_t*)ptr) = st->frameSize; 1970 1973 break; 1971 1974 case SPEEX_GET_BITRATE: … … 2007 2010 break; 2008 2011 case SPEEX_SET_SUBMODE_ENCODING: 2009 st->encode_submode = (*( int*)ptr);2012 st->encode_submode = (*(spx_int32_t*)ptr); 2010 2013 break; 2011 2014 case SPEEX_GET_SUBMODE_ENCODING: 2012 (*( int*)ptr) = st->encode_submode;2015 (*(spx_int32_t*)ptr) = st->encode_submode; 2013 2016 break; 2014 2017 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 2017 2027 case SPEEX_GET_PI_GAIN: 2018 2028 { … … 2032 2042 break; 2033 2043 case SPEEX_GET_DTX_STATUS: 2034 *(( int*)ptr) = st->dtx_enabled;2044 *((spx_int32_t*)ptr) = st->dtx_enabled; 2035 2045 break; 2036 2046 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); 2038 2051 break; 2039 2052 default:
Note: See TracChangeset
for help on using the changeset viewer.