Freeware Advanced Audio (AAC) Decoder including SBR decoding http://www.audiocoding.com/ FAAD2 is a HE, LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder. FAAD2 includes code for SBR (HE AAC) decoding. FAAD2 is licensed under the GPL. __________ COPYRIGHTS For FAAD2 the following license applies: ****************************************************************************** ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker (mbakker(at)nero.com), Ahead Software AG ** ** 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. ** ** Commercial non-GPL licensing of this software is also possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ****************************************************************************** Please note that the use of this software may require the payment of patent royalties. You need to consider this issue before you start building derivative works. We are not warranting or indemnifying you in any way for patent royalities! YOU ARE SOLELY RESPONSIBLE FOR YOUR OWN ACTIONS! ______ PEOPLE FAAD2 is written by: - M. Bakker (mbakker(at)nero.com). _______________ VERSION HISTORY Sorry, try building a ChangeLog from CVS. __________________________________ REDISTRIBUTED OPEN SOURCE PACKAGES This is the list of redistributed open source packages that are included in FAAD2: Name: mp4v2 Version: 0.9.8.6 Origin: http://www.mpeg4ip.net Author: David Mackie Directory: common/mp4v2 License: MPL, Mozilla Public License, version 1.1 Name: mp4av Version: 0.9.8.6 Origin: http://www.mpeg4ip.net Author: David Mackie Directory: common/mp4av License: MPL, Mozilla Public License, version 1.1 ___________________ DIRECTORY STRUCTURE faad2 - top level directory. aacDECdrop - windows decoder/player with drag'n'drop functionality common - generally used libraries and code. faad - general common functions like filereading and streaming as well as getting info from aac files. mp4v2 - MPEG-4 file reading library. mp4av - MPEG-4 file general function library. mp4ff - Small MP4 file format library (includes tagging abilities). CoreAAC - AAC DirectShow filter. frontend - command line frontend to the FAAD2 library, also supports MPEG-4 file decoding. include - inlude file for the FAAD2 library. libfaad - the FAAD2 AAC decoder library including SBR. codebook - Huffman codebooks plugins - plugins for all kinds of pograms. in_mp4 - winamp MPEG-4 AAC file input plugin. QCD - Quintessential player AAC plugin. QCDMp4 - Quintessential player MP4 plugin. winamp - winamp2 AAC input plugin. winamp3 - winamp3 AAC input plugin. xmms - xmms AAC plugin mpeg4ip - plugin for the mpeg4ip player 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
/*
** 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$
**/
#ifndef __FIXED_H__
#define __FIXED_H__
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WIN32_WCE) && defined(_ARM_)
#include <cmnintrin.h>
#endif
#define COEF_BITS 28
#define COEF_PRECISION (1 << COEF_BITS)
#define REAL_BITS 14 // MAXIMUM OF 14 FOR FIXED POINT SBR
#define REAL_PRECISION (1 << REAL_BITS)
/* FRAC is the fractional only part of the fixed point number [0.0..1.0) */
#define FRAC_SIZE 32 /* frac is a 32 bit integer */
#define FRAC_BITS 31
#define FRAC_PRECISION ((uint32_t)(1 << FRAC_BITS))
#define FRAC_MAX 0x7FFFFFFF
typedef int32_t real_t;
#define REAL_CONST(A) (((A) >= 0) ? ((real_t)((A)*(REAL_PRECISION)+0.5)) : ((real_t)((A)*(REAL_PRECISION)-0.5)))
#define COEF_CONST(A) (((A) >= 0) ? ((real_t)((A)*(COEF_PRECISION)+0.5)) : ((real_t)((A)*(COEF_PRECISION)-0.5)))
#define FRAC_CONST(A) (((A) == 1.00) ? ((real_t)FRAC_MAX) : (((A) >= 0) ? ((real_t)((A)*(FRAC_PRECISION)+0.5)) : ((real_t)((A)*(FRAC_PRECISION)-0.5))))
//#define FRAC_CONST(A) (((A) >= 0) ? ((real_t)((A)*(FRAC_PRECISION)+0.5)) : ((real_t)((A)*(FRAC_PRECISION)-0.5)))
#define Q2_BITS 22
#define Q2_PRECISION (1 << Q2_BITS)
#define Q2_CONST(A) (((A) >= 0) ? ((real_t)((A)*(Q2_PRECISION)+0.5)) : ((real_t)((A)*(Q2_PRECISION)-0.5)))
#if defined(CPU_COLDFIRE)
static INLINE real_t MUL_F(real_t A, real_t B)
{
asm volatile (
"mac.l %[A], %[B], %%acc0\n\t"
"movclr.l %%acc0, %[A]"
: [A] "+&r" (A) : [B] "r" (B)
);
return A;
}
static INLINE real_t MUL_C(real_t A, real_t B)
{
asm volatile (
"mac.l %[A], %[B], %%acc0\n\t"
"movclr.l %%acc0, %[A]\n\t"
: [A] "+&d" (A) : [B] "r" (B)
);
return A << 3;
}
/* MUL_R needs too many shifts for us to just operate on the top 32 bits the
emac unit gives as usual, so we do a full 64 bit mul here. */
static INLINE real_t MUL_R(real_t x, real_t y)
{
real_t t1, t2;
asm volatile (
"mac.l %[x],%[y],%%acc0\n" /* multiply */
"mulu.l %[y],%[x] \n" /* get lower half, avoid emac stall */