From bf1b7f131c933b83afe62f01c200366e4e2e37f3 Mon Sep 17 00:00:00 2001 From: Thom Johansen Date: Thu, 1 Nov 2007 21:30:51 +0000 Subject: First attempt at ifdeffing out as much of the encoder stuff as possible from Speex. Gives a smaller binary and allows me to remove a couple more files from SOURCES. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15394 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libspeex/Makefile | 2 +- apps/codecs/libspeex/SOURCES | 3 - apps/codecs/libspeex/cb_search.c | 4 + apps/codecs/libspeex/filters.c | 6 ++ apps/codecs/libspeex/ltp.c | 4 + apps/codecs/libspeex/modes.c | 147 ++++++++++++++++++++++++++++++++++++ apps/codecs/libspeex/modes_wb.c | 74 ++++++++++++++++++ apps/codecs/libspeex/nb_celp.c | 23 +----- apps/codecs/libspeex/quant_lsp.c | 8 ++ apps/codecs/libspeex/sb_celp.c | 21 +----- apps/codecs/libspeex/speex_header.c | 2 + apps/codecs/libspeex/stereo.c | 2 + 12 files changed, 253 insertions(+), 43 deletions(-) diff --git a/apps/codecs/libspeex/Makefile b/apps/codecs/libspeex/Makefile index 651d589e65..7c73f02d67 100644 --- a/apps/codecs/libspeex/Makefile +++ b/apps/codecs/libspeex/Makefile @@ -14,7 +14,7 @@ ifdef APPEXTRA INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) endif -SPEEXOPTS = -DHAVE_CONFIG_H +SPEEXOPTS = -DHAVE_CONFIG_H -DSPEEX_DISABLE_ENCODER # We're faster on ARM-targets with -O1 instead of -O2 ifeq ($(CPU),arm) diff --git a/apps/codecs/libspeex/SOURCES b/apps/codecs/libspeex/SOURCES index e1f038160b..89e3f1db03 100644 --- a/apps/codecs/libspeex/SOURCES +++ b/apps/codecs/libspeex/SOURCES @@ -28,9 +28,6 @@ speex.c speex_callbacks.c speex_header.c stereo.c -vbr.c -vq.c -window.c #ifdef CPU_COLDFIRE filters_cf.S ltp_cf.S diff --git a/apps/codecs/libspeex/cb_search.c b/apps/codecs/libspeex/cb_search.c index f7ecca4a62..8afb8ab5f3 100644 --- a/apps/codecs/libspeex/cb_search.c +++ b/apps/codecs/libspeex/cb_search.c @@ -49,6 +49,7 @@ #include "cb_search_bfin.h" #endif +#ifndef SPEEX_DISABLE_ENCODER #ifndef OVERRIDE_COMPUTE_WEIGHTED_CODEBOOK static void compute_weighted_codebook(const signed char *shape_cb, const spx_word16_t *r, spx_word16_t *resp, spx_word16_t *resp2, spx_word32_t *E, int shape_cb_size, int subvect_size, char *stack) { @@ -511,6 +512,7 @@ int update_target target[j]=SUB16(target[j],PSHR16(r2[j],2)); } } +#endif void split_cb_shape_sign_unquant( @@ -571,6 +573,7 @@ spx_int32_t *seed } } +#ifndef SPEEX_DISABLE_ENCODER void noise_codebook_quant( spx_word16_t target[], /* target vector */ spx_coef_t ak[], /* LPCs for this subframe */ @@ -597,6 +600,7 @@ int update_target for (i=0;i