Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/speexdsp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2007-10-21 18:52:05 +0400
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2007-10-21 18:52:05 +0400
commit9314bad16920056ee453b0e91befbd02cbef10a1 (patch)
treeda513327050e9e95e1621946eec5ffda6e5b9211 /libspeex/nb_celp.c
parentd3537eafe92cea01f4c96937681f395659080e34 (diff)
Re-arranged the wideband mode so that programs using narrowband only and
linking statically don't carry the wideband stuff. git-svn-id: http://svn.xiph.org/trunk/speex@14028 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'libspeex/nb_celp.c')
-rw-r--r--libspeex/nb_celp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libspeex/nb_celp.c b/libspeex/nb_celp.c
index e308477..45c9205 100644
--- a/libspeex/nb_celp.c
+++ b/libspeex/nb_celp.c
@@ -1187,7 +1187,9 @@ static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack)
st->pitch_gain_buf_idx = 0;
}
-
+/* Just so we don't need to carry the complete wideband mode information */
+static const int wb_skip_table[8] = {0, 36, 112, 192, 352, 0, 0, 0};
+
int nb_decode(void *state, SpeexBits *bits, void *vout)
{
DecState *st;
@@ -1246,7 +1248,8 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
int submode;
int advance;
advance = submode = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS);
- speex_mode_query(&speex_wb_mode, SPEEX_SUBMODE_BITS_PER_FRAME, &advance);
+ /*speex_mode_query(&speex_wb_mode, SPEEX_SUBMODE_BITS_PER_FRAME, &advance);*/
+ advance = wb_skip_table[submode];
if (advance < 0)
{
speex_notify("Invalid mode encountered. The stream is corrupted.");
@@ -1261,7 +1264,8 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
if (wideband)
{
advance = submode = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS);
- speex_mode_query(&speex_wb_mode, SPEEX_SUBMODE_BITS_PER_FRAME, &advance);
+ /*speex_mode_query(&speex_wb_mode, SPEEX_SUBMODE_BITS_PER_FRAME, &advance);*/
+ advance = wb_skip_table[submode];
if (advance < 0)
{
speex_notify("Invalid mode encountered. The stream is corrupted.");