summaryrefslogtreecommitdiff
path: root/apps/codecs/libspeex
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libspeex')
-rw-r--r--apps/codecs/libspeex/Makefile2
-rw-r--r--apps/codecs/libspeex/SOURCES10
-rw-r--r--apps/codecs/libspeex/bits.c2
-rw-r--r--apps/codecs/libspeex/config-speex.h14
-rw-r--r--apps/codecs/libspeex/rockbox.h5
-rw-r--r--apps/codecs/libspeex/speex_header.c2
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
14 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 14 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
15endif 15endif
16 16
17SPEEXOPTS = -DHAVE_CONFIG_H -DSPEEX_DISABLE_ENCODER 17SPEEXOPTS = -DHAVE_CONFIG_H -DSPEEX_DISABLE_ENCODER -DROCKBOX
18 18
19# We're faster on ARM-targets with -O1 instead of -O2 19# We're faster on ARM-targets with -O1 instead of -O2
20ifeq ($(CPU),arm) 20ifeq ($(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
24speex_callbacks.c 24speex_callbacks.c
25speex_header.c 25speex_header.c
26#ifndef ROCKBOX_VOICE_CODEC 26#ifndef ROCKBOX_VOICE_CODEC
27#ifndef ROCKBOX_VOICE_ENCODER
27oggframing.c 28oggframing.c
29#endif
28stereo.c 30stereo.c
29#endif 31#endif
32#ifdef ROCKBOX_VOICE_ENCODER
33lpc.c
34vbr.c
35vq.c
36window.c
37resample.c
38#else
30#ifdef CPU_COLDFIRE 39#ifdef CPU_COLDFIRE
31filters_cf.S 40filters_cf.S
32ltp_cf.S 41ltp_cf.S
33#elif defined(CPU_ARM) 42#elif defined(CPU_ARM)
34filters_arm4.S 43filters_arm4.S
35#endif 44#endif
45#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)
106 bits->overflow=0; 106 bits->overflow=0;
107} 107}
108 108
109#if 0 109#ifndef SPEEX_VOICE_ENCODER
110void speex_bits_read_from(SpeexBits *bits, char *chars, int len) 110void speex_bits_read_from(SpeexBits *bits, char *chars, int len)
111{ 111{
112 int i; 112 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 @@
1#ifndef ROCKBOX_VOICE_ENCODER
1#include "../codec.h" 2#include "../codec.h"
2#include "autoconf.h" 3#include "autoconf.h"
4#else
5#define ICODE_ATTR
6#define IDATA_ATTR
7#define IBSS_ATTR
8#define ICONST_ATTR
9#endif
3/* config.h. Generated from config.h.in by configure. */ 10/* config.h. Generated from config.h.in by configure. */
4/* config.h.in. Generated from configure.ac by autoheader. */ 11/* config.h.in. Generated from configure.ac by autoheader. */
5 12
13#ifndef ROCKBOX_VOICE_ENCODER
6/* Make use of ARM4E assembly optimizations */ 14/* Make use of ARM4E assembly optimizations */
7#if defined(CPU_ARM) 15#if defined(CPU_ARM)
8#define ARM4_ASM 16#define ARM4_ASM
@@ -15,6 +23,7 @@
15 23
16/* Make use of Blackfin assembly optimizations */ 24/* Make use of Blackfin assembly optimizations */
17/* #undef BFIN_ASM */ 25/* #undef BFIN_ASM */
26#endif /* ROCKBOX_VOICE_ENCODER */
18 27
19/* Disable wideband codec */ 28/* Disable wideband codec */
20/* #undef DISABLE_WIDEBAND */ 29/* #undef DISABLE_WIDEBAND */
@@ -28,8 +37,13 @@
28/* Debug fixed-point implementation */ 37/* Debug fixed-point implementation */
29/* #undef FIXED_DEBUG */ 38/* #undef FIXED_DEBUG */
30 39
40#ifndef ROCKBOX_VOICE_ENCODER
31/* Compile target codec as fixed point */ 41/* Compile target codec as fixed point */
32#define FIXED_POINT 42#define FIXED_POINT
43#else
44/* Compile voice clip encoder as floating point */
45#define FLOATING_POINT
46#endif
33 47
34/* Define to 1 if you have the <dlfcn.h> header file. */ 48/* Define to 1 if you have the <dlfcn.h> header file. */
35/* #undef HAVE_DLFCN_H */ 49/* #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 @@
19#ifndef SPEEX_ROCKBOX_H 19#ifndef SPEEX_ROCKBOX_H
20#define SPEEX_ROCKBOX_H 20#define SPEEX_ROCKBOX_H
21 21
22/* We don't want all this stuff if we're building encoder */
23#ifndef ROCKBOX_VOICE_ENCODER
24
22#include "../codec.h" 25#include "../codec.h"
23#include "../lib/codeclib.h" 26#include "../lib/codeclib.h"
24 27
@@ -106,5 +109,7 @@ static inline void _speex_putc(int ch, void *file)
106 //printf("%c", ch); 109 //printf("%c", ch);
107} 110}
108 111
112#endif /* ROCKBOX_VOICE_ENCODER */
113
109#endif 114#endif
110 115
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 @@
47/** Convert little endian */ 47/** Convert little endian */
48static inline spx_int32_t le_int(spx_int32_t i) 48static inline spx_int32_t le_int(spx_int32_t i)
49{ 49{
50#if 1 50#ifdef ROCKBOX
51 return letoh32(i); 51 return letoh32(i);
52#elif !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) ) 52#elif !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) )
53 spx_uint32_t ui, ret; 53 spx_uint32_t ui, ret;