Mercurial > mplayer.hg
comparison libfaad2/local_changes.diff @ 16249:d47cd711f617
Update for latest changes.
| author | diego |
|---|---|
| date | Wed, 17 Aug 2005 22:50:29 +0000 |
| parents | cc0c5443548d |
| children | d89bfef62e03 |
comparison
equal
deleted
inserted
replaced
| 16248:2f2e55614b3e | 16249:d47cd711f617 |
|---|---|
| 25 +#include "../config.h" | 25 +#include "../config.h" |
| 26 + | 26 + |
| 27 #define INLINE __inline | 27 #define INLINE __inline |
| 28 #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) | 28 #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) |
| 29 #define ALIGN __declspec(align(16)) | 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 | |
| 33 | |
| 34 -#ifdef _WIN32_WCE | |
| 35 +#if defined(_WIN32_WCE) || defined(__arm__) | |
| 36 #define FIXED_POINT | |
| 37 #endif | |
| 30 @@ -117,6 +123,9 @@ | 38 @@ -117,6 +123,9 @@ |
| 31 # ifdef MAIN_DEC | 39 # ifdef MAIN_DEC |
| 32 # undef MAIN_DEC | 40 # undef MAIN_DEC |
| 33 # endif | 41 # endif |
| 34 +# ifdef SBR_DEC | 42 +# ifdef SBR_DEC |
| 75 +#define STDC_HEADERS 1 | 83 +#define STDC_HEADERS 1 |
| 76 + | 84 + |
| 77 #include <stdio.h> | 85 #include <stdio.h> |
| 78 #if HAVE_SYS_TYPES_H | 86 #if HAVE_SYS_TYPES_H |
| 79 # include <sys/types.h> | 87 # include <sys/types.h> |
| 80 @@ -311,7 +341,7 @@ | 88 @@ -329,7 +329,7 @@ |
| 89 } | |
| 90 | |
| 91 | |
| 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) | |
| 96 { | |
| 97 @@ -341,7 +341,7 @@ | |
| 81 } | 98 } |
| 82 return i; | 99 return i; |
| 83 } | 100 } |
| 84 - #elif (defined(__i386__) && defined(__GNUC__)) | 101 - #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__) |
| 85 + #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__) | 102 + #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__) && !defined(HAVE_LRINTF) |
| 86 #define HAS_LRINTF | 103 #define HAS_LRINTF |
| 87 // from http://www.stereopsis.com/FPU.html | 104 // from http://www.stereopsis.com/FPU.html |
| 88 static INLINE int lrintf(float f) | 105 static INLINE int lrintf(float f) |
| 89 @@ -340,6 +370,8 @@ | 106 @@ -340,6 +370,8 @@ |
| 90 | 107 |
| 102 - #include <math.h> | 119 - #include <math.h> |
| 103 - | 120 - |
| 104 #ifdef HAVE_SINF | 121 #ifdef HAVE_SINF |
| 105 # define sin sinf | 122 # define sin sinf |
| 106 #error | 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. | |
| 129 ** | |
| 130 -** Commercial non-GPL licensing of this software is possible. | |
| 131 -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
| 132 -** | |
| 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/ | |
| 137 **/ | |
| 138 | |
| 139 #include "common.h" | |
| 140 @@ -462,7 +462,7 @@ | |
| 141 } | |
| 142 } | |
| 143 | |
| 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) | |
| 148 { | |
| 149 @@ -553,4 +553,51 @@ | |
| 150 return sample_buffer; | |
| 151 } | |
| 152 | |
| 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) | |
| 156 +{ | |
| 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]]; | |
| 165 + | |
| 166 + if (format != FAAD_FMT_16BIT) | |
| 167 + return output_to_PCM_sux(hDecoder, input, sample_buffer, channels, frame_len, format); | |
| 168 + | |
| 169 + if (hDecoder->downMatrix) { | |
| 170 + for(i = 0; i < frame_len; i++) | |
| 171 + { | |
| 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; | |
| 180 + } | |
| 181 + return sample_buffer; | |
| 182 + } | |
| 183 + | |
| 184 + /* Copy output to a standard PCM buffer */ | |
| 185 + for(i = 0; i < frame_len; i++) | |
| 186 + { | |
| 187 + for (ch = 0; ch < channels; ch++) | |
| 188 + { | |
| 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; | |
| 194 + } | |
| 195 + } | |
| 196 + | |
| 197 + return sample_buffer; | |
| 198 +} | |
| 199 + | |
| 200 #endif |
