diff options
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/libspeex/Makefile | 5 | ||||
-rw-r--r-- | apps/codecs/libspeex/SOURCES | 5 | ||||
-rw-r--r-- | apps/codecs/libspeex/nb_celp.c | 1 | ||||
-rw-r--r-- | apps/codecs/libspeex/rockbox.c | 77 | ||||
-rw-r--r-- | apps/codecs/libspeex/sb_celp.c | 6 | ||||
-rw-r--r-- | apps/codecs/libspeex/sb_celp.h | 5 |
6 files changed, 20 insertions, 79 deletions
diff --git a/apps/codecs/libspeex/Makefile b/apps/codecs/libspeex/Makefile index 7c73f02d67..35a8535369 100644 --- a/apps/codecs/libspeex/Makefile +++ b/apps/codecs/libspeex/Makefile | |||
@@ -23,6 +23,11 @@ else | |||
23 | SPEEXOPTS += -O2 | 23 | SPEEXOPTS += -O2 |
24 | endif | 24 | endif |
25 | 25 | ||
26 | # We build Speex separately for use as a voice codec | ||
27 | ifdef ROCKBOX_VOICE_CODEC | ||
28 | EXTRA_DEFINES += -DROCKBOX_VOICE_CODEC | ||
29 | endif | ||
30 | |||
26 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(SPEEXOPTS) $(TARGET) \ | 31 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(SPEEXOPTS) $(TARGET) \ |
27 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} ${PROFILE_OPTS} -Wno-unused-parameter | 32 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} ${PROFILE_OPTS} -Wno-unused-parameter |
28 | 33 | ||
diff --git a/apps/codecs/libspeex/SOURCES b/apps/codecs/libspeex/SOURCES index f775a7cd9f..40ea5380b9 100644 --- a/apps/codecs/libspeex/SOURCES +++ b/apps/codecs/libspeex/SOURCES | |||
@@ -18,14 +18,15 @@ ltp.c | |||
18 | modes.c | 18 | modes.c |
19 | modes_wb.c | 19 | modes_wb.c |
20 | nb_celp.c | 20 | nb_celp.c |
21 | oggframing.c | ||
22 | quant_lsp.c | 21 | quant_lsp.c |
23 | rockbox.c | ||
24 | sb_celp.c | 22 | sb_celp.c |
25 | speex.c | 23 | speex.c |
26 | speex_callbacks.c | 24 | speex_callbacks.c |
27 | speex_header.c | 25 | speex_header.c |
26 | #ifndef ROCKBOX_VOICE_CODEC | ||
27 | oggframing.c | ||
28 | stereo.c | 28 | stereo.c |
29 | #endif | ||
29 | #ifdef CPU_COLDFIRE | 30 | #ifdef CPU_COLDFIRE |
30 | filters_cf.S | 31 | filters_cf.S |
31 | ltp_cf.S | 32 | ltp_cf.S |
diff --git a/apps/codecs/libspeex/nb_celp.c b/apps/codecs/libspeex/nb_celp.c index 3de623a482..7dc4920ede 100644 --- a/apps/codecs/libspeex/nb_celp.c +++ b/apps/codecs/libspeex/nb_celp.c | |||
@@ -944,6 +944,7 @@ void *nb_decoder_init(const SpeexMode *m) | |||
944 | if (!st) | 944 | if (!st) |
945 | return NULL; | 945 | return NULL; |
946 | */ | 946 | */ |
947 | memset(st, 0, sizeof(*st)); | ||
947 | #if defined(VAR_ARRAYS) || defined (USE_ALLOCA) | 948 | #if defined(VAR_ARRAYS) || defined (USE_ALLOCA) |
948 | st->stack = NULL; | 949 | st->stack = NULL; |
949 | #else | 950 | #else |
diff --git a/apps/codecs/libspeex/rockbox.c b/apps/codecs/libspeex/rockbox.c deleted file mode 100644 index 2abf8ccb32..0000000000 --- a/apps/codecs/libspeex/rockbox.c +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | /************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2007 Dan Everton | ||
10 | * | ||
11 | * All files in this archive are subject to the GNU General Public License. | ||
12 | * See the file COPYING in the source tree root for full license agreement. | ||
13 | * | ||
14 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
15 | * KIND, either express or implied. | ||
16 | * | ||
17 | ***************************************************************************/ | ||
18 | |||
19 | #include "../codec.h" | ||
20 | #include "../lib/codeclib.h" | ||
21 | |||
22 | #if defined(DEBUG) || defined(SIMULATOR) | ||
23 | #undef DEBUGF | ||
24 | #define DEBUGF ci->debugf | ||
25 | #else | ||
26 | #define DEBUGF(...) | ||
27 | #endif | ||
28 | |||
29 | #ifdef ROCKBOX_HAS_LOGF | ||
30 | #undef LOGF | ||
31 | #define LOGF ci->logf | ||
32 | #else | ||
33 | #define LOGF(...) | ||
34 | #endif | ||
35 | |||
36 | extern struct codec_api* ci; | ||
37 | |||
38 | float floor(float x) { | ||
39 | return ((float)(((int)x))); | ||
40 | } | ||
41 | |||
42 | //Placeholders (not fixed point, only used when encoding): | ||
43 | float pow(float a, float b) { | ||
44 | DEBUGF("pow(%f, %f)\n", a, b); | ||
45 | return 0; | ||
46 | } | ||
47 | |||
48 | float log(float l) { | ||
49 | DEBUGF("log(%f)\n", l); | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | float fabs(float a) { | ||
54 | DEBUGF("fabs(%f)\n", a); | ||
55 | return 0; | ||
56 | } | ||
57 | |||
58 | float sin(float a) { | ||
59 | DEBUGF("sin(%f)\n", a); | ||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | float cos(float a) { | ||
64 | DEBUGF("cos(%f)\n", a); | ||
65 | return 0; | ||
66 | } | ||
67 | |||
68 | float sqrt(float a) { | ||
69 | DEBUGF("sqrt(%f)\n", a); | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | float exp(float a) { | ||
74 | DEBUGF("exp(%f)\n", a); | ||
75 | return 0; | ||
76 | } | ||
77 | |||
diff --git a/apps/codecs/libspeex/sb_celp.c b/apps/codecs/libspeex/sb_celp.c index 1b648b8c52..3314f6b87e 100644 --- a/apps/codecs/libspeex/sb_celp.c +++ b/apps/codecs/libspeex/sb_celp.c | |||
@@ -755,7 +755,10 @@ int sb_encode(void *state, void *vin, SpeexBits *bits) | |||
755 | 755 | ||
756 | 756 | ||
757 | static SBDecState global_decstate_wb IBSS_ATTR; | 757 | static SBDecState global_decstate_wb IBSS_ATTR; |
758 | /* Do not include this for voice codec, files will never be UWB */ | ||
759 | #ifndef SPEEX_ROCKBOX_VOICE_CODEC | ||
758 | static SBDecState global_decstate_uwb IBSS_ATTR; | 760 | static SBDecState global_decstate_uwb IBSS_ATTR; |
761 | #endif | ||
759 | 762 | ||
760 | void *sb_decoder_init(const SpeexMode *m) | 763 | void *sb_decoder_init(const SpeexMode *m) |
761 | { | 764 | { |
@@ -767,10 +770,13 @@ void *sb_decoder_init(const SpeexMode *m) | |||
767 | if (!st) | 770 | if (!st) |
768 | return NULL; | 771 | return NULL; |
769 | */ | 772 | */ |
773 | #ifndef ROCKBOX_VOICE_CODEC | ||
770 | if (m->modeID == SPEEX_MODEID_UWB) | 774 | if (m->modeID == SPEEX_MODEID_UWB) |
771 | st = &global_decstate_uwb; | 775 | st = &global_decstate_uwb; |
772 | else | 776 | else |
777 | #endif | ||
773 | st = &global_decstate_wb; | 778 | st = &global_decstate_wb; |
779 | memset(st, 0, sizeof(*st)); | ||
774 | st->mode = m; | 780 | st->mode = m; |
775 | mode=(const SpeexSBMode*)m->mode; | 781 | mode=(const SpeexSBMode*)m->mode; |
776 | st->encode_submode = 1; | 782 | st->encode_submode = 1; |
diff --git a/apps/codecs/libspeex/sb_celp.h b/apps/codecs/libspeex/sb_celp.h index eaf76c94ab..c4c8160a55 100644 --- a/apps/codecs/libspeex/sb_celp.h +++ b/apps/codecs/libspeex/sb_celp.h | |||
@@ -110,7 +110,12 @@ typedef struct SBDecState { | |||
110 | char *stack; | 110 | char *stack; |
111 | spx_word16_t g0_mem[64], g1_mem[64]; | 111 | spx_word16_t g0_mem[64], g1_mem[64]; |
112 | 112 | ||
113 | /* Voice codec files will be WB mode, which has sub frame size of 40 */ | ||
114 | #ifndef SPEEX_ROCKBOX_VOICE_CODEC | ||
113 | spx_word16_t excBuf[80]; | 115 | spx_word16_t excBuf[80]; |
116 | #else | ||
117 | spx_word16_t excBuf[40]; | ||
118 | #endif | ||
114 | spx_lsp_t old_qlsp[8]; | 119 | spx_lsp_t old_qlsp[8]; |
115 | spx_coef_t interp_qlpc[8]; | 120 | spx_coef_t interp_qlpc[8]; |
116 | 121 | ||