Mercurial > mplayer.hg
changeset 16249:d47cd711f617
Update for latest changes.
author | diego |
---|---|
date | Wed, 17 Aug 2005 22:50:29 +0000 |
parents | 2f2e55614b3e |
children | 7df45743ee06 |
files | libfaad2/local_changes.diff |
diffstat | 1 files changed, 97 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libfaad2/local_changes.diff Wed Aug 17 21:44:47 2005 +0000 +++ b/libfaad2/local_changes.diff Wed Aug 17 22:50:29 2005 +0000 @@ -27,6 +27,14 @@ #define INLINE __inline #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) #define ALIGN __declspec(align(16)) +@@ -67,6 +67,6 @@ + /* Use if target platform has address generators with autoincrement */ + //#define PREFER_POINTERS + +-#ifdef _WIN32_WCE ++#if defined(_WIN32_WCE) || defined(__arm__) + #define FIXED_POINT + #endif @@ -117,6 +123,9 @@ # ifdef MAIN_DEC # undef MAIN_DEC @@ -77,12 +85,21 @@ #include <stdio.h> #if HAVE_SYS_TYPES_H # include <sys/types.h> -@@ -311,7 +341,7 @@ +@@ -329,7 +329,7 @@ + } + + +- #if defined(_WIN32) && !defined(__MINGW32__) ++ #if defined(_WIN32) && !defined(__MINGW32__) && !defined(HAVE_LRINTF) + #define HAS_LRINTF + static INLINE int lrintf(float f) + { +@@ -341,7 +341,7 @@ } return i; } -- #elif (defined(__i386__) && defined(__GNUC__)) -+ #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__) +- #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__) ++ #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__) && !defined(HAVE_LRINTF) #define HAS_LRINTF // from http://www.stereopsis.com/FPU.html static INLINE int lrintf(float f) @@ -104,3 +121,80 @@ #ifdef HAVE_SINF # define sin sinf #error +--- main/libfaad2/output.c 2005/02/19 01:21:19 1.7 ++++ main/libfaad2/output.c 2005/03/29 18:14:24 1.8 +@@ -19,10 +19,9 @@ + ** Any non-GPL usage of this software or parts of this software is strictly + ** forbidden. + ** +-** Commercial non-GPL licensing of this software is possible. +-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +-** +-** $Id: output.c,v 1.8 2005/03/29 18:14:24 rfelker Exp $ ++** Initially modified for use with MPlayer by Rich Felker on 2005/03/29 ++** $Id: output.c,v 1.11 2005/04/05 05:43:41 rfelker Exp $ ++** detailed CVS changelog at http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/ + **/ + + #include "common.h" +@@ -462,7 +462,7 @@ + } + } + +-void* output_to_PCM(NeAACDecHandle hDecoder, ++void* output_to_PCM_sux(NeAACDecHandle hDecoder, + real_t **input, void *sample_buffer, uint8_t channels, + uint16_t frame_len, uint8_t format) + { +@@ -553,4 +553,51 @@ + return sample_buffer; + } + ++void* output_to_PCM(NeAACDecHandle hDecoder, ++ real_t **input, void *sample_buffer, uint8_t channels, ++ uint16_t frame_len, uint8_t format) ++{ ++ int ch; ++ int i; ++ int16_t *short_sample_buffer = (int16_t*)sample_buffer; ++ real_t *ch0 = input[hDecoder->internal_channel[0]]; ++ real_t *ch1 = input[hDecoder->internal_channel[1]]; ++ real_t *ch2 = input[hDecoder->internal_channel[2]]; ++ real_t *ch3 = input[hDecoder->internal_channel[3]]; ++ real_t *ch4 = input[hDecoder->internal_channel[4]]; ++ ++ if (format != FAAD_FMT_16BIT) ++ return output_to_PCM_sux(hDecoder, input, sample_buffer, channels, frame_len, format); ++ ++ if (hDecoder->downMatrix) { ++ for(i = 0; i < frame_len; i++) ++ { ++ int32_t tmp; ++ tmp = (ch1[i] + ((ch0[i]+ch3[i])>>1) + ((ch0[i]+ch3[i])>>2) + (1<<(REAL_BITS))) >> (REAL_BITS+1); ++ if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000; ++ short_sample_buffer[0] = tmp; ++ tmp = (ch2[i] + ((ch0[i]+ch4[i])>>1) + ((ch0[i]+ch4[i])>>2) + (1<<(REAL_BITS))) >> (REAL_BITS+1); ++ if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000; ++ short_sample_buffer[1] = tmp; ++ short_sample_buffer += channels; ++ } ++ return sample_buffer; ++ } ++ ++ /* Copy output to a standard PCM buffer */ ++ for(i = 0; i < frame_len; i++) ++ { ++ for (ch = 0; ch < channels; ch++) ++ { ++ int32_t tmp = input[ch][i]; ++ tmp += (1 << (REAL_BITS-1)); ++ tmp >>= REAL_BITS; ++ if ((tmp+0x8000) & ~0xffff) tmp = ~(tmp>>31)-0x8000; ++ *(short_sample_buffer++) = tmp; ++ } ++ } ++ ++ return sample_buffer; ++} ++ + #endif