diff options
author | Thom Johansen <thomj@rockbox.org> | 2007-11-16 15:35:37 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2007-11-16 15:35:37 +0000 |
commit | 65458ee71ca741fbed1bff7e358760bb480b85e9 (patch) | |
tree | be9262a5c2560e5e0710d41e6c94d0c3a4e86b77 /apps/codecs | |
parent | 88c4748a4b93b6dcf0a8288c030bf93ae571ce5e (diff) | |
download | rockbox-65458ee71ca741fbed1bff7e358760bb480b85e9.tar.gz rockbox-65458ee71ca741fbed1bff7e358760bb480b85e9.zip |
Speex encoder specially tailored to create voice UI snippets. Small fixups to libspeex to allow it to be built.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15640 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/libspeex/Makefile | 2 | ||||
-rw-r--r-- | apps/codecs/libspeex/SOURCES | 10 | ||||
-rw-r--r-- | apps/codecs/libspeex/bits.c | 2 | ||||
-rw-r--r-- | apps/codecs/libspeex/config-speex.h | 14 | ||||
-rw-r--r-- | apps/codecs/libspeex/rockbox.h | 5 | ||||
-rw-r--r-- | apps/codecs/libspeex/speex_header.c | 2 |
6 files changed, 32 insertions, 3 deletions
diff --git a/apps/codecs/libspeex/Makefile b/apps/codecs/libspeex/Makefile index 35a8535369..3bda53dca7 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 -DSPEEX_DISABLE_ENCODER +SPEEXOPTS = -DHAVE_CONFIG_H -DSPEEX_DISABLE_ENCODER -DROCKBOX # 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 40ea5380b9..f036734589 100644 --- a/apps/codecs/libspeex/SOURCES +++ b/apps/codecs/libspeex/SOURCES @@ -24,12 +24,22 @@ speex.c speex_callbacks.c speex_header.c #ifndef ROCKBOX_VOICE_CODEC +#ifndef ROCKBOX_VOICE_ENCODER oggframing.c +#endif stereo.c #endif +#ifdef ROCKBOX_VOICE_ENCODER +lpc.c +vbr.c +vq.c +window.c +resample.c +#else #ifdef CPU_COLDFIRE filters_cf.S ltp_cf.S #elif defined(CPU_ARM) filters_arm4.S #endif +#endif diff --git a/apps/codecs/libspeex/bits.c b/apps/codecs/libspeex/bits.c index d4b02a5a86..e460a39cf2 100644 --- a/apps/codecs/libspeex/bits.c +++ b/apps/codecs/libspeex/bits.c @@ -106,7 +106,7 @@ void speex_bits_rewind(SpeexBits *bits) bits->overflow=0; } -#if 0 +#ifndef SPEEX_VOICE_ENCODER void speex_bits_read_from(SpeexBits *bits, char *chars, int len) { int i; diff --git a/apps/codecs/libspeex/config-speex.h b/apps/codecs/libspeex/config-speex.h index 1378fc2a69..ad1393fc60 100644 --- a/apps/codecs/libspeex/config-speex.h +++ b/apps/codecs/libspeex/config-speex.h @@ -1,8 +1,16 @@ +#ifndef ROCKBOX_VOICE_ENCODER #include "../codec.h" #include "autoconf.h" +#else +#define ICODE_ATTR +#define IDATA_ATTR +#define IBSS_ATTR +#define ICONST_ATTR +#endif /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +#ifndef ROCKBOX_VOICE_ENCODER /* Make use of ARM4E assembly optimizations */ #if defined(CPU_ARM) #define ARM4_ASM @@ -15,6 +23,7 @@ /* Make use of Blackfin assembly optimizations */ /* #undef BFIN_ASM */ +#endif /* ROCKBOX_VOICE_ENCODER */ /* Disable wideband codec */ /* #undef DISABLE_WIDEBAND */ @@ -28,8 +37,13 @@ /* Debug fixed-point implementation */ /* #undef FIXED_DEBUG */ +#ifndef ROCKBOX_VOICE_ENCODER /* Compile target codec as fixed point */ #define FIXED_POINT +#else +/* Compile voice clip encoder as floating point */ +#define FLOATING_POINT +#endif /* Define to 1 if you have the <dlfcn.h> header file. */ /* #undef HAVE_DLFCN_H */ diff --git a/apps/codecs/libspeex/rockbox.h b/apps/codecs/libspeex/rockbox.h index 0f8c6d932f..0e0d3ed647 100644 --- a/apps/codecs/libspeex/rockbox.h +++ b/apps/codecs/libspeex/rockbox.h @@ -19,6 +19,9 @@ #ifndef SPEEX_ROCKBOX_H #define SPEEX_ROCKBOX_H +/* We don't want all this stuff if we're building encoder */ +#ifndef ROCKBOX_VOICE_ENCODER + #include "../codec.h" #include "../lib/codeclib.h" @@ -106,5 +109,7 @@ static inline void _speex_putc(int ch, void *file) //printf("%c", ch); } +#endif /* ROCKBOX_VOICE_ENCODER */ + #endif diff --git a/apps/codecs/libspeex/speex_header.c b/apps/codecs/libspeex/speex_header.c index eb4c199d46..30f47206c4 100644 --- a/apps/codecs/libspeex/speex_header.c +++ b/apps/codecs/libspeex/speex_header.c @@ -47,7 +47,7 @@ /** Convert little endian */ static inline spx_int32_t le_int(spx_int32_t i) { -#if 1 +#ifdef ROCKBOX return letoh32(i); #elif !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) ) spx_uint32_t ui, ret; |