summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/libspeex/Makefile5
-rw-r--r--apps/codecs/libspeex/SOURCES5
-rw-r--r--apps/codecs/libspeex/nb_celp.c1
-rw-r--r--apps/codecs/libspeex/rockbox.c77
-rw-r--r--apps/codecs/libspeex/sb_celp.c6
-rw-r--r--apps/codecs/libspeex/sb_celp.h5
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
24endif 24endif
25 25
26# We build Speex separately for use as a voice codec
27ifdef ROCKBOX_VOICE_CODEC
28EXTRA_DEFINES += -DROCKBOX_VOICE_CODEC
29endif
30
26CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(SPEEXOPTS) $(TARGET) \ 31CFLAGS = $(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
18modes.c 18modes.c
19modes_wb.c 19modes_wb.c
20nb_celp.c 20nb_celp.c
21oggframing.c
22quant_lsp.c 21quant_lsp.c
23rockbox.c
24sb_celp.c 22sb_celp.c
25speex.c 23speex.c
26speex_callbacks.c 24speex_callbacks.c
27speex_header.c 25speex_header.c
26#ifndef ROCKBOX_VOICE_CODEC
27oggframing.c
28stereo.c 28stereo.c
29#endif
29#ifdef CPU_COLDFIRE 30#ifdef CPU_COLDFIRE
30filters_cf.S 31filters_cf.S
31ltp_cf.S 32ltp_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
36extern struct codec_api* ci;
37
38float floor(float x) {
39 return ((float)(((int)x)));
40}
41
42//Placeholders (not fixed point, only used when encoding):
43float pow(float a, float b) {
44 DEBUGF("pow(%f, %f)\n", a, b);
45 return 0;
46}
47
48float log(float l) {
49 DEBUGF("log(%f)\n", l);
50 return 0;
51}
52
53float fabs(float a) {
54 DEBUGF("fabs(%f)\n", a);
55 return 0;
56}
57
58float sin(float a) {
59 DEBUGF("sin(%f)\n", a);
60 return 0;
61}
62
63float cos(float a) {
64 DEBUGF("cos(%f)\n", a);
65 return 0;
66}
67
68float sqrt(float a) {
69 DEBUGF("sqrt(%f)\n", a);
70 return 0;
71}
72
73float 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
757static SBDecState global_decstate_wb IBSS_ATTR; 757static 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
758static SBDecState global_decstate_uwb IBSS_ATTR; 760static SBDecState global_decstate_uwb IBSS_ATTR;
761#endif
759 762
760void *sb_decoder_init(const SpeexMode *m) 763void *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