3 libdemac - A Monkey's Audio decoder
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. */
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
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
58 #define ICODE_SECTION_DEMAC_ARM .text
59 #define ICODE_ATTR_DEMAC
60 #define IBSS_ATTR_DEMAC_INSANEBUF IBSS_ATTR
65 #define APE_OUTPUT_DEPTH (ape_ctx->bps)
68 #define IBSS_ATTR_DEMAC_INSANEBUF
71 #define ICODE_ATTR_DEMAC
73 /* Use to give gcc hints on which branch is most likely taken */
74 #if defined(__GNUC__) && __GNUC__ >= 3
75 #define LIKELY(x) __builtin_expect(!!(x), 1)
76 #define UNLIKELY(x) __builtin_expect(!!(x), 0)
79 #define UNLIKELY(x) (x)
87 #define UDIV32(a, b) (a / b)
90 #ifndef FILTER_HISTORY_SIZE
91 #define FILTER_HISTORY_SIZE 512
94 #ifndef PREDICTOR_HISTORY_SIZE
95 #define PREDICTOR_HISTORY_SIZE 512
99 #define FILTER_BITS 16
103 #ifndef __ASSEMBLER__
104 #include <inttypes.h>
105 #if FILTER_BITS == 32
106 typedef int32_t filter_int
;
107 #elif FILTER_BITS == 16
108 typedef int16_t filter_int
;
112 #endif /* _DEMAC_CONFIG_H */