www.pudn.com > iMagic_2006_0428_v098r23.rar > common.h
/*
** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
** 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: common.h,v 1.50 2004/02/06 12:55:24 menno Exp $
**/
#ifndef __COMMON_H__
#define __COMMON_H__
#ifdef __cplusplus
extern "C" {
#endif
#define INLINE __inline
//#if defined(_WIN32) && !defined(_WIN32_WCE)
//#define ALIGN __declspec(align(16))
//#else
#define ALIGN
//#endif
#ifndef max
#define max(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
/* COMPILE TIME DEFINITIONS */
/* use double precision */
/* #define USE_DOUBLE_PRECISION */
/* use fixed point reals */
//#define FIXED_POINT
//#ifdef _WIN32_WCE
//#define FIXED_POINT
//#endif
//#define ERROR_RESILIENCE
/* Allow decoding of MAIN profile AAC */
//#define MAIN_DEC
/* Allow decoding of SSR profile AAC */
/* Allow decoding of LTP profile AAC */
//#define LTP_DEC
/* Allow decoding of LD profile AAC */
//#define LD_DEC
/* Allow decoding of scalable profiles */
//#define SCALABLE_DEC
/* Allow decoding of Digital Radio Mondiale (DRM) */
//#define DRM
//#define DRM_PS
/* LD can't do without LTP */
//#ifdef LD_DEC
//#ifndef ERROR_RESILIENCE
//#define ERROR_RESILIENCE
//#endif
//#ifndef LTP_DEC
//#define LTP_DEC
//#endif
//#endif
#define ALLOW_SMALL_FRAMELENGTH
// Define LC_ONLY_DECODER if you want a pure AAC LC decoder (independant of SBR_DEC)
//#define LC_ONLY_DECODER
#ifdef LC_ONLY_DECODER
#undef LTP_DEC
#undef MAIN_DEC
#undef DRM
#undef ALLOW_SMALL_FRAMELENGTH
#undef ERROR_RESILIENCE
#endif
//#define PCM_ROUNDING
//#define SBR_LOW_POWER
//#define PS_DEC
/* FIXED POINT: No MAIN decoding, no SBR decoding */
//#ifdef FIXED_POINT
//# ifdef MAIN_DEC
//# undef MAIN_DEC
//# endif
//# ifndef SBR_LOW_POWER
//# define SBR_LOW_POWER
//# endif
//#endif // FIXED_POINT
#ifdef DRM
# ifndef SCALABLE_DEC
# define SCALABLE_DEC
# endif
#endif
#define NONMEANINGFUL_WINDOW_SEQUENCE
//#if ((defined(_WIN32) && !defined(_WIN32_WCE)) /* || ((__GNUC__ >= 3) && defined(__i386__)) */ )
//#ifndef FIXED_POINT
/* includes to enable SSE intrinsics */
//#define USE_SSE
//#endif
//#endif
//#ifdef FIXED_POINT
//#define SBR_DIV(A, B) (((int64_t)A << REAL_BITS)/B)
//#else
#define SBR_DIV(A, B) ((A)/(B))
//#endif
//#ifndef SBR_LOW_POWER
//#define qmf_t complex_t
//#define QMF_RE(A) RE(A)
//#define QMF_IM(A) IM(A)
//#else
//#define qmf_t real_t
//#define QMF_RE(A) (A)
//#define QMF_IM(A)
//#endif
#ifndef VC_ENV
#define __int64 long long
#endif
typedef unsigned __int64 uint64_t;
typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned char uint8_t;
typedef __int64 int64_t;
typedef int int32_t;
typedef short int16_t;
typedef char int8_t;
typedef float float32_t;
//typedef unsigned long DWORD;
//typedef unsigned short WORD;
//typedef int BOOL;
//#define FALSE 0
//#define TRUE 1
//typedef unsigned __int32 uint32_t;
//typedef unsigned __int16 uint16_t;
//typedef unsigned __int8 uint8_t;
//typedef __int32 int32_t;
//typedef __int16 int16_t;
//typedef __int8 int8_t;
/* FIXED_POINT doesn't work with MAIN and SSR yet */
//#ifdef FIXED_POINT
// #undef MAIN_DEC
//#endif
#define MUL_R(A,B) ((A)*(B))
#define MUL_C(A,B) ((A)*(B))
#define MUL_F(A,B) ((A)*(B))
//#include "fixed.h"
//typedef float complex_t[2];
typedef int32_t complex_I[2];
#define RE(A) A[0]
#define IM(A) A[1]
#define MAIN 1
#define LC 2
#define SSR 3
#define LTP 4
#define HE_AAC 5
#define LD 23
#define ER_LC 17
#define ER_LTP 19
#define DRM_ER_LC 27 /* special object type for DRM */
/* header types */
#define RAW 0
#define ADIF 1
#define ADTS 2
/* SBR signalling */
#define NO_SBR 0
#define SBR_UPSAMPLED 1
#define SBR_DOWNSAMPLED 2
#define NO_SBR_UPSAMPLED 3
/* DRM channel definitions */
#define DRMCH_MONO 1
#define DRMCH_STEREO 2
#define DRMCH_SBR_MONO 3
#define DRMCH_SBR_LC_STEREO 4
#define DRMCH_SBR_STEREO 5
/* First object type that has ER */
#define ER_OBJECT_START 17
/* Bitstream */
#define LEN_SE_ID 3
#define LEN_TAG 4
#define LEN_BYTE 8
#define EXT_FIL 0
#define EXT_FILL_DATA 1
#define EXT_DATA_ELEMENT 2
#define EXT_DYNAMIC_RANGE 11
#define ANC_DATA 0
/* Syntax elements */
#define ID_SCE 0x0
#define ID_CPE 0x1
#define ID_CCE 0x2
#define ID_LFE 0x3
#define ID_DSE 0x4
#define ID_PCE 0x5
#define ID_FIL 0x6
#define ID_END 0x7
#define ONLY_LONG_SEQUENCE 0x0
#define LONG_START_SEQUENCE 0x1
#define EIGHT_SHORT_SEQUENCE 0x2
#define LONG_STOP_SEQUENCE 0x3
#define ZERO_HCB 0
#define FIRST_PAIR_HCB 5
#define ESC_HCB 11
#define QUAD_LEN 4
#define PAIR_LEN 2
#define NOISE_HCB 13
#define INTENSITY_HCB2 14
#define INTENSITY_HCB 15
#define INVALID_SBR_ELEMENT 255
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef M_PI_2 /* PI/2 */
#define M_PI_2 1.57079632679489661923
#endif
/* library output formats */
#define FAAD_FMT_16BIT 1
#define FAAD_FMT_24BIT 2
#define FAAD_FMT_32BIT 3
#define FAAD_FMT_FLOAT 4
#define FAAD_FMT_DOUBLE 5
#define LC_DEC_CAP (1<<0)
#define MAIN_DEC_CAP (1<<1)
#define LTP_DEC_CAP (1<<2)
#define LD_DEC_CAP (1<<3)
#define ERROR_RESILIENCE_CAP (1<<4)
#define FIXED_POINT_CAP (1<<5)
#define FRONT_CHANNEL_CENTER (1)
#define FRONT_CHANNEL_LEFT (2)
#define FRONT_CHANNEL_RIGHT (3)
#define SIDE_CHANNEL_LEFT (4)
#define SIDE_CHANNEL_RIGHT (5)
#define BACK_CHANNEL_LEFT (6)
#define BACK_CHANNEL_RIGHT (7)
#define BACK_CHANNEL_CENTER (8)
#define LFE_CHANNEL (9)
#define UNKNOWN_CHANNEL (0)
#define MAX_CHANNELS 6
#define MAX_SYNTAX_ELEMENTS 48
#define MAX_WINDOW_GROUPS 8
#define MAX_SFB 51
#define MAX_LTP_SFB 40
#define MAX_LTP_SFB_S 8
#define ARM926E_DIR "\\arm926e\\"
#ifdef __cplusplus
}
#endif
#endif