Subversion Repositories Kolibri OS

Rev

Rev 1905 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1905 Rev 3960
Line 9... Line 9...
9
 
9
 
10
#ifndef MPG123_H_INTERN
10
#ifndef MPG123_H_INTERN
Line 11... Line 11...
11
#define MPG123_H_INTERN
11
#define MPG123_H_INTERN
12
 
12
 
Line 13... Line 13...
13
#define MPG123_RATES 9
13
#define MPG123_RATES 9
-
 
14
#define MPG123_ENCODINGS 12
Line 14... Line 15...
14
#define MPG123_ENCODINGS 10
15
 
15
 
16
#include "config.h" /* Load this before _anything_ */
16
#include "config.h" /* Load this before _anything_ */
17
#include "intsym.h" /* Prefixing of internal symbols that still are public in a static lib. */
17
 
18
 
18
/* ABI conformance for other compilers.
19
/* ABI conformance for other compilers.
19
   mpg123 needs 16byte-aligned stack for SSE and friends.
20
   mpg123 needs 16byte-aligned stack for SSE and friends.
20
   gcc provides that, but others don't necessarily. */
21
   gcc provides that, but others don't necessarily. */
21
#ifdef ABI_ALIGN_FUN
22
#ifdef ABI_ALIGN_FUN
22
#ifndef attribute_align_arg
23
#ifndef attribute_align_arg
-
 
24
#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__>1)
23
#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__>1)
25
#    define attribute_align_arg __attribute__((force_align_arg_pointer))
24
#    define attribute_align_arg __attribute__((force_align_arg_pointer))
26
/* The gcc that can align the stack does not need the check... nor does it work with gcc 4.3+, anyway. */
-
 
27
#else
-
 
28
 
-
 
29
#    define attribute_align_arg
-
 
30
/* Other compilers get code to catch misaligned stack.
-
 
31
   Well, except Sun Studio, which accepts the aligned attribute but does not honor it. */
25
/* The gcc that can align the stack does not need the check... nor does it work with gcc 4.3+, anyway. */
32
#if !defined(__SUNPRO_C)
26
#else
33
#    define NEED_ALIGNCHECK
27
#    define attribute_align_arg
34
#endif
28
#    define NEED_ALIGNCHECK /* Other compilers get code to catch misaligned stack. */
35
 
29
#endif
36
#endif
Line 128... Line 135...
128
		"mullw %0, %2, %3 \n\t" \
135
		"mullw %0, %2, %3 \n\t" \
129
		"mulhw %1, %2, %3 \n\t" \
136
		"mulhw %1, %2, %3 \n\t" \
130
		"srwi %0, %0, %4 \n\t" \
137
		"srwi %0, %0, %4 \n\t" \
131
		"rlwimi %0, %1, %5, 0, %6 \n\t" \
138
		"rlwimi %0, %1, %5, 0, %6 \n\t" \
132
		: "=&r" (_mull), "=&r" (_mulh) \
139
		: "=&r" (_mull), "=&r" (_mulh) \
133
		: "%r" (_x), "r" (_y), "i" (radix), "i" (32-(radix)), "i" ((radix)-1) \
140
		: "r" (_x), "r" (_y), "i" (radix), "i" (32-(radix)), "i" ((radix)-1) \
134
	); \
141
	); \
135
	_mull; \
142
	_mull; \
136
})
143
})
Line 137... Line 144...
137
 
144
 
Line 144... Line 151...
144
		"subfic %2, %5, 32 \n\t" \
151
		"subfic %2, %5, 32 \n\t" \
145
		"srw %0, %0, %5 \n\t" \
152
		"srw %0, %0, %5 \n\t" \
146
		"slw %1, %1, %2 \n\t" \
153
		"slw %1, %1, %2 \n\t" \
147
		"or %0, %0, %1 \n\t" \
154
		"or %0, %0, %1 \n\t" \
148
		: "=&r" (_mull), "=&r" (_mulh), "=&r" (_radix2) \
155
		: "=&r" (_mull), "=&r" (_mulh), "=&r" (_radix2) \
149
		: "%r" (_x), "r" (_y), "r" (_radix) \
156
		: "r" (_x), "r" (_y), "r" (_radix) \
150
		: "cc" \
157
		: "cc" \
151
	); \
158
	); \
152
	_mull; \
159
	_mull; \
