Fix up configure and buildzip/wpsbuild.pl a bit
[kugel-rb.git] / apps / codecs / libmusepack / mpc_types.h
blob61ee5ea67fcece68d129f6b28b517e7a3d8c1101
1 /*
2 Copyright (c) 2005-2009, The Musepack Development Team
3 All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are
7 met:
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
12 * Redistributions in binary form must reproduce the above
13 copyright notice, this list of conditions and the following
14 disclaimer in the documentation and/or other materials provided
15 with the distribution.
17 * Neither the name of the The Musepack Development Team nor the
18 names of its contributors may be used to endorse or promote
19 products derived from this software without specific prior
20 written permission.
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef _MPC_TYPES_H_
35 #define _MPC_TYPES_H_
36 #ifdef WIN32
37 #pragma once
38 #endif
40 #include <stdlib.h>
41 #include <memory.h>
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
47 #ifdef _MSC_VER
48 typedef __int8 mpc_int8_t;
49 typedef unsigned __int8 mpc_uint8_t;
50 typedef __int16 mpc_int16_t;
51 typedef unsigned __int16 mpc_uint16_t;
52 typedef __int32 mpc_int32_t;
53 typedef unsigned __int32 mpc_uint32_t;
54 typedef __int64 mpc_int64_t;
55 typedef unsigned __int64 mpc_uint64_t;
56 #define mpc_inline __inline
57 #else
58 typedef signed char mpc_int8_t;
59 typedef unsigned char mpc_uint8_t;
60 typedef short mpc_int16_t;
61 typedef unsigned short mpc_uint16_t;
62 typedef int mpc_int32_t;
63 typedef unsigned int mpc_uint32_t;
64 typedef long long mpc_int64_t;
65 typedef unsigned long long mpc_uint64_t;
66 #define mpc_inline inline
67 #endif
69 typedef int mpc_int_t;
70 typedef unsigned int mpc_uint_t;
71 typedef size_t mpc_size_t;
72 typedef mpc_uint8_t mpc_bool_t;
74 // #define LONG_SEEK_TABLE
75 #ifdef LONG_SEEK_TABLE // define as needed (mpc_uint32_t supports files up to 512 MB)
76 typedef mpc_uint64_t mpc_seek_t;
77 #else
78 typedef mpc_uint32_t mpc_seek_t;
79 #endif
81 # define mpc_int64_min -9223372036854775808ll
82 # define mpc_int64_max 9223372036854775807ll
84 typedef struct mpc_quantizer {
85 mpc_int16_t L [36];
86 mpc_int16_t R [36];
87 } mpc_quantizer;
89 /// Libmpcdec error codes
90 typedef enum mpc_status {
91 MPC_STATUS_OK = 0,
92 MPC_STATUS_FILE = -1,
93 MPC_STATUS_SV7BETA = -2,
94 MPC_STATUS_CBR = -3,
95 MPC_STATUS_IS = -4,
96 MPC_STATUS_BLOCKSIZE = -5,
97 MPC_STATUS_INVALIDSV = -6
98 } mpc_status;
100 #define MPC_FIXED_POINT
101 #define MPC_FIXED_POINT_SHIFT 16
103 #ifdef MPC_FIXED_POINT
104 # define MPC_FIXED_POINT_FRACTPART 14
105 # define MPC_FIXED_POINT_SCALE_SHIFT (MPC_FIXED_POINT_SHIFT + MPC_FIXED_POINT_FRACTPART)
106 # define MPC_FIXED_POINT_SCALE (1 << (MPC_FIXED_POINT_SCALE_SHIFT - 1))
107 typedef mpc_int32_t MPC_SAMPLE_FORMAT;
108 #else
109 typedef float MPC_SAMPLE_FORMAT;
110 #endif
112 enum {
113 MPC_FALSE = 0,
114 MPC_TRUE = !MPC_FALSE
117 //// 'Cdecl' forces the use of standard C/C++ calling convention ///////
118 #if defined _WIN32
119 # define mpc_cdecl __cdecl
120 #elif defined __ZTC__
121 # define mpc_cdecl _cdecl
122 #elif defined __TURBOC__
123 # define mpc_cdecl cdecl
124 #else
125 # define mpc_cdecl
126 #endif
128 /* DLL building support on win32 hosts */
129 #ifndef MPC_API
130 # ifdef DLL_EXPORT /* defined by libtool (if required) */
131 # define MPC_API __declspec(dllexport)
132 # endif
133 # ifdef MPC_DLL_IMPORT /* define if linking with this dll */
134 # define MPC_API __declspec(dllimport)
135 # endif
136 # ifndef MPC_API /* static linking or !_WIN32 */
137 # if defined(__GNUC__) && (__GNUC__ >= 4)
138 # define MPC_API __attribute__ ((visibility("default")))
139 # else
140 # define MPC_API
141 # endif
142 # endif
143 #endif
145 #ifdef __cplusplus
147 #endif
148 #endif