comparison src/aac/libfaad2/common.h @ 3004:8867d3491f60

Sync with FAAD 2.7; will fix warnings in separate commits.
author Tony Vroon <chainsaw@gentoo.org>
date Wed, 08 Apr 2009 20:12:57 +0100
parents f1b6f1b2cdb3
children
comparison
equal deleted inserted replaced
3003:8b7a44631121 3004:8867d3491f60
1 /* 1 /*
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding 2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com 3 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 ** 4 **
5 ** This program is free software; you can redistribute it and/or modify 5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by 6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation; either version 2 of the License, or 7 ** the Free Software Foundation; either version 2 of the License, or
8 ** (at your option) any later version. 8 ** (at your option) any later version.
9 ** 9 **
10 ** This program is distributed in the hope that it will be useful, 10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details. 13 ** GNU General Public License for more details.
14 ** 14 **
15 ** You should have received a copy of the GNU General Public License 15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software 16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 ** 18 **
19 ** Any non-GPL usage of this software or parts of this software is strictly 19 ** Any non-GPL usage of this software or parts of this software is strictly
20 ** forbidden. 20 ** forbidden.
21 ** 21 **
22 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 **
22 ** Commercial non-GPL licensing of this software is possible. 25 ** Commercial non-GPL licensing of this software is possible.
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. 26 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
24 ** 27 **
25 ** Initially modified for use with MPlayer by Arpad Gereöffy on 2003/08/30 28 ** $Id: common.h,v 1.77 2009/02/05 00:51:03 menno Exp $
26 ** $Id: common.h 18786 2006-06-22 13:34:00Z diego $
27 ** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/
28 ** local_changes.diff contains the exact changes to this file.
29 **/ 29 **/
30 30
31 #ifndef __COMMON_H__ 31 #ifndef __COMMON_H__
32 #define __COMMON_H__ 32 #define __COMMON_H__
33 33
39 #if defined(__CYGWIN__) 39 #if defined(__CYGWIN__)
40 #define __STRICT_ANSI__ 40 #define __STRICT_ANSI__
41 #endif 41 #endif
42 42
43 #include "config.h" 43 #include "config.h"
44 #include "neaacdec.h"
44 45
45 #define INLINE __inline 46 #define INLINE __inline
46 #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) 47 #if 0 //defined(_WIN32) && !defined(_WIN32_WCE)
47 #define ALIGN __declspec(align(16)) 48 #define ALIGN __declspec(align(16))
48 #else 49 #else
81 //#define SSR_DEC 82 //#define SSR_DEC
82 /* Allow decoding of LTP profile AAC */ 83 /* Allow decoding of LTP profile AAC */
83 #define LTP_DEC 84 #define LTP_DEC
84 /* Allow decoding of LD profile AAC */ 85 /* Allow decoding of LD profile AAC */
85 #define LD_DEC 86 #define LD_DEC
86 /* Allow decoding of scalable profiles */
87 //#define SCALABLE_DEC
88 /* Allow decoding of Digital Radio Mondiale (DRM) */ 87 /* Allow decoding of Digital Radio Mondiale (DRM) */
89 //#define DRM 88 //#define DRM
90 //#define DRM_PS 89 //#define DRM_PS
91 90
92 /* LD can't do without LTP */ 91 /* LD can't do without LTP */
116 115
117 #define SBR_DEC 116 #define SBR_DEC
118 //#define SBR_LOW_POWER 117 //#define SBR_LOW_POWER
119 #define PS_DEC 118 #define PS_DEC
120 119
120 #ifdef SBR_LOW_POWER
121 #undef PS_DEC
122 #endif
123
121 /* FIXED POINT: No MAIN decoding */ 124 /* FIXED POINT: No MAIN decoding */
122 #ifdef FIXED_POINT 125 #ifdef FIXED_POINT
123 # ifdef MAIN_DEC 126 # ifdef MAIN_DEC
124 # undef MAIN_DEC 127 # undef MAIN_DEC
125 # endif 128 # endif
126 # ifdef SBR_DEC
127 # undef SBR_DEC
128 # endif
129 #endif // FIXED_POINT 129 #endif // FIXED_POINT
130 130
131 #ifdef DRM 131 #ifdef DRM
132 # ifndef SCALABLE_DEC 132 # ifndef ALLOW_SMALL_FRAMELENGTH
133 # define SCALABLE_DEC 133 # define ALLOW_SMALL_FRAMELENGTH
134 # endif 134 # endif
135 # undef LD_DEC
136 # undef LTP_DEC
137 # undef MAIN_DEC
138 # undef SSR_DEC
135 #endif 139 #endif
136 140
137 141
138 #ifdef FIXED_POINT 142 #ifdef FIXED_POINT
139 #define DIV_R(A, B) (((int64_t)A << REAL_BITS)/B) 143 #define DIV_R(A, B) (((int64_t)A << REAL_BITS)/B)
366 # define _ISOC99_SOURCE 1 370 # define _ISOC99_SOURCE 1
367 # define __USE_ISOC9X 1 371 # define __USE_ISOC9X 1
368 # define __USE_ISOC99 1 372 # define __USE_ISOC99 1
369 #endif 373 #endif
370 374
371 #include <math.h> 375 #include <math.h>
372 376
373 #ifdef HAVE_SINF 377 #ifdef HAVE_SINF
374 # define sin sinf 378 # define sin sinf
375 #error 379 #error
376 #endif 380 #endif
407 #define IM(A) A[1] 411 #define IM(A) A[1]
408 412
409 413
410 /* common functions */ 414 /* common functions */
411 uint8_t cpu_has_sse(void); 415 uint8_t cpu_has_sse(void);
412 uint32_t random_int(void); 416 uint32_t ne_rng(uint32_t *__r1, uint32_t *__r2);
413 uint32_t ones32(uint32_t x);
414 uint32_t floor_log2(uint32_t x);
415 uint32_t wl_min_lzc(uint32_t x); 417 uint32_t wl_min_lzc(uint32_t x);
416 #ifdef FIXED_POINT 418 #ifdef FIXED_POINT
417 #define LOG2_MIN_INF REAL_CONST(-10000) 419 #define LOG2_MIN_INF REAL_CONST(-10000)
418 int32_t log2_int(uint32_t val); 420 int32_t log2_int(uint32_t val);
419 int32_t log2_fix(uint32_t val); 421 int32_t log2_fix(uint32_t val);