summaryrefslogtreecommitdiffstats
path: root/libfaad2
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-08-17 22:50:29 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-08-17 22:50:29 +0000
commit937a5d699361b24386526f2d77270a07658ed73a (patch)
tree380500a61c362af8759126e39c9e0d0d90f0d28b /libfaad2
parent8bd9e129cb1aa5195050c25cd276be3226134307 (diff)
downloadmpv-937a5d699361b24386526f2d77270a07658ed73a.tar.bz2
mpv-937a5d699361b24386526f2d77270a07658ed73a.tar.xz
Update for latest changes.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16250 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libfaad2')
-rw-r--r--libfaad2/local_changes.diff100
1 files changed, 97 insertions, 3 deletions
diff --git a/libfaad2/local_changes.diff b/libfaad2/local_changes.diff
index 9857181279..9ff3d0d4b0 100644
--- a/libfaad2/local_changes.diff
+++ b/libfaad2/local_changes.diff
@@ -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