Mercurial > mplayer.hg
annotate libfaad2/local_changes.diff @ 24011:aa0a5aa712fc
Move some #defines into configure/config.h.
| author | diego |
|---|---|
| date | Wed, 08 Aug 2007 09:12:33 +0000 |
| parents | bc29871be2fd |
| children | 1ac62a61ea56 |
| 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; | |
| 24011 | 79 @@ -159,5 +169,9 @@ |
| 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 | |
| 18141 | 89 @@ -289,7 +319,7 @@ |
| 16249 | 90 } |
| 91 | |
| 92 | |
| 93 - #if defined(_WIN32) && !defined(__MINGW32__) | |
| 94 + #if defined(_WIN32) && !defined(__MINGW32__) && !defined(HAVE_LRINTF) | |
| 95 #define HAS_LRINTF | |
| 96 static INLINE int lrintf(float f) | |
| 97 { | |
| 18141 | 98 @@ -301,7 +331,7 @@ |
| 14712 | 99 } |
| 100 return i; | |
| 101 } | |
| 18141 | 102 - #elif (defined(__i386__) && defined(__GNUC__)) |
| 103 + #elif (defined(__i386__) && defined(__GNUC__)) && !defined(HAVE_LRINTF) | |
| 14712 | 104 #define HAS_LRINTF |
| 105 // from http://www.stereopsis.com/FPU.html | |
| 106 static INLINE int lrintf(float f) | |
| 18141 | 107 @@ -330,6 +360,8 @@ |
| 14712 | 108 |
| 109 #else | |
| 110 | |
| 111 +#include <math.h> | |
| 112 + | |
| 113 #ifdef HAVE_LRINTF | |
| 114 # define HAS_LRINTF | |
| 115 # define _ISOC9X_SOURCE 1 | |
| 18141 | 116 @@ -338,8 +370,6 @@ |
| 14712 | 117 # define __USE_ISOC99 1 |
| 118 #endif | |
| 119 | |
| 120 - #include <math.h> | |
| 121 - | |
| 122 #ifdef HAVE_SINF | |
| 123 # define sin sinf | |
| 124 #error | |
| 18141 | 125 --- libfaad2.orig/output.c 2006-03-16 20:15:04.000000000 +0100 |
| 126 +++ libfaad2/output.c 2006-04-18 19:50:26.000000000 +0200 | |
| 16249 | 127 @@ -19,10 +19,9 @@ |
| 128 ** Any non-GPL usage of this software or parts of this software is strictly | |
| 129 ** forbidden. | |
| 130 ** | |
| 131 -** Commercial non-GPL licensing of this software is possible. | |
| 132 -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
| 133 -** | |
|
17181
53c3eaaf8b49
Unify paths in patch and fix recent breakage, no -ko keyword expansion
diego
parents:
17137
diff
changeset
|
134 -** $Id: output.c,v 1.42 2004/09/04 14:56:28 menno Exp $ |
| 16249 | 135 +** 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
|
136 +** $Id: output.c,v 1.11 2005/04/05 05:43:41 rfelker Exp $ |
| 18783 | 137 +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
| 16249 | 138 **/ |
| 139 | |
| 140 #include "common.h" | |
| 18141 | 141 @@ -463,7 +462,7 @@ |
| 16249 | 142 } |
| 143 } | |
| 144 | |
| 145 -void* output_to_PCM(NeAACDecHandle hDecoder, | |
| 146 +void* output_to_PCM_sux(NeAACDecHandle hDecoder, | |
| 147 real_t **input, void *sample_buffer, uint8_t channels, | |
| 148 uint16_t frame_len, uint8_t format) | |
| 149 { | |
| 18141 | 150 @@ -554,4 +553,51 @@ |
| 16249 | 151 return sample_buffer; |
| 152 } | |
| 153 | |
| 154 +void* output_to_PCM(NeAACDecHandle hDecoder, | |
| 155 + real_t **input, void *sample_buffer, uint8_t channels, | |
| 156 + uint16_t frame_len, uint8_t format) | |
| 157 +{ | |
| 158 + int ch; | |
| 159 + int i; | |
| 160 + int16_t *short_sample_buffer = (int16_t*)sample_buffer; | |
| 161 + real_t *ch0 = input[hDecoder->internal_channel[0]]; | |
| 162 + real_t *ch1 = input[hDecoder->internal_channel[1]]; | |
| 163 + real_t *ch2 = input[hDecoder->internal_channel[2]]; | |
| 164 + real_t *ch3 = input[hDecoder->internal_channel[3]]; | |
| 165 + real_t *ch4 = input[hDecoder->internal_channel[4]]; | |
| 166 + | |
| 167 + if (format != FAAD_FMT_16BIT) | |
| 168 + return output_to_PCM_sux(hDecoder, input, sample_buffer, channels, frame_len, format); | |
| 169 + | |
| 170 + if (hDecoder->downMatrix) { | |
| 171 + for(i = 0; i < frame_len; i++) | |
| 172 + { | |
| 173 + int32_t tmp; | |
| 174 + tmp = (ch1[i] + ((ch0[i]+ch3[i])>>1) + ((ch0[i]+ch3[i])>>2) + (1<<(REAL_BITS))) >> (REAL_BITS+1); | |
| 175 + if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000; | |
| 176 + short_sample_buffer[0] = tmp; | |
| 177 + tmp = (ch2[i] + ((ch0[i]+ch4[i])>>1) + ((ch0[i]+ch4[i])>>2) + (1<<(REAL_BITS))) >> (REAL_BITS+1); | |
| 178 + if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000; | |
| 179 + short_sample_buffer[1] = tmp; | |
| 180 + short_sample_buffer += channels; | |
| 181 + } | |
| 182 + return sample_buffer; | |
| 183 + } | |
| 184 + | |
| 185 + /* Copy output to a standard PCM buffer */ | |
| 186 + for(i = 0; i < frame_len; i++) | |
| 187 + { | |
| 188 + for (ch = 0; ch < channels; ch++) | |
| 189 + { | |
| 18141 | 190 + int32_t tmp = input[hDecoder->internal_channel[ch]][i]; |
| 16249 | 191 + tmp += (1 << (REAL_BITS-1)); |
| 192 + tmp >>= REAL_BITS; | |
| 193 + if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000; | |
| 194 + *(short_sample_buffer++) = tmp; | |
| 195 + } | |
| 196 + } | |
| 197 + | |
| 198 + return sample_buffer; | |
| 199 +} | |
| 200 + | |
| 201 #endif | |
| 18141 | 202 --- libfaad2.orig/ps_dec.c 2006-03-16 20:15:04.000000000 +0100 |
| 203 +++ libfaad2/ps_dec.c 2006-04-18 20:29:38.000000000 +0200 | |
| 204 @@ -22,7 +22,10 @@ | |
| 205 ** Commercial non-GPL licensing of this software is possible. | |
| 206 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
| 207 ** | |
| 208 +** Initially modified for use with MPlayer on 2005/12/05 | |
| 209 ** $Id: ps_dec.c,v 1.10 2004/09/04 14:56:28 menno Exp $ | |
| 18783 | 210 +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
| 18141 | 211 +** local_changes.diff contains the exact changes to this file. |
| 212 **/ | |
| 213 | |
| 214 #include "common.h" | |
| 215 @@ -159,7 +162,7 @@ | |
| 216 | |
| 217 /* static function declarations */ | |
| 218 static void ps_data_decode(ps_info *ps); | |
| 219 -static hyb_info *hybrid_init(); | |
| 220 +static hyb_info *hybrid_init(void); | |
| 221 static void channel_filter2(hyb_info *hyb, uint8_t frame_len, const real_t *filter, | |
| 222 qmf_t *buffer, qmf_t **X_hybrid); | |
| 223 static void INLINE DCT3_4_unscaled(real_t *y, real_t *x); | |
| 224 @@ -189,7 +192,7 @@ | |
| 225 /* */ | |
| 226 | |
| 227 | |
| 228 -static hyb_info *hybrid_init() | |
| 229 +static hyb_info *hybrid_init(void) | |
| 230 { | |
| 231 uint8_t i; | |
| 232 | |
| 233 @@ -1935,8 +1938,8 @@ | |
| 17136 | 234 /* main Parametric Stereo decoding function */ |
| 235 uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) | |
| 236 { | |
| 237 - qmf_t X_hybrid_left[32][32] = {{0}}; | |
| 238 - qmf_t X_hybrid_right[32][32] = {{0}}; | |
| 239 + qmf_t X_hybrid_left[32][32] = {{{0}}}; | |
| 240 + qmf_t X_hybrid_right[32][32] = {{{0}}}; | |
| 241 | |
| 242 /* delta decoding of the bitstream data */ | |
| 243 ps_data_decode(ps); | |
| 18141 | 244 --- libfaad2.orig/sbr_dec.c 2006-03-16 20:15:04.000000000 +0100 |
| 245 +++ libfaad2/sbr_dec.c 2006-04-18 20:33:57.000000000 +0200 | |
| 246 @@ -22,7 +22,10 @@ | |
| 247 ** Commercial non-GPL licensing of this software is possible. | |
| 248 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
| 249 ** | |
| 250 +** Initially modified for use with MPlayer on 2005/12/05 | |
| 251 ** $Id: sbr_dec.c,v 1.39 2004/09/04 14:56:28 menno Exp $ | |
| 18783 | 252 +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
| 18141 | 253 +** local_changes.diff contains the exact changes to this file. |
| 254 **/ | |
| 255 | |
| 256 | |
| 257 @@ -526,8 +529,8 @@ | |
| 17137 | 258 uint8_t l, k; |
| 259 uint8_t dont_process = 0; | |
| 260 uint8_t ret = 0; | |
| 261 - ALIGN qmf_t X_left[38][64] = {{0}}; | |
| 262 - ALIGN qmf_t X_right[38][64] = {{0}}; /* must set this to 0 */ | |
| 263 + ALIGN qmf_t X_left[38][64] = {{{0}}}; | |
| 264 + ALIGN qmf_t X_right[38][64] = {{{0}}}; /* must set this to 0 */ | |
| 265 | |
| 266 if (sbr == NULL) | |
| 267 return 20; | |
| 18141 | 268 --- libfaad2.orig/specrec.c 2006-03-16 20:15:04.000000000 +0100 |
| 269 +++ libfaad2/specrec.c 2006-04-18 20:38:09.000000000 +0200 | |
| 270 @@ -19,10 +19,10 @@ | |
| 271 ** Any non-GPL usage of this software or parts of this software is strictly | |
| 272 ** forbidden. | |
| 273 ** | |
| 274 -** Commercial non-GPL licensing of this software is possible. | |
| 275 -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
| 276 -** | |
| 277 +** Initially modified for use with MPlayer on 2006/04/18 | |
| 278 ** $Id: specrec.c,v 1.56 2004/09/08 09:43:11 gcp Exp $ | |
| 18783 | 279 +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
| 18141 | 280 +** local_changes.diff contains the exact changes to this file. |
| 281 **/ | |
| 282 | |
| 283 /* | |
| 284 @@ -673,29 +673,19 @@ | |
| 285 /* MAIN object type prediction */ | |
| 286 if (hDecoder->object_type == MAIN) | |
| 287 { | |
| 288 - /* allocate the state only when needed */ | |
| 289 - if (hDecoder->pred_stat[channel] == NULL) | |
| 290 - { | |
| 291 - hDecoder->pred_stat[channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state)); | |
| 292 + hDecoder->pred_stat[channel] = (pred_state*)realloc(hDecoder->pred_stat[channel], hDecoder->frameLength * sizeof(pred_state)); | |
| 293 reset_all_predictors(hDecoder->pred_stat[channel], hDecoder->frameLength); | |
| 294 - } | |
| 295 } | |
| 296 #endif | |
| 297 | |
| 298 #ifdef LTP_DEC | |
| 299 if (is_ltp_ot(hDecoder->object_type)) | |
| 300 { | |
| 301 - /* allocate the state only when needed */ | |
| 302 - if (hDecoder->lt_pred_stat[channel] == NULL) | |
| 303 - { | |
| 304 - hDecoder->lt_pred_stat[channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t)); | |
| 305 + hDecoder->lt_pred_stat[channel] = (int16_t*)realloc(hDecoder->lt_pred_stat[channel], hDecoder->frameLength*4 * sizeof(int16_t)); | |
| 306 memset(hDecoder->lt_pred_stat[channel], 0, hDecoder->frameLength*4 * sizeof(int16_t)); | |
| 307 - } | |
| 308 } | |
| 309 #endif | |
| 310 | |
| 311 - if (hDecoder->time_out[channel] == NULL) | |
| 312 - { | |
| 313 mul = 1; | |
| 314 #ifdef SBR_DEC | |
| 315 hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 0; | |
| 316 @@ -706,41 +696,28 @@ | |
| 317 hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 1; | |
| 318 } | |
| 319 #endif | |
| 320 - hDecoder->time_out[channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t)); | |
| 321 + hDecoder->time_out[channel] = (real_t*)realloc(hDecoder->time_out[channel], mul*hDecoder->frameLength*sizeof(real_t)); | |
| 322 memset(hDecoder->time_out[channel], 0, mul*hDecoder->frameLength*sizeof(real_t)); | |
| 323 - } | |
| 324 #if (defined(PS_DEC) || defined(DRM_PS)) | |
| 325 if (output_channels == 2) | |
| 326 { | |
| 327 - if (hDecoder->time_out[channel+1] == NULL) | |
| 328 - { | |
| 329 - hDecoder->time_out[channel+1] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t)); | |
| 330 + hDecoder->time_out[channel+1] = (real_t*)realloc(hDecoder->time_out[channel+1], mul*hDecoder->frameLength*sizeof(real_t)); | |
| 331 memset(hDecoder->time_out[channel+1], 0, mul*hDecoder->frameLength*sizeof(real_t)); | |
| 332 - } | |
| 333 } | |
| 334 #endif | |
| 335 | |
| 336 - if (hDecoder->fb_intermed[channel] == NULL) | |
| 337 - { | |
| 338 - hDecoder->fb_intermed[channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t)); | |
| 339 + hDecoder->fb_intermed[channel] = (real_t*)realloc(hDecoder->fb_intermed[channel], hDecoder->frameLength*sizeof(real_t)); | |
| 340 memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t)); | |
| 341 - } | |
| 342 | |
| 343 #ifdef SSR_DEC | |
| 344 if (hDecoder->object_type == SSR) | |
| 345 { | |
| 346 - if (hDecoder->ssr_overlap[channel] == NULL) | |
| 347 - { | |
| 348 - hDecoder->ssr_overlap[channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t)); | |
| 349 - memset(hDecoder->ssr_overlap[channel], 0, 2*hDecoder->frameLength*sizeof(real_t)); | |
| 350 - } | |
| 351 - if (hDecoder->prev_fmd[channel] == NULL) | |
| 352 - { | |
| 353 uint16_t k; | |
| 354 - hDecoder->prev_fmd[channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t)); | |
| 355 + hDecoder->ssr_overlap[channel] = (real_t*)realloc(hDecoder->ssr_overlap[channel], 2*hDecoder->frameLength*sizeof(real_t)); | |
| 356 + memset(hDecoder->ssr_overlap[channel], 0, 2*hDecoder->frameLength*sizeof(real_t)); | |
| 357 + hDecoder->prev_fmd[channel] = (real_t*)realloc(hDecoder->prev_fmd[channel], 2*hDecoder->frameLength*sizeof(real_t)); | |
| 358 for (k = 0; k < 2*hDecoder->frameLength; k++) | |
| 359 hDecoder->prev_fmd[channel][k] = REAL_CONST(-1); | |
| 360 - } | |
| 361 } | |
| 362 #endif | |
| 363 | |
| 364 @@ -865,22 +842,13 @@ | |
| 365 | |
| 366 /* always allocate 2 channels, PS can always "suddenly" turn up */ | |
| 367 #if (defined(PS_DEC) || defined(DRM_PS)) | |
| 368 - output_channels = 2; | |
| 369 + output_channels = hDecoder->ps_used[hDecoder->fr_ch_ele] ? 2 : 1; | |
| 370 #else | |
| 371 output_channels = 1; | |
| 372 #endif | |
| 373 | |
| 374 - if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0) | |
| 375 - { | |
| 376 - /* element_output_channels not set yet */ | |
| 377 + if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] < output_channels) { | |
| 378 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels; | |
| 379 - } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != output_channels) { | |
| 380 - /* element inconsistency */ | |
| 381 - return 21; | |
| 382 - } | |
| 383 - | |
| 384 - if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0) | |
| 385 - { | |
| 386 retval = allocate_single_channel(hDecoder, sce->channel, output_channels); | |
| 387 if (retval > 0) | |
| 388 return retval; | |
| 389 @@ -1026,11 +994,10 @@ | |
| 390 { | |
| 391 return 23; | |
| 392 } | |
| 393 -#endif | |
| 394 | |
| 395 /* copy L to R when no PS is used */ | |
| 396 #if (defined(PS_DEC) || defined(DRM_PS)) | |
| 397 - if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0)) | |
| 398 + if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0) && (output_channels == 2)) | |
| 399 { | |
| 400 uint8_t ele = hDecoder->fr_ch_ele; | |
| 401 uint8_t ch = sce->channel; | |
| 402 @@ -1040,6 +1007,7 @@ | |
| 403 memcpy(hDecoder->time_out[ch+1], hDecoder->time_out[ch], frame_size); | |
| 404 } | |
| 405 #endif | |
| 406 +#endif | |
| 407 | |
| 408 return 0; | |
| 409 } |
