simplification
[mplayer.git] / libfaad2 / local_changes.diff
blob9ff3d0d4b06a0da5a0db0c6443cde108e8be2ff2
1 --- libfaad/bits.h 2004-03-11 14:32:39.000000000 +0100
2 +++ libfaad2/bits.h 2004-06-24 10:47:02.000000000 +0200
3 @@ -58,7 +61,7 @@
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) )
10 #else
11 #define BSWAP(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
14 @@ -32,10 +35,13 @@
15 extern "C" {
16 #endif
18 -#ifdef HAVE_CONFIG_H
19 -# include "../config.h"
20 +/* Allow build on Cygwin*/
21 +#if defined(__CYGWIN__)
22 +#define __STRICT_ANSI__
23 #endif
25 +#include "../config.h"
27 #define INLINE __inline
28 #if 0 //defined(_WIN32) && !defined(_WIN32_WCE)
29 #define ALIGN __declspec(align(16))
30 @@ -67,6 +67,6 @@
31 /* Use if target platform has address generators with autoincrement */
32 //#define PREFER_POINTERS
34 -#ifdef _WIN32_WCE
35 +#if defined(_WIN32_WCE) || defined(__arm__)
36 #define FIXED_POINT
37 #endif
38 @@ -117,6 +123,9 @@
39 # ifdef MAIN_DEC
40 # undef MAIN_DEC
41 # endif
42 +# ifdef SBR_DEC
43 +# undef SBR_DEC
44 +# endif
45 #endif // FIXED_POINT
47 #ifdef DRM
48 @@ -157,6 +166,7 @@
50 #include <stdlib.h>
52 +#if 0
53 typedef unsigned __int64 uint64_t;
54 typedef unsigned __int32 uint32_t;
55 typedef unsigned __int16 uint16_t;
56 @@ -165,11 +175,31 @@
57 typedef __int32 int32_t;
58 typedef __int16 int16_t;
59 typedef __int8 int8_t;
60 +#else
61 +#include <inttypes.h>
62 +#endif
64 typedef float float32_t;
67 #else
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
85 #include <stdio.h>
86 #if HAVE_SYS_TYPES_H
87 # include <sys/types.h>
88 @@ -329,7 +329,7 @@
92 - #if defined(_WIN32) && !defined(__MINGW32__)
93 + #if defined(_WIN32) && !defined(__MINGW32__) && !defined(HAVE_LRINTF)
94 #define HAS_LRINTF
95 static INLINE int lrintf(float f)
97 @@ -341,7 +341,7 @@
99 return i;
101 - #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__)
102 + #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__) && !defined(HAVE_LRINTF)
103 #define HAS_LRINTF
104 // from http://www.stereopsis.com/FPU.html
105 static INLINE int lrintf(float f)
106 @@ -340,6 +370,8 @@
108 #else
110 +#include <math.h>
112 #ifdef HAVE_LRINTF
113 # define HAS_LRINTF
114 # define _ISOC9X_SOURCE 1
115 @@ -348,8 +380,6 @@
116 # define __USE_ISOC99 1
117 #endif
119 - #include <math.h>
121 #ifdef HAVE_SINF
122 # define sin sinf
123 #error
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
126 @@ -19,10 +19,9 @@
127 ** Any non-GPL usage of this software or parts of this software is strictly
128 ** forbidden.
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/
139 #include "common.h"
140 @@ -462,7 +462,7 @@
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)
149 @@ -553,4 +553,51 @@
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)
157 + int ch;
158 + int i;
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++)
172 + int32_t tmp;
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));
191 + tmp >>= REAL_BITS;
192 + if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000;
193 + *(short_sample_buffer++) = tmp;
197 + return sample_buffer;
200 #endif