New makefile solution: A single invocation of 'make' to build the entire tree. Fully...
[kugel-rb.git] / apps / codecs / demac / libdemac / demac_config.h
blobdd3aaa3f9c799f671aebbec0d8929394ff270e44
1 /*
3 libdemac - A Monkey's Audio decoder
5 $Id$
7 Copyright (C) Dave Chapman 2007
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
25 #ifndef _DEMAC_CONFIG_H
26 #define _DEMAC_CONFIG_H
28 /* Build-time choices for libdemac.
29 * Note that this file is included by both .c and .S files. */
31 #ifdef ROCKBOX
33 #include "config.h"
35 #ifndef __ASSEMBLER__
36 #include "codeclib.h"
37 #include <codecs.h>
38 #endif
40 #define APE_OUTPUT_DEPTH 29
42 /* On ARMv4, using 32 bit ints for the filters is faster. */
43 #if defined(CPU_ARM) && (ARM_ARCH == 4)
44 #define FILTER_BITS 32
45 #endif
47 #if CONFIG_CPU == PP5002
48 /* Code in IRAM for speed, not enough IRAM for the insane filter buffer. */
49 #define ICODE_SECTION_DEMAC_ARM .icode
50 #define ICODE_ATTR_DEMAC ICODE_ATTR
51 #define IBSS_ATTR_DEMAC_INSANEBUF
52 #elif CONFIG_CPU == PP5020
53 /* Not enough IRAM for the insane filter buffer. */
54 #define ICODE_SECTION_DEMAC_ARM .text
55 #define ICODE_ATTR_DEMAC
56 #define IBSS_ATTR_DEMAC_INSANEBUF
57 #else
58 #define ICODE_SECTION_DEMAC_ARM .text
59 #define ICODE_ATTR_DEMAC
60 #define IBSS_ATTR_DEMAC_INSANEBUF IBSS_ATTR
61 #endif
63 #else /* !ROCKBOX */
65 #define APE_OUTPUT_DEPTH (ape_ctx->bps)
67 #define IBSS_ATTR
68 #define IBSS_ATTR_DEMAC_INSANEBUF
69 #define ICONST_ATTR
70 #define ICODE_ATTR
71 #define ICODE_ATTR_DEMAC
73 #endif /* !ROCKBOX */
75 /* Defaults */
77 #ifndef UDIV32
78 #define UDIV32(a, b) (a / b)
79 #endif
81 #ifndef FILTER_HISTORY_SIZE
82 #define FILTER_HISTORY_SIZE 512
83 #endif
85 #ifndef PREDICTOR_HISTORY_SIZE
86 #define PREDICTOR_HISTORY_SIZE 512
87 #endif
89 #ifndef FILTER_BITS
90 #define FILTER_BITS 16
91 #endif
94 #ifndef __ASSEMBLER__
95 #include <inttypes.h>
96 #if FILTER_BITS == 32
97 typedef int32_t filter_int;
98 #elif FILTER_BITS == 16
99 typedef int16_t filter_int;
100 #endif
101 #endif
103 #endif /* _DEMAC_CONFIG_H */