1 /**************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 Dan Everton
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
19 ***************************************************************************/
21 #ifndef SPEEX_ROCKBOX_H
22 #define SPEEX_ROCKBOX_H
24 /* We don't want all this stuff if we're building encoder */
25 #ifndef ROCKBOX_VOICE_ENCODER
30 #if !defined(ROCKBOX_VOICE_CODEC)
32 #if defined(DEBUG) || defined(SIMULATOR)
34 #define DEBUGF ci->debugf
38 #ifdef ROCKBOX_HAS_LOGF
43 #endif /* ROCKBOX_VOICE_CODEC */
45 #define OVERRIDE_SPEEX_ALLOC 1
46 static inline void *speex_alloc (int size
)
48 return codec_calloc(size
, 1);
51 #define OVERRIDE_SPEEX_ALLOC_SCRATCH 1
52 static inline void *speex_alloc_scratch (int size
)
54 return codec_calloc(size
,1);
57 #define OVERRIDE_SPEEX_REALLOC 1
58 static inline void *speex_realloc (void *ptr
, int size
)
60 return codec_realloc(ptr
, size
);
63 #define OVERRIDE_SPEEX_FREE 1
64 static inline void speex_free (void *ptr
)
69 #define OVERRIDE_SPEEX_FREE_SCRATCH 1
70 static inline void speex_free_scratch (void *ptr
)
75 #define OVERRIDE_SPEEX_FATAL 1
76 static inline void _speex_fatal(const char *str
, const char *file
, int line
)
81 DEBUGF("Fatal error: %s\n", str
);
85 #define OVERRIDE_SPEEX_WARNING 1
86 static inline void speex_warning(const char *str
)
89 DEBUGF("warning: %s\n", str
);
92 #define OVERRIDE_SPEEX_WARNING_INT 1
93 static inline void speex_warning_int(const char *str
, int val
)
97 DEBUGF("warning: %s %d\n", str
, val
);
100 #define OVERRIDE_SPEEX_NOTIFY 1
101 static inline void speex_notify(const char *str
)
104 DEBUGF("notice: %s\n", str
);
107 #define OVERRIDE_SPEEX_PUTC 1
108 static inline void _speex_putc(int ch
, void *file
)
112 //FILE *f = (FILE *)file;
116 #endif /* ROCKBOX_VOICE_ENCODER */