Fix ultra-wideband mode. Disable big parts of the encoder stuff for a smaller binary.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15263 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thom Johansen 2007-10-22 12:03:03 +00:00
parent 12d1ff912c
commit ba482642f2
2 changed files with 56 additions and 9 deletions

View file

@ -108,8 +108,8 @@ const float exc_gain_quant_scal1[2]={0.70469f, 1.05127f};
#define sqr(x) ((x)*(x))
extern const spx_word16_t lpc_window[];
void *nb_encoder_init(const SpeexMode *m)
#if 0
void *nb_encoder_init(const speexmode *m)
{
EncState *st;
const SpeexNBMode *mode;
@ -1023,6 +1023,19 @@ int nb_encode(void *state, void *vin, SpeexBits *bits)
return 1;
}
#else
void *nb_encoder_init(const SpeexMode *m)
{
return NULL;
}
void nb_encoder_destroy(void *state)
{
}
int nb_encode(void *state, void *vin, SpeexBits *bits)
{
return 1;
}
#endif
static DecState global_decstate IBSS_ATTR;
@ -1033,9 +1046,11 @@ void *nb_decoder_init(const SpeexMode *m)
int i;
mode=(const SpeexNBMode*)m->mode;
/* st = (DecState *)speex_alloc(sizeof(DecState)); */
/*
st = (DecState *)speex_alloc(sizeof(DecState));
if (!st)
return NULL;
*/
#if defined(VAR_ARRAYS) || defined (USE_ALLOCA)
st->stack = NULL;
#else
@ -1740,6 +1755,7 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
return 0;
}
#if 0
int nb_encoder_ctl(void *state, int request, void *ptr)
{
EncState *st;
@ -1935,6 +1951,12 @@ int nb_encoder_ctl(void *state, int request, void *ptr)
}
return 0;
}
#else
int nb_encoder_ctl(void *state, int request, void *ptr)
{
return 0;
}
#endif
int nb_decoder_ctl(void *state, int request, void *ptr)
{

View file

@ -184,7 +184,7 @@ static const float h0[64] = {
extern const spx_word16_t lpc_window[];
#if 0
void *sb_encoder_init(const SpeexMode *m)
{
int i;
@ -750,20 +750,39 @@ int sb_encode(void *state, void *vin, SpeexBits *bits)
return 1;
}
#else
void *sb_encoder_init(const SpeexMode *m)
{
return NULL;
}
void sb_encoder_destroy(void *state)
{
}
int sb_encode(void *state, void *vin, SpeexBits *bits)
{
return 1;
}
#endif
static SBDecState global_decstate IBSS_ATTR;
static SBDecState global_decstate_wb IBSS_ATTR;
static SBDecState global_decstate_uwb IBSS_ATTR;
void *sb_decoder_init(const SpeexMode *m)
{
spx_int32_t tmp;
SBDecState *st = &global_decstate;
SBDecState *st;
const SpeexSBMode *mode;
/* st = (SBDecState*)speex_alloc(sizeof(SBDecState)); */
/*
st = (SBDecState*)speex_alloc(sizeof(SBDecState));
if (!st)
return NULL;
*/
if (m->modeID == SPEEX_MODEID_UWB)
st = &global_decstate_uwb;
else
st = &global_decstate_wb;
st->mode = m;
mode=(const SpeexSBMode*)m->mode;
st->encode_submode = 1;
@ -1107,7 +1126,7 @@ int sb_decode(void *state, SpeexBits *bits, void *vout)
return 0;
}
#if 0
int sb_encoder_ctl(void *state, int request, void *ptr)
{
SBEncState *st;
@ -1355,6 +1374,12 @@ int sb_encoder_ctl(void *state, int request, void *ptr)
}
return 0;
}
#else
int sb_encoder_ctl(void *state, int request, void *ptr)
{
return 0;
}
#endif
int sb_decoder_ctl(void *state, int request, void *ptr)
{