diff options
author | Thom Johansen <thomj@rockbox.org> | 2007-10-22 12:03:03 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2007-10-22 12:03:03 +0000 |
commit | ba482642f2aeeeaa39fd22f68b908fc09b6f63ac (patch) | |
tree | ce73c66341f23a23d6c8b481dacced04349e5dc0 | |
parent | 12d1ff912c1f1d292bf91f29f7896882360424aa (diff) |
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
-rw-r--r-- | apps/codecs/libspeex/nb_celp.c | 28 | ||||
-rw-r--r-- | apps/codecs/libspeex/sb_celp.c | 37 |
2 files changed, 56 insertions, 9 deletions
diff --git a/apps/codecs/libspeex/nb_celp.c b/apps/codecs/libspeex/nb_celp.c index 6047bd42aa..0798ffbcf4 100644 --- a/apps/codecs/libspeex/nb_celp.c +++ b/apps/codecs/libspeex/nb_celp.c @@ -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) { diff --git a/apps/codecs/libspeex/sb_celp.c b/apps/codecs/libspeex/sb_celp.c index dc88ca4947..766fe57719 100644 --- a/apps/codecs/libspeex/sb_celp.c +++ b/apps/codecs/libspeex/sb_celp.c @@ -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) { |