1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Thom Johansen 2007-11-18 23:17:25 +00:00
parent c46de8ab73
commit c31818ccf0
3 changed files with 18 additions and 0 deletions

View file

@ -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

View file

@ -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)
{

View file

@ -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;