diff options
author | jm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800> | 2006-07-03 14:15:26 +0400 |
---|---|---|
committer | jm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800> | 2006-07-03 14:15:26 +0400 |
commit | e2d8a7745d4ceb894a8fc2d9b6bafbfde724a852 (patch) | |
tree | 647574ef8e1ab16301ccae45addae1ac83b97335 /libspeex/nb_celp.c | |
parent | 43437fe4e8010f99ad767a47c9527b67fed32513 (diff) |
changed a few parameter definitions from int to spx_int32_t. Should by more
16-bit friendly.
git-svn-id: http://svn.xiph.org/trunk/speex@11689 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'libspeex/nb_celp.c')
-rw-r--r-- | libspeex/nb_celp.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/libspeex/nb_celp.c b/libspeex/nb_celp.c index c5c80b8..2c41649 100644 --- a/libspeex/nb_celp.c +++ b/libspeex/nb_celp.c @@ -1795,12 +1795,14 @@ int nb_encoder_ctl(void *state, int request, void *ptr) (*(int*)ptr) = st->dtx_enabled; break; case SPEEX_SET_ABR: - st->abr_enabled = (*(int*)ptr); - st->vbr_enabled = 1; + st->abr_enabled = (*(spx_int32_t*)ptr); + st->vbr_enabled = st->abr_enabled!=0; + if (st->vbr_enabled) { - int i=10, rate, target; + int i=10; + spx_int32_t rate, target; float vbr_qual; - target = (*(int*)ptr); + target = (*(spx_int32_t*)ptr); while (i>=0) { speex_encoder_ctl(st, SPEEX_SET_QUALITY, &i); @@ -1820,7 +1822,7 @@ int nb_encoder_ctl(void *state, int request, void *ptr) break; case SPEEX_GET_ABR: - (*(int*)ptr) = st->abr_enabled; + (*(spx_int32_t*)ptr) = st->abr_enabled; break; case SPEEX_SET_VBR_QUALITY: st->vbr_quality = (*(float*)ptr); @@ -1863,15 +1865,15 @@ int nb_encoder_ctl(void *state, int request, void *ptr) break; case SPEEX_GET_BITRATE: if (st->submodes[st->submodeID]) - (*(int*)ptr) = st->sampling_rate*SUBMODE(bits_per_frame)/st->frameSize; + (*(spx_int32_t*)ptr) = st->sampling_rate*SUBMODE(bits_per_frame)/st->frameSize; else - (*(int*)ptr) = st->sampling_rate*(NB_SUBMODE_BITS+1)/st->frameSize; + (*(spx_int32_t*)ptr) = st->sampling_rate*(NB_SUBMODE_BITS+1)/st->frameSize; break; case SPEEX_SET_SAMPLING_RATE: - st->sampling_rate = (*(int*)ptr); + st->sampling_rate = (*(spx_int32_t*)ptr); break; case SPEEX_GET_SAMPLING_RATE: - (*(int*)ptr)=st->sampling_rate; + (*(spx_int32_t*)ptr)=st->sampling_rate; break; case SPEEX_RESET_STATE: { @@ -1968,15 +1970,15 @@ int nb_decoder_ctl(void *state, int request, void *ptr) break; case SPEEX_GET_BITRATE: if (st->submodes[st->submodeID]) - (*(int*)ptr) = st->sampling_rate*SUBMODE(bits_per_frame)/st->frameSize; + (*(spx_int32_t*)ptr) = st->sampling_rate*SUBMODE(bits_per_frame)/st->frameSize; else - (*(int*)ptr) = st->sampling_rate*(NB_SUBMODE_BITS+1)/st->frameSize; + (*(spx_int32_t*)ptr) = st->sampling_rate*(NB_SUBMODE_BITS+1)/st->frameSize; break; case SPEEX_SET_SAMPLING_RATE: - st->sampling_rate = (*(int*)ptr); + st->sampling_rate = (*(spx_int32_t*)ptr); break; case SPEEX_GET_SAMPLING_RATE: - (*(int*)ptr)=st->sampling_rate; + (*(spx_int32_t*)ptr)=st->sampling_rate; break; case SPEEX_SET_HANDLER: { |