153
})
160
})
154
#  elif defined(OPT_ARM)
161
#  elif defined(OPT_ARM)
Line 159... Line 166...
159
	__asm__ ( \
166
	__asm__ ( \
160
		"smull %0, %1, %2, %3 \n\t" \
167
		"smull %0, %1, %2, %3 \n\t" \
161
		"mov %0, %0, lsr %4 \n\t" \
168
		"mov %0, %0, lsr %4 \n\t" \
162
		"orr %0, %0, %1, lsl %5 \n\t" \
169
		"orr %0, %0, %1, lsl %5 \n\t" \
163
		: "=&r" (_mull), "=&r" (_mulh) \
170
		: "=&r" (_mull), "=&r" (_mulh) \
164
		: "%r" (_x), "r" (_y), "M" (radix), "M" (32-(radix)) \
171
		: "r" (_x), "r" (_y), "M" (radix), "M" (32-(radix)) \
165
	); \
172
	); \
166
	_mull; \
173
	_mull; \
167
})
174
})
Line 168... Line 175...
168
 
175
 
Line 171... Line 178...
171
	long _x=(x), _y=(y), _radix=(radix), _mull, _mulh, _radix2; \
178
	long _x=(x), _y=(y), _radix=(radix), _mull, _mulh, _radix2; \
172
	__asm__ ( \
179
	__asm__ ( \
173
		"smull %0, %1, %3, %4 \n\t" \
180
		"smull %0, %1, %3, %4 \n\t" \
174
		"mov %0, %0, lsr %5 \n\t" \
181
		"mov %0, %0, lsr %5 \n\t" \
175
		"rsb %2, %5, #32 \n\t" \
182
		"rsb %2, %5, #32 \n\t" \
176
		"orr %0, %0, %1, lsl %2 \n\t" \
183
		"mov %1, %1, lsl %2 \n\t" \
-
 
184
		"orr %0, %0, %1 \n\t" \
177
		: "=&r" (_mull), "=&r" (_mulh), "=&r" (_radix2) \
185
		: "=&r" (_mull), "=&r" (_mulh), "=&r" (_radix2) \
178
		: "%r" (_x), "r" (_y), "r" (_radix) \
186
		: "r" (_x), "r" (_y), "r" (_radix) \
179
	); \
187
	); \
180
	_mull; \
188
	_mull; \
181
})
189
})
182
#  endif
190
#  endif
183
# endif
191
# endif
Line 304... Line 312...
304
#include "decode.h"
312
#include "decode.h"
305
#include "parse.h"
313
#include "parse.h"
306
#include "frame.h"
314
#include "frame.h"
Line 307... Line 315...
307
 
315
 
308
/* fr is a mpg123_handle* by convention here... */
316
/* fr is a mpg123_handle* by convention here... */
309
#define NOQUIET  0 /*(!(fr->p.flags & MPG123_QUIET))*/
317
#define NOQUIET  (!(fr->p.flags & MPG123_QUIET))
310
#define VERBOSE  (NOQUIET && fr->p.verbose)
318
#define VERBOSE  (NOQUIET && fr->p.verbose)
311
#define VERBOSE2 (NOQUIET && fr->p.verbose > 1)
319
#define VERBOSE2 (NOQUIET && fr->p.verbose > 1)
312
#define VERBOSE3 (NOQUIET && fr->p.verbose > 2)
320
#define VERBOSE3 (NOQUIET && fr->p.verbose > 2)
313
#define VERBOSE4 (NOQUIET && fr->p.verbose > 3)
321
#define VERBOSE4 (NOQUIET && fr->p.verbose > 3)
Line 314... Line 322...
314
#define PVERB(mp, level) 0 /*(!((mp)->flags & MPG123_QUIET) && (mp)->verbose >= (level)) */
322
#define PVERB(mp, level) (!((mp)->flags & MPG123_QUIET) && (mp)->verbose >= (level))
315
 
323
 
-
 
324
int decode_update(mpg123_handle *mh);
316
int decode_update(mpg123_handle *mh);
325
/* residing in format.c  */
317
/* residing in format.c  */
326
off_t samples_to_storage(mpg123_handle *fr , off_t s);
-
 
327
off_t samples_to_bytes(mpg123_handle *fr , off_t s);
-
 
328
off_t bytes_to_samples(mpg123_handle *fr , off_t b);
-
 
329
/* Postprocessing format conversion of freshly decoded buffer. */
-
 
330
void postprocess_buffer(mpg123_handle *fr);
-
 
331
 
-
 
332
/* If networking is enabled and we really mean internal networking, the timeout_read function is available. */
-
 
333
#if defined (NETWORK) && !defined (WANT_WIN32_SOCKETS)
-
 
334
/* Does not work with win32 */
Line 318... Line 335...
318
off_t samples_to_bytes(mpg123_handle *fr , off_t s);
335
#define TIMEOUT_READ