1 --- libfaad/bits.h 2004-03-11 14:32:39.000000000 +0100
2 +++ libfaad2/bits.h 2004-06-24 10:47:02.000000000 +0200
5 #if defined (_WIN32) && !defined(_WIN32_WCE) && !defined(__MINGW32__)
6 #define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax
7 -#elif defined(LINUX) || defined(DJGPP) || defined(__MINGW32__)
8 +#elif defined(LINUX) || defined(DJGPP)
9 #define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) )
12 --- libfaad/common.h 2004-06-30 14:45:56.000000000 +0200
13 +++ libfaad2/common.h 2004-10-19 03:16:03.000000000 +0200
19 -# include "../config.h"
20 +/* Allow build on Cygwin*/
21 +#if defined(__CYGWIN__)
22 +#define __STRICT_ANSI__
25 +#include "../config.h"
27 #define INLINE __inline
28 #if 0 //defined(_WIN32) && !defined(_WIN32_WCE)
29 #define ALIGN __declspec(align(16))
31 /* Use if target platform has address generators with autoincrement */
32 //#define PREFER_POINTERS
35 +#if defined(_WIN32_WCE) || defined(__arm__)
53 typedef unsigned __int64 uint64_t;
54 typedef unsigned __int32 uint32_t;
55 typedef unsigned __int16 uint16_t;
57 typedef __int32 int32_t;
58 typedef __int16 int16_t;
59 typedef __int8 int8_t;
61 +#include <inttypes.h>
64 typedef float float32_t;
69 +/* #undef HAVE_FLOAT32_T */
70 +/* Define if you have the <inttypes.h> header file. */
71 +#define HAVE_INTTYPES_H 1
73 +/* Define if you have the `memcpy' function. */
74 +#define HAVE_MEMCPY 1
76 +/* Define if you have the <stdint.h> header file. */
77 +#define HAVE_STDINT_H 1
79 +/* Define if you have the `strchr' function. */
80 +#define HAVE_STRCHR 1
82 +/* Define if you have the ANSI C header files. */
83 +#define STDC_HEADERS 1
87 # include <sys/types.h>
92 - #if defined(_WIN32) && !defined(__MINGW32__)
93 + #if defined(_WIN32) && !defined(__MINGW32__) && !defined(HAVE_LRINTF)
95 static INLINE int lrintf(float f)
101 - #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__)
102 + #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__) && !defined(HAVE_LRINTF)
104 // from http://www.stereopsis.com/FPU.html
105 static INLINE int lrintf(float f)
114 # define _ISOC9X_SOURCE 1
116 # define __USE_ISOC99 1
124 --- main/libfaad2/output.c 2005/02/19 01:21:19 1.7
125 +++ main/libfaad2/output.c 2005/03/29 18:14:24 1.8
127 ** Any non-GPL usage of this software or parts of this software is strictly
130 -** Commercial non-GPL licensing of this software is possible.
131 -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
133 -** $Id: output.c,v 1.8 2005/03/29 18:14:24 rfelker Exp $
134 +** Initially modified for use with MPlayer by Rich Felker on 2005/03/29
135 +** $Id: output.c,v 1.11 2005/04/05 05:43:41 rfelker Exp $
136 +** detailed CVS changelog at http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
144 -void* output_to_PCM(NeAACDecHandle hDecoder,
145 +void* output_to_PCM_sux(NeAACDecHandle hDecoder,
146 real_t **input, void *sample_buffer, uint8_t channels,
147 uint16_t frame_len, uint8_t format)
150 return sample_buffer;
153 +void* output_to_PCM(NeAACDecHandle hDecoder,
154 + real_t **input, void *sample_buffer, uint8_t channels,
155 + uint16_t frame_len, uint8_t format)
159 + int16_t *short_sample_buffer = (int16_t*)sample_buffer;
160 + real_t *ch0 = input[hDecoder->internal_channel[0]];
161 + real_t *ch1 = input[hDecoder->internal_channel[1]];
162 + real_t *ch2 = input[hDecoder->internal_channel[2]];
163 + real_t *ch3 = input[hDecoder->internal_channel[3]];
164 + real_t *ch4 = input[hDecoder->internal_channel[4]];
166 + if (format != FAAD_FMT_16BIT)
167 + return output_to_PCM_sux(hDecoder, input, sample_buffer, channels, frame_len, format);
169 + if (hDecoder->downMatrix) {
170 + for(i = 0; i < frame_len; i++)
173 + tmp = (ch1[i] + ((ch0[i]+ch3[i])>>1) + ((ch0[i]+ch3[i])>>2) + (1<<(REAL_BITS))) >> (REAL_BITS+1);
174 + if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000;
175 + short_sample_buffer[0] = tmp;
176 + tmp = (ch2[i] + ((ch0[i]+ch4[i])>>1) + ((ch0[i]+ch4[i])>>2) + (1<<(REAL_BITS))) >> (REAL_BITS+1);
177 + if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000;
178 + short_sample_buffer[1] = tmp;
179 + short_sample_buffer += channels;
181 + return sample_buffer;
184 + /* Copy output to a standard PCM buffer */
185 + for(i = 0; i < frame_len; i++)
187 + for (ch = 0; ch < channels; ch++)
189 + int32_t tmp = input[ch][i];
190 + tmp += (1 << (REAL_BITS-1));
192 + if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000;
193 + *(short_sample_buffer++) = tmp;
197 + return sample_buffer;