Mercurial > mplayer.hg
annotate libfaad2/local_changes.diff @ 24001:bc29871be2fd
HAVE_INTTYPES_H is in config.h, HAVE_STDINT_H is never reached.
author | diego |
---|---|
date | Tue, 07 Aug 2007 08:57:20 +0000 |
parents | 0783dd397f74 |
children | aa0a5aa712fc |
rev | line source |
---|---|
18141 | 1 --- libfaad2.orig/bits.h 2006-03-16 20:15:04.000000000 +0100 |
2 +++ libfaad2/bits.h 2006-03-16 20:37:21.000000000 +0100 | |
3 @@ -22,7 +22,10 @@ | |
4 ** Commercial non-GPL licensing of this software is possible. | |
5 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
6 ** | |
7 +** Initially modified for use with MPlayer by Arpad Gereöffy on 2003/08/30 | |
8 ** $Id: bits.h,v 1.40 2004/09/04 14:56:27 menno Exp $ | |
18783 | 9 +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
18141 | 10 +** local_changes.diff contains the exact changes to this file. |
11 **/ | |
12 | |
13 #ifndef __BITS_H__ | |
14858 | 14 @@ -58,7 +61,7 @@ |
14712 | 15 |
16 #if defined (_WIN32) && !defined(_WIN32_WCE) && !defined(__MINGW32__) | |
17 #define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax | |
18 -#elif defined(LINUX) || defined(DJGPP) || defined(__MINGW32__) | |
19 +#elif defined(LINUX) || defined(DJGPP) | |
20 #define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ) | |
21 #else | |
22 #define BSWAP(a) \ | |
18141 | 23 --- libfaad2.orig/common.h 2006-03-16 20:15:04.000000000 +0100 |
24 +++ libfaad2/common.h 2006-03-16 20:56:56.000000000 +0100 | |
25 @@ -22,7 +22,10 @@ | |
26 ** Commercial non-GPL licensing of this software is possible. | |
27 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
28 ** | |
29 +** Initially modified for use with MPlayer by Arpad Gereöffy on 2003/08/30 | |
30 ** $Id: common.h,v 1.65 2004/09/08 09:43:11 gcp Exp $ | |
18783 | 31 +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
18141 | 32 +** local_changes.diff contains the exact changes to this file. |
33 **/ | |
34 | |
35 #ifndef __COMMON_H__ | |
14858 | 36 @@ -32,10 +35,13 @@ |
14712 | 37 extern "C" { |
38 #endif | |
39 | |
40 -#ifdef HAVE_CONFIG_H | |
41 -# include "../config.h" | |
42 +/* Allow build on Cygwin*/ | |
43 +#if defined(__CYGWIN__) | |
44 +#define __STRICT_ANSI__ | |
45 #endif | |
46 | |
47 +#include "../config.h" | |
48 + | |
49 #define INLINE __inline | |
50 #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) | |
51 #define ALIGN __declspec(align(16)) | |
18141 | 52 @@ -61,7 +67,7 @@ |
16249 | 53 /* Use if target platform has address generators with autoincrement */ |
54 //#define PREFER_POINTERS | |
55 | |
56 -#ifdef _WIN32_WCE | |
57 +#if defined(_WIN32_WCE) || defined(__arm__) | |
58 #define FIXED_POINT | |
59 #endif | |
18141 | 60 |
14858 | 61 @@ -117,6 +123,9 @@ |
14712 | 62 # ifdef MAIN_DEC |
63 # undef MAIN_DEC | |
64 # endif | |
65 +# ifdef SBR_DEC | |
66 +# undef SBR_DEC | |
67 +# endif | |
68 #endif // FIXED_POINT | |
69 | |
70 #ifdef DRM | |
18141 | 71 @@ -151,6 +160,7 @@ |
14712 | 72 |
73 #include <stdlib.h> | |
74 | |
75 +#if 0 | |
76 typedef unsigned __int64 uint64_t; | |
77 typedef unsigned __int32 uint32_t; | |
78 typedef unsigned __int16 uint16_t; | |
24001
bc29871be2fd
HAVE_INTTYPES_H is in config.h, HAVE_STDINT_H is never reached.
diego
parents:
18783
diff
changeset
|
79 @@ -159,11 +169,24 @@ |
14712 | 80 typedef __int32 int32_t; |
81 typedef __int16 int16_t; | |
82 typedef __int8 int8_t; | |
83 +#else | |
84 +#include <inttypes.h> | |
85 +#endif | |
86 + | |
87 typedef float float32_t; | |
88 | |
89 | |
90 #else | |
91 | |
92 +/* Define if you have the `memcpy' function. */ | |
93 +#define HAVE_MEMCPY 1 | |
94 + | |
95 +/* Define if you have the `strchr' function. */ | |
96 +#define HAVE_STRCHR 1 | |
97 + | |
98 +/* Define if you have the ANSI C header files. */ | |
99 +#define STDC_HEADERS 1 | |
100 + | |
101 #include <stdio.h> | |
102 #if HAVE_SYS_TYPES_H | |
103 # include <sys/types.h> | |
18141 | 104 @@ -289,7 +319,7 @@ |
16249 | 105 } |
106 | |
107 | |
108 - #if defined(_WIN32) && !defined(__MINGW32__) | |
109 + #if defined(_WIN32) && !defined(__MINGW32__) && !defined(HAVE_LRINTF) | |
110 #define HAS_LRINTF | |
111 static INLINE int lrintf(float f) | |
112 { | |
18141 | 113 @@ -301,7 +331,7 @@ |
14712 | 114 } |
115 return i; | |
116 } | |
18141 | 117 - #elif (defined(__i386__) && defined(__GNUC__)) |
118 + #elif (defined(__i386__) && defined(__GNUC__)) && !defined(HAVE_LRINTF) | |
14712 | 119 #define HAS_LRINTF |
120 // from http://www.stereopsis.com/FPU.html | |
121 static INLINE int lrintf(float f) | |
18141 | 122 @@ -330,6 +360,8 @@ |
14712 | 123 |
124 #else | |
125 | |
126 +#include <math.h> | |
127 + | |
128 #ifdef HAVE_LRINTF | |
129 # define HAS_LRINTF | |
130 # define _ISOC9X_SOURCE 1 | |
18141 | 131 @@ -338,8 +370,6 @@ |
14712 | 132 # define __USE_ISOC99 1 |
133 #endif | |
134 | |
135 - #include <math.h> | |
136 - | |
137 #ifdef HAVE_SINF | |
138 # define sin sinf | |
139 #error | |
18141 | 140 --- libfaad2.orig/output.c 2006-03-16 20:15:04.000000000 +0100 |
141 +++ libfaad2/output.c 2006-04-18 19:50:26.000000000 +0200 | |
16249 | 142 @@ -19,10 +19,9 @@ |
143 ** Any non-GPL usage of this software or parts of this software is strictly | |
144 ** forbidden. | |
145 ** | |
146 -** Commercial non-GPL licensing of this software is possible. | |
147 -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
148 -** | |
17181
53c3eaaf8b49
Unify paths in patch and fix recent breakage, no -ko keyword expansion
diego
parents:
17137
diff
changeset
|
149 -** $Id: output.c,v 1.42 2004/09/04 14:56:28 menno Exp $ |
16249 | 150 +** Initially modified for use with MPlayer by Rich Felker on 2005/03/29 |
17181
53c3eaaf8b49
Unify paths in patch and fix recent breakage, no -ko keyword expansion
diego
parents:
17137
diff
changeset
|
151 +** $Id: output.c,v 1.11 2005/04/05 05:43:41 rfelker Exp $ |
18783 | 152 +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
16249 | 153 **/ |
154 | |
155 #include "common.h" | |
18141 | 156 @@ -463,7 +462,7 @@ |
16249 | 157 } |
158 } | |
159 | |
160 -void* output_to_PCM(NeAACDecHandle hDecoder, | |
161 +void* output_to_PCM_sux(NeAACDecHandle hDecoder, | |
162 real_t **input, void *sample_buffer, uint8_t channels, | |
163 uint16_t frame_len, uint8_t format) | |
164 { | |
18141 | 165 @@ -554,4 +553,51 @@ |
16249 | 166 return sample_buffer; |
167 } | |
168 | |
169 +void* output_to_PCM(NeAACDecHandle hDecoder, | |
170 + real_t **input, void *sample_buffer, uint8_t channels, | |
171 + uint16_t frame_len, uint8_t format) | |
172 +{ | |
173 + int ch; | |
174 + int i; | |
175 + int16_t *short_sample_buffer = (int16_t*)sample_buffer; | |
176 + real_t *ch0 = input[hDecoder->internal_channel[0]]; | |
177 + real_t *ch1 = input[hDecoder->internal_channel[1]]; | |
178 + real_t *ch2 = input[hDecoder->internal_channel[2]]; | |
179 + real_t *ch3 = input[hDecoder->internal_channel[3]]; | |
180 + real_t *ch4 = input[hDecoder->internal_channel[4]]; | |
181 + | |
182 + if (format != FAAD_FMT_16BIT) | |
183 + return output_to_PCM_sux(hDecoder, input, sample_buffer, channels, frame_len, format); | |
184 + | |
185 + if (hDecoder->downMatrix) { | |
186 + for(i = 0; i < frame_len; i++) | |
187 + { | |
188 + int32_t tmp; | |
189 + tmp = (ch1[i] + ((ch0[i]+ch3[i])>>1) + ((ch0[i]+ch3[i])>>2) + (1<<(REAL_BITS))) >> (REAL_BITS+1); | |
190 + if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000; | |
191 + short_sample_buffer[0] = tmp; | |
192 + tmp = (ch2[i] + ((ch0[i]+ch4[i])>>1) + ((ch0[i]+ch4[i])>>2) + (1<<(REAL_BITS))) >> (REAL_BITS+1); | |
193 + if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000; | |
194 + short_sample_buffer[1] = tmp; | |
195 + short_sample_buffer += channels; | |
196 + } | |
197 + return sample_buffer; | |
198 + } | |
199 + | |
200 + /* Copy output to a standard PCM buffer */ | |
201 + for(i = 0; i < frame_len; i++) | |
202 + { | |
203 + for (ch = 0; ch < channels; ch++) | |
204 + { | |
18141 | 205 + int32_t tmp = input[hDecoder->internal_channel[ch]][i]; |
16249 | 206 + tmp += (1 << (REAL_BITS-1)); |
207 + tmp >>= REAL_BITS; | |
208 + if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000; | |
209 + *(short_sample_buffer++) = tmp; | |
210 + } | |
211 + } | |
212 + | |
213 + return sample_buffer; | |
214 +} | |
215 + | |
216 #endif | |
18141 | 217 --- libfaad2.orig/ps_dec.c 2006-03-16 20:15:04.000000000 +0100 |
218 +++ libfaad2/ps_dec.c 2006-04-18 20:29:38.000000000 +0200 | |
219 @@ -22,7 +22,10 @@ | |
220 ** Commercial non-GPL licensing of this software is possible. | |
221 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
222 ** | |
223 +** Initially modified for use with MPlayer on 2005/12/05 | |
224 ** $Id: ps_dec.c,v 1.10 2004/09/04 14:56:28 menno Exp $ | |
18783 | 225 +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
18141 | 226 +** local_changes.diff contains the exact changes to this file. |
227 **/ | |
228 | |
229 #include "common.h" | |
230 @@ -159,7 +162,7 @@ | |
231 | |
232 /* static function declarations */ | |
233 static void ps_data_decode(ps_info *ps); | |
234 -static hyb_info *hybrid_init(); | |
235 +static hyb_info *hybrid_init(void); | |
236 static void channel_filter2(hyb_info *hyb, uint8_t frame_len, const real_t *filter, | |
237 qmf_t *buffer, qmf_t **X_hybrid); | |
238 static void INLINE DCT3_4_unscaled(real_t *y, real_t *x); | |
239 @@ -189,7 +192,7 @@ | |
240 /* */ | |
241 | |
242 | |
243 -static hyb_info *hybrid_init() | |
244 +static hyb_info *hybrid_init(void) | |
245 { | |
246 uint8_t i; | |
247 | |
248 @@ -1935,8 +1938,8 @@ | |
17136 | 249 /* main Parametric Stereo decoding function */ |
250 uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) | |
251 { | |
252 - qmf_t X_hybrid_left[32][32] = {{0}}; | |
253 - qmf_t X_hybrid_right[32][32] = {{0}}; | |
254 + qmf_t X_hybrid_left[32][32] = {{{0}}}; | |
255 + qmf_t X_hybrid_right[32][32] = {{{0}}}; | |
256 | |
257 /* delta decoding of the bitstream data */ | |
258 ps_data_decode(ps); | |
18141 | 259 --- libfaad2.orig/sbr_dec.c 2006-03-16 20:15:04.000000000 +0100 |
260 +++ libfaad2/sbr_dec.c 2006-04-18 20:33:57.000000000 +0200 | |
261 @@ -22,7 +22,10 @@ | |
262 ** Commercial non-GPL licensing of this software is possible. | |
263 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
264 ** | |
265 +** Initially modified for use with MPlayer on 2005/12/05 | |
266 ** $Id: sbr_dec.c,v 1.39 2004/09/04 14:56:28 menno Exp $ | |
18783 | 267 +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
18141 | 268 +** local_changes.diff contains the exact changes to this file. |
269 **/ | |
270 | |
271 | |
272 @@ -526,8 +529,8 @@ | |
17137 | 273 uint8_t l, k; |
274 uint8_t dont_process = 0; | |
275 uint8_t ret = 0; | |
276 - ALIGN qmf_t X_left[38][64] = {{0}}; | |
277 - ALIGN qmf_t X_right[38][64] = {{0}}; /* must set this to 0 */ | |
278 + ALIGN qmf_t X_left[38][64] = {{{0}}}; | |
279 + ALIGN qmf_t X_right[38][64] = {{{0}}}; /* must set this to 0 */ | |
280 | |
281 if (sbr == NULL) | |
282 return 20; | |
18141 | 283 --- libfaad2.orig/specrec.c 2006-03-16 20:15:04.000000000 +0100 |
284 +++ libfaad2/specrec.c 2006-04-18 20:38:09.000000000 +0200 | |
285 @@ -19,10 +19,10 @@ | |
286 ** Any non-GPL usage of this software or parts of this software is strictly | |
287 ** forbidden. | |
288 ** | |
289 -** Commercial non-GPL licensing of this software is possible. | |
290 -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
291 -** | |
292 +** Initially modified for use with MPlayer on 2006/04/18 | |
293 ** $Id: specrec.c,v 1.56 2004/09/08 09:43:11 gcp Exp $ | |
18783 | 294 +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
18141 | 295 +** local_changes.diff contains the exact changes to this file. |
296 **/ | |
297 | |
298 /* | |
299 @@ -673,29 +673,19 @@ | |
300 /* MAIN object type prediction */ | |
301 if (hDecoder->object_type == MAIN) | |
302 { | |
303 - /* allocate the state only when needed */ | |
304 - if (hDecoder->pred_stat[channel] == NULL) | |
305 - { | |
306 - hDecoder->pred_stat[channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state)); | |
307 + hDecoder->pred_stat[channel] = (pred_state*)realloc(hDecoder->pred_stat[channel], hDecoder->frameLength * sizeof(pred_state)); | |
308 reset_all_predictors(hDecoder->pred_stat[channel], hDecoder->frameLength); | |
309 - } | |
310 } | |
311 #endif | |
312 | |
313 #ifdef LTP_DEC | |
314 if (is_ltp_ot(hDecoder->object_type)) | |
315 { | |
316 - /* allocate the state only when needed */ | |
317 - if (hDecoder->lt_pred_stat[channel] == NULL) | |
318 - { | |
319 - hDecoder->lt_pred_stat[channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t)); | |
320 + hDecoder->lt_pred_stat[channel] = (int16_t*)realloc(hDecoder->lt_pred_stat[channel], hDecoder->frameLength*4 * sizeof(int16_t)); | |
321 memset(hDecoder->lt_pred_stat[channel], 0, hDecoder->frameLength*4 * sizeof(int16_t)); | |
322 - } | |
323 } | |
324 #endif | |
325 | |
326 - if (hDecoder->time_out[channel] == NULL) | |
327 - { | |
328 mul = 1; | |
329 #ifdef SBR_DEC | |
330 hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 0; | |
331 @@ -706,41 +696,28 @@ | |
332 hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 1; | |
333 } | |
334 #endif | |
335 - hDecoder->time_out[channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t)); | |
336 + hDecoder->time_out[channel] = (real_t*)realloc(hDecoder->time_out[channel], mul*hDecoder->frameLength*sizeof(real_t)); | |
337 memset(hDecoder->time_out[channel], 0, mul*hDecoder->frameLength*sizeof(real_t)); | |
338 - } | |
339 #if (defined(PS_DEC) || defined(DRM_PS)) | |
340 if (output_channels == 2) | |
341 { | |
342 - if (hDecoder->time_out[channel+1] == NULL) | |
343 - { | |
344 - hDecoder->time_out[channel+1] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t)); | |
345 + hDecoder->time_out[channel+1] = (real_t*)realloc(hDecoder->time_out[channel+1], mul*hDecoder->frameLength*sizeof(real_t)); | |
346 memset(hDecoder->time_out[channel+1], 0, mul*hDecoder->frameLength*sizeof(real_t)); | |
347 - } | |
348 } | |
349 #endif | |
350 | |
351 - if (hDecoder->fb_intermed[channel] == NULL) | |
352 - { | |
353 - hDecoder->fb_intermed[channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t)); | |
354 + hDecoder->fb_intermed[channel] = (real_t*)realloc(hDecoder->fb_intermed[channel], hDecoder->frameLength*sizeof(real_t)); | |
355 memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t)); | |
356 - } | |
357 | |
358 #ifdef SSR_DEC | |
359 if (hDecoder->object_type == SSR) | |
360 { | |
361 - if (hDecoder->ssr_overlap[channel] == NULL) | |
362 - { | |
363 - hDecoder->ssr_overlap[channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t)); | |
364 - memset(hDecoder->ssr_overlap[channel], 0, 2*hDecoder->frameLength*sizeof(real_t)); | |
365 - } | |
366 - if (hDecoder->prev_fmd[channel] == NULL) | |
367 - { | |
368 uint16_t k; | |
369 - hDecoder->prev_fmd[channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t)); | |
370 + hDecoder->ssr_overlap[channel] = (real_t*)realloc(hDecoder->ssr_overlap[channel], 2*hDecoder->frameLength*sizeof(real_t)); | |
371 + memset(hDecoder->ssr_overlap[channel], 0, 2*hDecoder->frameLength*sizeof(real_t)); | |
372 + hDecoder->prev_fmd[channel] = (real_t*)realloc(hDecoder->prev_fmd[channel], 2*hDecoder->frameLength*sizeof(real_t)); | |
373 for (k = 0; k < 2*hDecoder->frameLength; k++) | |
374 hDecoder->prev_fmd[channel][k] = REAL_CONST(-1); | |
375 - } | |
376 } | |
377 #endif | |
378 | |
379 @@ -865,22 +842,13 @@ | |
380 | |
381 /* always allocate 2 channels, PS can always "suddenly" turn up */ | |
382 #if (defined(PS_DEC) || defined(DRM_PS)) | |
383 - output_channels = 2; | |
384 + output_channels = hDecoder->ps_used[hDecoder->fr_ch_ele] ? 2 : 1; | |
385 #else | |
386 output_channels = 1; | |
387 #endif | |
388 | |
389 - if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0) | |
390 - { | |
391 - /* element_output_channels not set yet */ | |
392 + if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] < output_channels) { | |
393 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels; | |
394 - } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != output_channels) { | |
395 - /* element inconsistency */ | |
396 - return 21; | |
397 - } | |
398 - | |
399 - if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0) | |
400 - { | |
401 retval = allocate_single_channel(hDecoder, sce->channel, output_channels); | |
402 if (retval > 0) | |
403 return retval; | |
404 @@ -1026,11 +994,10 @@ | |
405 { | |
406 return 23; | |
407 } | |
408 -#endif | |
409 | |
410 /* copy L to R when no PS is used */ | |
411 #if (defined(PS_DEC) || defined(DRM_PS)) | |
412 - if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0)) | |
413 + if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0) && (output_channels == 2)) | |
414 { | |
415 uint8_t ele = hDecoder->fr_ch_ele; | |
416 uint8_t ch = sce->channel; | |
417 @@ -1040,6 +1007,7 @@ | |
418 memcpy(hDecoder->time_out[ch+1], hDecoder->time_out[ch], frame_size); | |
419 } | |
420 #endif | |
421 +#endif | |
422 | |
423 return 0; | |
424 } |