summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2007-11-18 23:17:25 +0000
committerThom Johansen <thomj@rockbox.org>2007-11-18 23:17:25 +0000
commitc31818ccf0d7acadb91e95ba02980ced209489e0 (patch)
tree5342137633a5ee1414963d7f12c0764a79fdc7d8 /apps
parentc46de8ab734fa3a848056a7b69806859c4b582df (diff)
Disable some UWB mode stuff and lost package handling in voice codec.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15676 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/libspeex/modes_wb.c8
-rw-r--r--apps/codecs/libspeex/nb_celp.c4
-rw-r--r--apps/codecs/libspeex/sb_celp.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/apps/codecs/libspeex/modes_wb.c b/apps/codecs/libspeex/modes_wb.c
index af16cdd775..8e351db60d 100644
--- a/apps/codecs/libspeex/modes_wb.c
+++ b/apps/codecs/libspeex/modes_wb.c
@@ -52,7 +52,11 @@
#define NULL 0
#endif
+#ifndef ROCKBOX_VOICE_CODEC
const SpeexMode * const speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode};
+#else
+const SpeexMode * const speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, NULL};
+#endif
extern const signed char hexc_table[];
extern const signed char hexc_10_32_table[];
@@ -279,6 +283,7 @@ const SpeexMode speex_wb_mode = {
+#ifndef ROCKBOX_VOICE_CODEC
/* Split-band "ultra-wideband" (32 kbps) CELP mode*/
static const SpeexSBMode sb_uwb_mode = {
&speex_wb_mode,
@@ -303,6 +308,7 @@ static const SpeexSBMode sb_uwb_mode = {
#endif
2
};
+#endif
int wb_mode_query(const void *mode, int request, void *ptr)
{
@@ -329,6 +335,7 @@ int wb_mode_query(const void *mode, int request, void *ptr)
}
+#ifndef ROCKBOX_VOICE_CODEC
const SpeexMode speex_uwb_mode = {
&sb_uwb_mode,
wb_mode_query,
@@ -355,6 +362,7 @@ const SpeexMode speex_uwb_mode = {
&sb_decoder_ctl,
#endif
};
+#endif
/* We have defined speex_lib_get_mode() as a macro in speex.h */
#undef speex_lib_get_mode
diff --git a/apps/codecs/libspeex/nb_celp.c b/apps/codecs/libspeex/nb_celp.c
index 49e2403d8b..9ddac46f37 100644
--- a/apps/codecs/libspeex/nb_celp.c
+++ b/apps/codecs/libspeex/nb_celp.c
@@ -1032,6 +1032,7 @@ const spx_word16_t attenuation[10] = {1., 0.961, 0.852, 0.698, 0.527, 0.368, 0.2
#endif
+#ifndef ROCKBOX_VOICE_CODEC
static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack)
{
int i;
@@ -1093,6 +1094,7 @@ static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack)
if (st->pitch_gain_buf_idx > 2) /* rollover */
st->pitch_gain_buf_idx = 0;
}
+#endif
/* 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};
@@ -1130,11 +1132,13 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
} else
{
/* If bits is NULL, consider the packet to be lost (what could we do anyway) */
+#ifndef ROCKBOX_VOICE_CODEC
if (!bits)
{
nb_decode_lost(st, out, stack);
return 0;
}
+#endif
if (st->encode_submode)
{
diff --git a/apps/codecs/libspeex/sb_celp.c b/apps/codecs/libspeex/sb_celp.c
index b12ca71f4b..424d590b89 100644
--- a/apps/codecs/libspeex/sb_celp.c
+++ b/apps/codecs/libspeex/sb_celp.c
@@ -844,6 +844,7 @@ void sb_decoder_destroy(void *state)
*/
}
+#ifndef ROCKBOX_VOICE_CODEC
static void sb_decode_lost(SBDecState *st, spx_word16_t *out, int dtx, char *stack)
{
int i;
@@ -881,6 +882,7 @@ static void sb_decode_lost(SBDecState *st, spx_word16_t *out, int dtx, char *sta
return;
}
+#endif
int sb_decode(void *state, SpeexBits *bits, void *vout)
{
@@ -917,11 +919,13 @@ int sb_decode(void *state, SpeexBits *bits, void *vout)
return ret;
}
+#ifndef ROCKBOX_VOICE_CODEC
if (!bits)
{
sb_decode_lost(st, out, dtx, stack);
return 0;
}
+#endif
if (st->encode_submode)
{
@@ -951,11 +955,13 @@ int sb_decode(void *state, SpeexBits *bits, void *vout)
/* If null mode (no transmission), just set a couple things to zero*/
if (st->submodes[st->submodeID] == NULL)
{
+#ifndef ROCKBOX_VOICE_CODEC
if (dtx)
{
sb_decode_lost(st, out, 1, stack);
return 0;
}
+#endif
for (i=0;i<st->frame_size;i++)
out[st->frame_size+i]=VERY_SMALL;