ref: 6bd8442bfc16bf6ba218fda8eba3abb6901669cf
parent: 6790125a3734b8a00c595784df1de7b1a2537cad
author: menno <menno>
date: Tue Jul 29 04:20:14 EDT 2003
import SBR code
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,8 +1,8 @@
-menno (menno@audiocoding.com)
+M. Bakker (mbakker(at)nero.com)
- complete library
-Alexander Kurpiers (a.kurpiers@nt.tu-darmstadt.de)
+Alexander Kurpiers (a.kurpiers(at)nt.tu-darmstadt.de)
- HCR code
- DRM stuff
- lot's of bug fixes
\ No newline at end of file
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,22 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+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.
+
+
+
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -56,7 +66,7 @@
The precise terms and conditions for copying, distribution and
modification follow.
- GNU GENERAL PUBLIC LICENSE
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -255,7 +265,7 @@
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +287,9 @@
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
+ END OF TERMS AND CONDITIONS
- How to Apply These Terms to Your New Programs
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
--- a/NEWS
+++ b/NEWS
@@ -1,12 +1,3 @@
-8 August 2002
- - Version 1.1 of the FAAD2 library
- - Almost 50% speedup, due to new Huffman decoding
- - Better error handling
- - LD (Low Delay) AAC supported
- - ER (Error Resilient) AAC profiles supported
- - Complete new MDCT code
- - Bug fixes
-
-14 Januari 2002
- - Initial revision of completely rewritten FAAD 2 library
\ No newline at end of file
+25 July 2003
+ - Release version with SBR decoding
\ No newline at end of file
--- a/README
+++ b/README
@@ -1,33 +1,37 @@
-Freeware Advanced Audio Decoder 2
+Freeware Advanced Audio (AAC) Decoder including SBR decoding
http://www.audiocoding.com/
-FAAD 2 is a LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder, completely
-written from scratch. FAAD 2 is licensed under the GPL.
+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 FAAD the following license applies:
+For FAAD2 the following license applies:
******************************************************************************
-FAAD - Freeware Advanced Audio Decoder
-Copyright (C) 2002 M. Bakker
-
-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.
+** 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.
******************************************************************************
@@ -42,24 +46,14 @@
PEOPLE
FAAD2 is written by:
- - menno (menno@audiocoding.com).
+ - M. Bakker (mbakker(at)nero.com).
_______________
VERSION HISTORY
-Version 1.1: 8 aug 2002
- - Almost 50% speedup, due to new Huffman decoding
- - Better error handling
- - LD (Low Delay) AAC supported
- - ER (Error Resilient) AAC profiles supported
- - Complete new MDCT code
- - Bug fixes
+Sorry, try building a ChangeLog from CVS.
-Version 1.0: 14 jan 2002
- - Initial revision of completely rewritten FAAD 2 library
-
-
__________________________________
REDISTRIBUTED OPEN SOURCE PACKAGES
@@ -66,28 +60,21 @@
This is the list of redistributed open source packages that are included
in FAAD2:
-Name: libsndfile
-Version: 1.0.0rc2
-Origin: http://www.zip.com.au/~erikd/libsndfile
-Author: Erik de Castro Lopo
-Directory: common/libsndfile
-License: GNU Lesser General Public License, version 2.1 1999
-
-Name: id3lib
-Version: 3.7.9
-Origin: http://id3lib.sourceforge.net
-Author: Dirk Mahoney, Scott Haug
-Directory: common/id3lib
-License: GNU Library General Public License, version 2, June 1991
-
Name: mp4v2
-Version: 0.9.5
+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
@@ -102,22 +89,28 @@
id3lib - id3 tag editor library.
- libsndfile - general audio file reading library.
-
mp4v2 - MPEG-4 file reading library.
+
+ CoreAAC - AAC DirectShow filter.
frontend - command line frontend to the FAAD2 library, also supports
MPEG-4 file decoding.
- include - inlude file for teh FAAD2 library.
+ include - inlude file for the FAAD2 library.
- libfaad - the FAAD2 AAC decoder library.
+ libfaad - the FAAD2 AAC decoder library including SBR.
codebook - Huffman codebooks
plugins - plugins for all kinds of pograms.
+
+ foo_mp4 - mp4/aac plugin for foobar2000.
in_mp4 - winamp MPEG-4 AAC file input plugin.
+
+ QCD - Quintessential player AAC plugin.
+
+ QCDMp4 - Quintessential player MP4 plugin.
winamp - winamp2 AAC input plugin.
--- a/TODO
+++ b/TODO
@@ -1,10 +1,7 @@
- Small fixes to PNS (see pns.c)
-- Channel coupling
-- Better buffering in frontend (more intelligently handle nr. of channels)
-- Lot's of testing
+- Channel coupling (skipping works)
- SSR (???)
-- CELP decoder -> AAC scalable profile
- Reintroduce:
- Sonique plugin
--- a/aacDECdrop/audio.c
+++ b/aacDECdrop/audio.c
@@ -1,22 +1,25 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: audio.c,v 1.9 2003/02/27 11:37:25 menno Exp $
+** Commercial non-GPL licensing of this software is also possible.
+** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
+**
+** $Id: audio.c,v 1.10 2003/07/29 08:20:11 menno Exp $
**/
#ifdef _WIN32
--- a/aacDECdrop/audio.h
+++ b/aacDECdrop/audio.h
@@ -1,22 +1,25 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: audio.h,v 1.7 2003/02/16 18:17:09 menno Exp $
+** Commercial non-GPL licensing of this software is also possible.
+** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
+**
+** $Id: audio.h,v 1.8 2003/07/29 08:20:11 menno Exp $
**/
#ifndef AUDIO_H_INCLUDED
--- a/common/faad/aacinfo.c
+++ b/common/faad/aacinfo.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: aacinfo.c,v 1.3 2003/06/23 15:21:19 menno Exp $
+** 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: aacinfo.c,v 1.4 2003/07/29 08:20:11 menno Exp $
**/
#ifdef _WIN32
--- a/common/faad/aacinfo.h
+++ b/common/faad/aacinfo.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: aacinfo.h,v 1.2 2003/02/25 18:15:52 menno Exp $
+** 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: aacinfo.h,v 1.3 2003/07/29 08:20:11 menno Exp $
**/
#ifndef AACINFO_H__
--- a/common/faad/filestream.c
+++ b/common/faad/filestream.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: filestream.c,v 1.2 2002/01/21 17:04:27 menno Exp $
+** 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: filestream.c,v 1.3 2003/07/29 08:20:11 menno Exp $
**/
/* Not very portable yet */
--- a/common/faad/filestream.h
+++ b/common/faad/filestream.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: filestream.h,v 1.2 2002/01/21 17:04:27 menno Exp $
+** 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: filestream.h,v 1.3 2003/07/29 08:20:11 menno Exp $
**/
#ifndef FILESTREAM_H
--- a/common/faad/id3v2tag.c
+++ b/common/faad/id3v2tag.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: id3v2tag.c,v 1.3 2002/02/11 11:33:44 menno Exp $
+** 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: id3v2tag.c,v 1.4 2003/07/29 08:20:11 menno Exp $
**/
#define WIN32_LEAN_AND_MEAN
--- a/common/faad/id3v2tag.h
+++ b/common/faad/id3v2tag.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: id3v2tag.h,v 1.2 2002/01/21 17:04:27 menno Exp $
+** 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: id3v2tag.h,v 1.3 2003/07/29 08:20:11 menno Exp $
**/
#ifndef __ID3V2TAG_H__
--- a/common/mp4av/aac.cpp
+++ b/common/mp4av/aac.cpp
@@ -131,3 +131,50 @@
return true;
}
+
+extern "C" bool MP4AV_AacGetConfiguration_SBR(
+ u_int8_t** ppConfig,
+ u_int32_t* pConfigLength,
+ u_int8_t profile,
+ u_int32_t samplingRate,
+ u_int8_t channels)
+{
+ /* create the appropriate decoder config */
+
+ u_int8_t* pConfig = (u_int8_t*)malloc(5);
+ pConfig[0] = 0;
+ pConfig[1] = 0;
+ pConfig[2] = 0;
+ pConfig[3] = 0;
+ pConfig[4] = 0;
+
+ if (pConfig == NULL) {
+ return false;
+ }
+
+ u_int8_t samplingRateIndex =
+ MP4AV_AdtsFindSamplingRateIndex(samplingRate);
+
+ pConfig[0] =
+ ((profile + 1) << 3) | ((samplingRateIndex & 0xe) >> 1);
+ pConfig[1] =
+ ((samplingRateIndex & 0x1) << 7) | (channels << 3);
+
+ /* pConfig[0] & pConfig[1] now contain the backward compatible
+ AudioSpecificConfig
+ */
+
+ /* SBR stuff */
+ const u_int16_t syncExtensionType = 0x2B7;
+ u_int8_t extensionSamplingRateIndex =
+ MP4AV_AdtsFindSamplingRateIndex(2*samplingRate);
+
+ pConfig[2] = (syncExtensionType >> 3) & 0xFF;
+ pConfig[3] = ((syncExtensionType & 0x7) << 5) | 5 /* ext ot id */;
+ pConfig[4] = ((1 & 0x1) << 7) | (extensionSamplingRateIndex << 3);
+
+ *ppConfig = pConfig;
+ *pConfigLength = 5;
+
+ return true;
+}
--- a/common/mp4av/adts.cpp
+++ b/common/mp4av/adts.cpp
@@ -29,7 +29,7 @@
/*
* ADTS Header:
* MPEG-2 version 56 bits (byte aligned)
- * MPEG-4 version 58 bits (not byte aligned)
+ * MPEG-4 version 56 bits (byte aligned) - note - changed for 0.99 version
*
* syncword 12 bits
* id 1 bit
@@ -41,7 +41,6 @@
* channel_configuraton 3 bits
* original 1 bit
* home 1 bit
- * emphasis 2 bits
* copyright_id 1 bit
* copyright_id_start 1 bit
* aac_frame_length 13 bits
@@ -63,15 +62,11 @@
extern "C" u_int16_t MP4AV_AdtsGetFrameSize(u_int8_t* pHdr)
{
/* extract the necessary fields from the header */
- u_int8_t isMpeg4 = !(pHdr[1] & 0x08);
- u_int16_t frameLength;
+ uint16_t frameLength;
- if (isMpeg4) {
- frameLength = (((u_int16_t)pHdr[4]) << 5) | (pHdr[5] >> 3);
- } else { /* MPEG-2 */
- frameLength = (((u_int16_t)(pHdr[3] & 0x3)) << 11)
- | (((u_int16_t)pHdr[4]) << 3) | (pHdr[5] >> 5);
- }
+ frameLength = (((u_int16_t)(pHdr[3] & 0x3)) << 11)
+ | (((u_int16_t)pHdr[4]) << 3) | (pHdr[5] >> 5);
+
return frameLength;
}
@@ -80,15 +75,11 @@
*/
extern "C" u_int16_t MP4AV_AdtsGetHeaderBitSize(u_int8_t* pHdr)
{
- u_int8_t isMpeg4 = !(pHdr[1] & 0x08);
u_int8_t hasCrc = !(pHdr[1] & 0x01);
u_int16_t hdrSize;
- if (isMpeg4) {
- hdrSize = 58;
- } else {
- hdrSize = 56;
- }
+ hdrSize = 56;
+
if (hasCrc) {
hdrSize += 16;
}
@@ -139,6 +130,7 @@
MP4FileHandle mp4File,
MP4TrackId trackId,
MP4SampleId sampleId,
+ int force_profile,
u_int8_t** ppAdtsData,
u_int32_t* pAdtsDataLength)
{
@@ -156,14 +148,28 @@
lastMp4File = mp4File;
lastMp4TrackId = trackId;
- u_int8_t audioType = MP4GetTrackAudioType(mp4File, trackId);
+ u_int8_t audioType = MP4GetTrackEsdsObjectTypeId(mp4File,
+ trackId);
if (MP4_IS_MPEG2_AAC_AUDIO_TYPE(audioType)) {
isMpeg2 = true;
profile = audioType - MP4_MPEG2_AAC_MAIN_AUDIO_TYPE;
+ if (force_profile == 4) {
+ isMpeg2 = false;
+ // profile remains the same
+ }
} else if (audioType == MP4_MPEG4_AUDIO_TYPE) {
isMpeg2 = false;
profile = MP4GetTrackAudioMpeg4Type(mp4File, trackId) - 1;
+ if (force_profile == 2) {
+ if (profile > MP4_MPEG4_AAC_SSR_AUDIO_TYPE) {
+ // they can't use these profiles for mpeg2.
+ lastMp4File = MP4_INVALID_FILE_HANDLE;
+ lastMp4TrackId =MP4_INVALID_TRACK_ID;
+ return false;
+ }
+ isMpeg2 = true;
+ }
} else {
lastMp4File = MP4_INVALID_FILE_HANDLE;
lastMp4TrackId = MP4_INVALID_TRACK_ID;
@@ -231,7 +237,7 @@
u_int8_t** ppAdtsData,
u_int32_t* pAdtsDataLength)
{
- *pAdtsDataLength = (isMpeg2 ? 7 : 8) + dataLength;
+ *pAdtsDataLength = 7 + dataLength; // 56 bits only
CMemoryBitstream adts;
@@ -252,9 +258,7 @@
adts.PutBits(channels, 3); // channel_configuration
adts.PutBits(0, 1); // original
adts.PutBits(0, 1); // home
- if (!isMpeg2) {
- adts.PutBits(0, 2); // emphasis
- }
+
adts.PutBits(0, 1); // copyright_id
adts.PutBits(0, 1); // copyright_id_start
adts.PutBits(*pAdtsDataLength, 13); // aac_frame_length
--- a/common/mp4av/audio.cpp
+++ b/common/mp4av/audio.cpp
@@ -56,7 +56,7 @@
MP4TrackId audioTrackId)
{
u_int8_t audioType =
- MP4GetTrackAudioType(mp4File, audioTrackId);
+ MP4GetTrackEsdsObjectTypeId(mp4File, audioTrackId);
if (audioType == MP4_INVALID_AUDIO_TYPE) {
return 0;
@@ -116,7 +116,7 @@
MP4TrackId audioTrackId)
{
u_int8_t audioType =
- MP4GetTrackAudioType(mp4File, audioTrackId);
+ MP4GetTrackEsdsObjectTypeId(mp4File, audioTrackId);
if (audioType == MP4_INVALID_AUDIO_TYPE) {
return 0;
@@ -165,7 +165,7 @@
MP4TrackId audioTrackId)
{
u_int8_t audioType =
- MP4GetTrackAudioType(mp4File, audioTrackId);
+ MP4GetTrackEsdsObjectTypeId(mp4File, audioTrackId);
if (audioType == MP4_INVALID_AUDIO_TYPE) {
return 0;
--- a/common/mp4av/audio_hinters.cpp
+++ b/common/mp4av/audio_hinters.cpp
@@ -100,6 +100,17 @@
}
}
+ if (samplesThisHint > 0) {
+ rc = (*pConcatenator)(mp4File, mediaTrackId, hintTrackId,
+ samplesThisHint, pSampleIds,
+ samplesThisHint * sampleDuration,
+ maxPayloadSize);
+
+ if (!rc) {
+ return false;
+ }
+ }
+
delete [] pSampleIds;
return true;
@@ -121,6 +132,7 @@
MP4SampleId* pSampleIds = new MP4SampleId[bundle];
+ uint32_t sampleIds = 0;
for (u_int32_t i = 1; i <= numSamples; i += stride * bundle) {
for (u_int32_t j = 0; j < stride; j++) {
u_int32_t k;
@@ -135,6 +147,7 @@
// add sample to this hint
pSampleIds[k] = sampleId;
+ sampleIds++;
}
if (k == 0) {
@@ -150,6 +163,9 @@
// at the end of the track
if (i + (stride * bundle) > numSamples) {
hintDuration = ((numSamples - i) - j) * sampleDuration;
+ if (hintDuration == 0) {
+ hintDuration = sampleDuration;
+ }
} else {
hintDuration = ((stride * bundle) - j) * sampleDuration;
}
@@ -160,6 +176,7 @@
// write hint
rc = (*pConcatenator)(mp4File, mediaTrackId, hintTrackId,
k, pSampleIds, hintDuration, maxPayloadSize);
+ sampleIds = 0;
if (!rc) {
return false;
--- a/common/mp4av/l16.cpp
+++ b/common/mp4av/l16.cpp
@@ -21,7 +21,7 @@
#include <mp4av_common.h>
-//#define DEBUG_L16 1
+#define DEBUG_L16 1
extern "C" bool L16Hinter (MP4FileHandle mp4file,
MP4TrackId trackid,
uint16_t maxPayloadSize)
@@ -58,7 +58,7 @@
}
#endif
- audioType = MP4GetTrackAudioType(mp4file, trackid);
+ audioType = MP4GetTrackEsdsObjectTypeId(mp4file, trackid);
if (audioType != MP4_PCM16_BIG_ENDIAN_AUDIO_TYPE) return false;
--- a/common/mp4av/libmp4av.dsp
+++ b/common/mp4av/libmp4av.dsp
@@ -1,184 +1,184 @@
-# Microsoft Developer Studio Project File - Name="libmp4av" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=libmp4av - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "libmp4av.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "libmp4av.mak" CFG="libmp4av - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "libmp4av - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "libmp4av - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "libmp4av - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "libmp4av___Win32_Release"
-# PROP BASE Intermediate_Dir "libmp4av___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "MRelease"
-# PROP Intermediate_Dir "MRelease"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\mp4v2" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "libmp4av - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "MDebug"
-# PROP Intermediate_Dir "MDebug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\mp4v2" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "_WIN32" /D "_WINDOWS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ENDIF
-
-# Begin Target
-
-# Name "libmp4av - Win32 Release"
-# Name "libmp4av - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\aac.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\adts.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\audio.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\audio_hinters.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\mbs.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp3.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\mpeg3.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\mpeg4.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\rfc2250.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\rfc3016.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\rfc3119.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\rfcisma.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\audio_hinters.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mbs.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_aac.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_adts.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_audio.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_common.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_hinters.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_mp3.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_mpeg3.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_mpeg4.h
-# End Source File
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="libmp4av" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=libmp4av - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "libmp4av.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "libmp4av.mak" CFG="libmp4av - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "libmp4av - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "libmp4av - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "libmp4av - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "libmp4av___Win32_Release"
+# PROP BASE Intermediate_Dir "libmp4av___Win32_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MRelease"
+# PROP Intermediate_Dir "MRelease"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\mp4v2" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "libmp4av - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MDebug"
+# PROP Intermediate_Dir "MDebug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\mp4v2" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "_WIN32" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF
+
+# Begin Target
+
+# Name "libmp4av - Win32 Release"
+# Name "libmp4av - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\aac.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\adts.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\audio.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\audio_hinters.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp3.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mpeg3.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mpeg4.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfc2250.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfc3016.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfc3119.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfcisma.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\audio_hinters.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbs.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_aac.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_adts.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_audio.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_common.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_hinters.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_mp3.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_mpeg3.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_mpeg4.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- a/common/mp4av/libmp4av_st.dsp
+++ b/common/mp4av/libmp4av_st.dsp
@@ -1,178 +1,176 @@
-# Microsoft Developer Studio Project File - Name="libmp4av_st" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=libmp4av_st - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "libmp4av_st.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "libmp4av_st.mak" CFG="libmp4av_st - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "libmp4av_st - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "libmp4av_st - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=xicl6.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "libmp4av_st - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\mp4v2" /I ".\\" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=xilink6.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "libmp4av_st - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\mp4v2" /I ".\\" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=xilink6.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ENDIF
-
-# Begin Target
-
-# Name "libmp4av_st - Win32 Release"
-# Name "libmp4av_st - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\aac.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\adts.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\audio_hinters.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\l16.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\mbs.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp3.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\mpeg3.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\mpeg4.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\rfc2250.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\rfc3016.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\rfc3119.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\rfcisma.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\audio_hinters.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mbs.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_aac.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_adts.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_common.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_hinters.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_mp3.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\mp4av_mpeg4.h
-# End Source File
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="libmp4av_st" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=libmp4av_st - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "libmp4av_st.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "libmp4av_st.mak" CFG="libmp4av_st - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "libmp4av_st - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "libmp4av_st - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "libmp4av_st - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\mp4v2" /I "." /I "..\..\include" /I "..\..\lib\mp4v2" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "libmp4av_st - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\lib\mp4v2" /I "." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF
+
+# Begin Target
+
+# Name "libmp4av_st - Win32 Release"
+# Name "libmp4av_st - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\aac.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\adts.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\audio_hinters.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\l16.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp3.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mpeg3.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mpeg4.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfc2250.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfc3016.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfc3119.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfcisma.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\audio_hinters.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbs.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_aac.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_adts.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_common.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_hinters.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_mp3.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp4av_mpeg4.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- a/common/mp4av/mp4av_adts.h
+++ b/common/mp4av/mp4av_adts.h
@@ -77,6 +77,7 @@
MP4FileHandle mp4File,
MP4TrackId trackId,
MP4SampleId sampleId,
+ int force_profile,
u_int8_t** ppAdtsData,
u_int32_t* pAdtsDataLength);
--- a/common/mp4av/mp4av_mpeg4.h
+++ b/common/mp4av/mp4av_mpeg4.h
@@ -33,6 +33,7 @@
extern "C" {
#endif
+ uint8_t *MP4AV_Mpeg4FindVosh(uint8_t *pBuf, uint32_t bufLen);
bool MP4AV_Mpeg4ParseVosh(
u_int8_t* pVoshBuf,
u_int32_t voshSize,
@@ -47,6 +48,8 @@
u_int8_t** ppBytes,
u_int32_t* pNumBytes,
u_int8_t objectId);
+
+ uint8_t *MP4AV_Mpeg4FindVol(uint8_t *pBuf, uint32_t buflen);
bool MP4AV_Mpeg4ParseVol(
u_int8_t* pVolBuf,
--- a/common/mp4av/mpeg3.cpp
+++ b/common/mp4av/mpeg3.cpp
@@ -265,7 +265,7 @@
if (numSamples == 0) return false;
- videoType = MP4GetTrackVideoType(mp4file, trackid);
+ videoType = MP4GetTrackEsdsObjectTypeId(mp4file, trackid);
if (videoType != MP4_MPEG1_VIDEO_TYPE &&
videoType != MP4_MPEG2_VIDEO_TYPE) {
--- a/common/mp4av/mpeg4.cpp
+++ b/common/mp4av/mpeg4.cpp
@@ -26,6 +26,21 @@
#include <mp4av_common.h>
+extern "C" uint8_t *MP4AV_Mpeg4FindVosh (uint8_t *pBuf, uint32_t buflen)
+{
+ while (buflen > 4) {
+ if (pBuf[0] == 0x0 &&
+ pBuf[1] == 0x0 &&
+ pBuf[2] == 0x1 &&
+ pBuf[3] == MP4AV_MPEG4_VOSH_START) {
+ return pBuf;
+ }
+ pBuf++;
+ buflen--;
+ }
+ return NULL;
+}
+
extern "C" bool MP4AV_Mpeg4ParseVosh(
u_int8_t* pVoshBuf,
u_int32_t voshSize,
@@ -110,6 +125,21 @@
return true;
}
+extern "C" uint8_t *MP4AV_Mpeg4FindVol (uint8_t *pBuf, uint32_t buflen)
+{
+ while (buflen > 4) {
+ if (pBuf[0] == 0x0 &&
+ pBuf[1] == 0x0 &&
+ pBuf[2] == 0x1 &&
+ (pBuf[3] & 0xf0) == MP4AV_MPEG4_VOL_START) {
+ return pBuf;
+ }
+ pBuf++;
+ buflen--;
+ }
+ return NULL;
+}
+
extern "C" bool MP4AV_Mpeg4ParseVol(
u_int8_t* pVolBuf,
u_int32_t volSize,
@@ -235,8 +265,8 @@
vol.PutBits(profile, 8);
/* 1 bit - is object layer id = 1 */
vol.PutBits(1, 1);
- /* 4 bits - visual object layer ver id = 2 */
- vol.PutBits(2, 4);
+ /* 4 bits - visual object layer ver id = 1 */
+ vol.PutBits(1, 4);
/* 3 bits - visual object layer priority = 1 */
vol.PutBits(1, 3);
@@ -295,8 +325,12 @@
/* 1 bit - overlapped block motion compensation disable = 1 */
vol.PutBits(1, 1);
+#if 0
/* 2 bits - sprite usage = 0 */
vol.PutBits(0, 2);
+#else
+ vol.PutBits(0, 1);
+#endif
/* 1 bit - not 8 bit pixels = 0 */
vol.PutBits(0, 1);
/* 1 bit - quant type = 0 */
@@ -307,8 +341,10 @@
/* 1 bit - load inter quant mat = 0 */
vol.PutBits(0, 1);
}
+#if 0
/* 1 bit - quarter pixel = 0 */
vol.PutBits(0, 1);
+#endif
/* 1 bit - complexity estimation disable = 1 */
vol.PutBits(1, 1);
/* 1 bit - resync marker disable = 1 */
@@ -315,10 +351,12 @@
vol.PutBits(1, 1);
/* 1 bit - data partitioned = 0 */
vol.PutBits(0, 1);
+#if 0
/* 1 bit - newpred = 0 */
vol.PutBits(0, 1);
/* 1 bit - reduced resolution vop = 0 */
vol.PutBits(0, 1);
+#endif
/* 1 bit - scalability = 0 */
vol.PutBits(0, 1);
--- a/common/mp4av/rfc2250.cpp
+++ b/common/mp4av/rfc2250.cpp
@@ -45,7 +45,7 @@
}
u_int8_t audioType =
- MP4GetTrackAudioType(mp4File, mediaTrackId);
+ MP4GetTrackEsdsObjectTypeId(mp4File, mediaTrackId);
if (!MP4_IS_MP3_AUDIO_TYPE(audioType)) {
return false;
--- a/common/mp4av/rfc3119.cpp
+++ b/common/mp4av/rfc3119.cpp
@@ -417,7 +417,7 @@
}
u_int8_t audioType =
- MP4GetTrackAudioType(mp4File, mediaTrackId);
+ MP4GetTrackEsdsObjectTypeId(mp4File, mediaTrackId);
if (!MP4_IS_MP3_AUDIO_TYPE(audioType)) {
return false;
--- a/common/mp4av/rfcisma.cpp
+++ b/common/mp4av/rfcisma.cpp
@@ -183,7 +183,7 @@
}
u_int8_t audioType =
- MP4GetTrackAudioType(mp4File, mediaTrackId);
+ MP4GetTrackEsdsObjectTypeId(mp4File, mediaTrackId);
if (audioType != MP4_MPEG4_AUDIO_TYPE
&& !MP4_IS_AAC_AUDIO_TYPE(audioType)) {
--- a/frontend/audio.c
+++ b/frontend/audio.c
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: audio.c,v 1.16 2003/07/09 15:11:25 menno Exp $
+** 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: audio.c,v 1.17 2003/07/29 08:20:11 menno Exp $
**/
#ifdef _WIN32
--- a/frontend/audio.h
+++ b/frontend/audio.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: audio.h,v 1.8 2003/07/09 15:11:25 menno Exp $
+** 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: audio.h,v 1.9 2003/07/29 08:20:11 menno Exp $
**/
#ifndef AUDIO_H_INCLUDED
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: main.c,v 1.42 2003/07/09 18:32:42 menno Exp $
+** 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: main.c,v 1.43 2003/07/29 08:20:11 menno Exp $
**/
#ifdef _WIN32
@@ -610,7 +616,7 @@
/* print some mp4 file info */
{
char *file_info = MP4Info(infile, MP4_INVALID_TRACK_ID);
- fprintf(stderr, "%s", file_info);
+ fprintf(stderr, "%s\n", file_info);
free(file_info);
}
--- a/include/faad.h
+++ b/include/faad.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: faad.h,v 1.25 2003/07/09 13:55:59 menno Exp $
+** 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: faad.h,v 1.26 2003/07/29 08:20:11 menno Exp $
**/
#ifndef __AACDEC_H__
@@ -37,7 +43,7 @@
#endif
#endif
-#define FAAD2_VERSION "1.2 beta"
+#define FAAD2_VERSION "2.0 RC1 "
/* object types for AAC */
#define MAIN 0
@@ -64,7 +70,7 @@
#define FAAD_FMT_16BIT_L_SHAPE 7
#define FAAD_FMT_16BIT_M_SHAPE 8
#define FAAD_FMT_16BIT_H_SHAPE 9
-
+
/* Capabilities */
#define LC_DEC_CAP (1<<0)
#define MAIN_DEC_CAP (1<<1)
@@ -104,7 +110,7 @@
/* GA Specific Info */
unsigned char frameLengthFlag;
unsigned char dependsOnCoreCoder;
- unsigned long coreCoderDelay;
+ unsigned short coreCoderDelay;
unsigned char extensionFlag;
unsigned char aacSectionDataResilienceFlag;
unsigned char aacScalefactorDataResilienceFlag;
@@ -111,6 +117,7 @@
unsigned char aacSpectralDataResilienceFlag;
unsigned char epConfig;
+ char sbr_present_flag;
} mp4AudioSpecificConfig;
typedef struct faacDecConfiguration
--- a/libfaad/Makefile.am
+++ b/libfaad/Makefile.am
@@ -5,13 +5,18 @@
error.c filtbank.c \
ic_predict.c is.c lt_predict.c mdct.c mp4.c ms.c output.c pns.c \
pulse.c specrec.c syntax.c tns.c hcr.c \
-rvlc.c ssr.c ssr_fb.c ssr_ipqf.c common.c
+rvlc.c ssr.c ssr_fb.c ssr_ipqf.c common.c \
+sbr_dct.c sbr_e_nf.c sbr_fbt.c sbr_hfadj.c sbr_hfgen.c \
+sbr_huff.c sbr_qmf.c sbr_syntax.c sbr_tf_grid.c sbr_dec.c
libfaad_la_INCLUDES = analysis.h bits.h cfft.h cfft_tab.h common.h \
decoder.h dither.h drc.h error.h fixed.h filtbank.h \
huffman.h ic_predict.h iq_table.h is.h kbd_win.h lt_predict.h mdct.h mp4.h \
ms.h output.h pns.h pulse.h rvlc.h sine_win.h ssr.h ssr_fb.h ssr_ipqf.h \
-ssr_win.h specrec.h syntax.h tns.h codebook/hcb.h \
+ssr_win.h specrec.h syntax.h tns.h \
+sbr_dct.h sbr_dec.h sbr_e_nf.h sbr_fbt.h sbr_hfadj.h sbr_hfgen.h \
+sbr_huff.h sbr_noise.h sbr_qmf.h sbr_syntax.h sbr_tf_grid.h \
+codebook/hcb.h \
codebook/hcb_1.h codebook/hcb_2.h codebook/hcb_3.h codebook/hcb_4.h \
codebook/hcb_5.h codebook/hcb_6.h codebook/hcb_7.h codebook/hcb_8.h \
codebook/hcb_9.h codebook/hcb_10.h codebook/hcb_11.h codebook/hcb_sf.h
--- a/libfaad/analysis.h
+++ b/libfaad/analysis.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: analysis.h,v 1.2 2002/02/18 10:01:05 menno Exp $
+** 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: analysis.h,v 1.3 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __ANALYSIS_H__
--- a/libfaad/bits.c
+++ b/libfaad/bits.c
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: bits.c,v 1.21 2003/02/24 15:02:25 menno Exp $
+** 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: bits.c,v 1.22 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
--- a/libfaad/bits.h
+++ b/libfaad/bits.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: bits.h,v 1.20 2003/07/09 11:53:07 menno Exp $
+** 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: bits.h,v 1.21 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __BITS_H__
--- a/libfaad/cfft.c
+++ b/libfaad/cfft.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: cfft.c,v 1.10 2002/11/28 18:48:29 menno Exp $
+** 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: cfft.c,v 1.11 2003/07/29 08:20:12 menno Exp $
**/
/*
--- a/libfaad/cfft.h
+++ b/libfaad/cfft.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: cfft.h,v 1.5 2002/11/28 18:48:29 menno Exp $
+** 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: cfft.h,v 1.6 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __CFFT_H__
--- a/libfaad/cfft_tab.h
+++ b/libfaad/cfft_tab.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: cfft_tab.h,v 1.2 2002/09/26 19:01:45 menno Exp $
+** 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: cfft_tab.h,v 1.3 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __CFFT_TAB_H__
--- a/libfaad/codebook/hcb.h
+++ b/libfaad/codebook/hcb.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb.h,v 1.4 2003/05/18 18:14:37 menno Exp $
+** 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: hcb.h,v 1.5 2003/07/29 08:20:14 menno Exp $
**/
#ifndef __HCB_H__
@@ -65,7 +71,6 @@
#define ESC_HCB 11
#define QUAD_LEN 4
#define PAIR_LEN 2
-#define BOOKSCL 12
#define NOISE_HCB 13
#define INTENSITY_HCB2 14
#define INTENSITY_HCB 15
@@ -107,32 +112,16 @@
int8_t data[2];
} hcb_bin_pair;
-#if 0
-extern hcb hcb1_1[];
-extern hcb hcb2_1[];
-extern hcb hcb4_1[];
-extern hcb hcb6_1[];
-extern hcb hcb8_1[];
-extern hcb hcb10_1[];
-extern hcb hcb11_1[];
+hcb *hcb_table[];
+hcb_2_quad *hcb_2_quad_table[];
+hcb_2_pair *hcb_2_pair_table[];
+hcb_bin_pair *hcb_bin_table[];
+uint8_t hcbN[];
+uint8_t unsigned_cb[];
+int hcb_2_quad_table_size[];
+int hcb_2_pair_table_size[];
+int hcb_bin_table_size[];
-extern hcb_2_quad hcb1_2[];
-extern hcb_2_quad hcb2_2[];
-extern hcb_2_quad hcb4_2[];
-extern hcb_2_pair hcb6_2[];
-extern hcb_2_pair hcb8_2[];
-extern hcb_2_pair hcb10_2[];
-extern hcb_2_pair hcb11_2[];
-
-extern hcb_bin_quad hcb3[];
-extern hcb_bin_pair hcb5[];
-extern hcb_bin_pair hcb7[];
-extern hcb_bin_pair hcb9[];
-
-extern uint8_t hcb_sf[][2];
-
-#else
-
#include "codebook/hcb_1.h"
#include "codebook/hcb_2.h"
#include "codebook/hcb_3.h"
@@ -145,9 +134,6 @@
#include "codebook/hcb_10.h"
#include "codebook/hcb_11.h"
#include "codebook/hcb_sf.h"
-
-#endif
-
#ifdef __cplusplus
--- a/libfaad/codebook/hcb_1.h
+++ b/libfaad/codebook/hcb_1.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_1.h,v 1.1 2003/05/18 18:14:37 menno Exp $
+** 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: hcb_1.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* 2-step huffman table HCB_1 */
--- a/libfaad/codebook/hcb_10.h
+++ b/libfaad/codebook/hcb_10.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_10.h,v 1.1 2003/05/18 18:14:37 menno Exp $
+** 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: hcb_10.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* 2-step huffman table HCB_10 */
--- a/libfaad/codebook/hcb_11.h
+++ b/libfaad/codebook/hcb_11.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_11.h,v 1.1 2003/05/18 18:14:38 menno Exp $
+** 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: hcb_11.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* 2-step huffman table HCB_11 */
--- a/libfaad/codebook/hcb_2.h
+++ b/libfaad/codebook/hcb_2.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_2.h,v 1.1 2003/05/18 18:14:38 menno Exp $
+** 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: hcb_2.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* 2-step huffman table HCB_2 */
--- a/libfaad/codebook/hcb_3.h
+++ b/libfaad/codebook/hcb_3.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_3.h,v 1.1 2003/05/18 18:14:38 menno Exp $
+** 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: hcb_3.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* Binary search huffman table HCB_3 */
--- a/libfaad/codebook/hcb_4.h
+++ b/libfaad/codebook/hcb_4.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_4.h,v 1.1 2003/05/18 18:14:38 menno Exp $
+** 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: hcb_4.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* 2-step huffman table HCB_4 */
--- a/libfaad/codebook/hcb_5.h
+++ b/libfaad/codebook/hcb_5.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_5.h,v 1.1 2003/05/18 18:14:38 menno Exp $
+** 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: hcb_5.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* Binary search huffman table HCB_5 */
--- a/libfaad/codebook/hcb_6.h
+++ b/libfaad/codebook/hcb_6.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_6.h,v 1.1 2003/05/18 18:14:38 menno Exp $
+** 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: hcb_6.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* 2-step huffman table HCB_6 */
--- a/libfaad/codebook/hcb_7.h
+++ b/libfaad/codebook/hcb_7.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_7.h,v 1.1 2003/05/18 18:14:38 menno Exp $
+** 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: hcb_7.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* Binary search huffman table HCB_7 */
--- a/libfaad/codebook/hcb_8.h
+++ b/libfaad/codebook/hcb_8.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_8.h,v 1.1 2003/05/18 18:14:38 menno Exp $
+** 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: hcb_8.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* 2-step huffman table HCB_8 */
--- a/libfaad/codebook/hcb_9.h
+++ b/libfaad/codebook/hcb_9.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_9.h,v 1.1 2003/05/18 18:14:38 menno Exp $
+** 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: hcb_9.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* Binary search huffman table HCB_9 */
--- a/libfaad/codebook/hcb_sf.h
+++ b/libfaad/codebook/hcb_sf.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb_sf.h,v 1.1 2003/05/18 18:14:38 menno Exp $
+** 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: hcb_sf.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
/* Binary search huffman table HCB_SF */
--- a/libfaad/common.c
+++ b/libfaad/common.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: common.c,v 1.5 2002/11/28 18:48:29 menno Exp $
+** 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.c,v 1.6 2003/07/29 08:20:12 menno Exp $
**/
/* just some common functions that could be used anywhere */
@@ -29,6 +35,7 @@
/* Returns the sample rate index based on the samplerate */
uint8_t get_sr_index(uint32_t samplerate)
{
+ if (16428320 <= samplerate) return 11;
if (92017 <= samplerate) return 0;
if (75132 <= samplerate) return 1;
if (55426 <= samplerate) return 2;
@@ -138,6 +145,7 @@
*/
uint32_t random_int(void)
{
+ static const uint32_t rnd_seed = 16428320;
uint32_t t1, t2, t3, t4;
t3 = t1 = __r1; t4 = t2 = __r2; // Parity calculation is done via table lookup, this is also available
@@ -148,13 +156,10 @@
return (__r1 = (t3 >> 1) | t1 ) ^ (__r2 = (t4 + t4) | t2 );
}
-#if 0
-
#define LOG2 0.30102999566398
-uint32_t int_log2(uint32_t val)
+int32_t int_log2(int32_t val)
{
- return (uint32_t)(log((real_t)val)/LOG2 + 0.5);
+ return (int32_t)ceil(log(val)/log(2));
}
-#endif
--- a/libfaad/common.h
+++ b/libfaad/common.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: common.h,v 1.29 2003/02/06 20:01:51 menno Exp $
+** 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.30 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __COMMON_H__
@@ -66,6 +72,32 @@
#endif
+#define SBR_DEC
+//#define SBR_LOW_POWER
+
+#ifdef FIXED_POINT
+#ifndef SBR_LOW_POWER
+#define SBR_LOW_POWER
+#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) 0
+#endif
+
+
/* END COMPILE TIME DEFINITIONS */
#ifndef FIXED_POINT
@@ -251,8 +283,8 @@
/* common functions */
-uint32_t int_log2(uint32_t val);
-
+int32_t int_log2(int32_t val);
+uint32_t random_int(void);
uint8_t get_sr_index(uint32_t samplerate);
int8_t can_decode_ot(uint8_t object_type);
--- a/libfaad/decoder.c
+++ b/libfaad/decoder.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: decoder.c,v 1.61 2003/07/09 13:55:59 menno Exp $
+** 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: decoder.c,v 1.62 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
@@ -43,6 +49,9 @@
#include "ssr.h"
#include "ssr_fb.h"
#endif
+#ifdef SBR_DEC
+#include "sbr_dec.h"
+#endif
#ifdef ANALYSIS
uint16_t dbg_count;
@@ -110,6 +119,9 @@
{
hDecoder->window_shape_prev[i] = 0;
hDecoder->time_out[i] = NULL;
+#ifdef SBR_DEC
+ hDecoder->time_out2[i] = NULL;
+#endif
#ifdef SSR_DEC
hDecoder->ssr_overlap[i] = NULL;
hDecoder->prev_fmd[i] = NULL;
@@ -123,6 +135,13 @@
#endif
}
+#ifdef SBR_DEC
+ for (i = 0; i < 32; i++)
+ {
+ hDecoder->sbr[i] = NULL;
+ }
+#endif
+
hDecoder->drc = drc_init(REAL_CONST(1.0), REAL_CONST(1.0));
#if POW_TABLE_SIZE
@@ -275,7 +294,16 @@
hDecoder->aacSectionDataResilienceFlag = mp4ASC.aacSectionDataResilienceFlag;
hDecoder->aacScalefactorDataResilienceFlag = mp4ASC.aacScalefactorDataResilienceFlag;
hDecoder->aacSpectralDataResilienceFlag = mp4ASC.aacSpectralDataResilienceFlag;
+#ifdef SBR_DEC
+ hDecoder->sbr_present_flag = mp4ASC.sbr_present_flag;
+ /* AAC core decoder samplerate is 2 times as low */
+ if (hDecoder->sbr_present_flag == 1)
+ {
+ hDecoder->sf_index = get_sr_index(mp4ASC.samplingFrequency / 2);
+ }
+#endif
+
if (hDecoder->object_type < 5)
hDecoder->object_type--; /* For AAC differs from MPEG-4 */
if (rc != 0)
@@ -343,6 +371,9 @@
for (i = 0; i < MAX_CHANNELS; i++)
{
if (hDecoder->time_out[i]) free(hDecoder->time_out[i]);
+#ifdef SBR_DEC
+ if (hDecoder->time_out2[i]) free(hDecoder->time_out2[i]);
+#endif
#ifdef SSR_DEC
if (hDecoder->ssr_overlap[i]) free(hDecoder->ssr_overlap[i]);
if (hDecoder->prev_fmd[i]) free(hDecoder->prev_fmd[i]);
@@ -372,9 +403,28 @@
if (hDecoder->sample_buffer) free(hDecoder->sample_buffer);
+#ifdef SBR_DEC
+ for (i = 0; i < 32; i++)
+ {
+ if (hDecoder->sbr[i])
+ sbrDecodeEnd(hDecoder->sbr[i]);
+ }
+#endif
+
if (hDecoder) free(hDecoder);
}
+void FAADAPI faacDecPostSeekReset(faacDecHandle hDecoder, int32_t frame)
+{
+ if (hDecoder)
+ {
+ hDecoder->postSeekResetFlag = 1;
+
+ if (frame != -1)
+ hDecoder->frame = frame;
+ }
+}
+
void create_channel_config(faacDecHandle hDecoder, faacDecFrameInfo *hInfo)
{
hInfo->num_front_channels = 0;
@@ -610,6 +660,9 @@
#endif
uint8_t *window_shape_prev = hDecoder->window_shape_prev;
real_t **time_out = hDecoder->time_out;
+#ifdef SBR_DEC
+ real_t **time_out2 = hDecoder->time_out2;
+#endif
#ifdef SSR_DEC
real_t **ssr_overlap = hDecoder->ssr_overlap;
real_t **prev_fmd = hDecoder->prev_fmd;
@@ -722,10 +775,22 @@
if (hDecoder->sample_buffer == NULL)
{
- if (hDecoder->config.outputFormat == FAAD_FMT_DOUBLE)
- hDecoder->sample_buffer = malloc(frame_len*output_channels*sizeof(double));
- else
- hDecoder->sample_buffer = malloc(frame_len*output_channels*sizeof(real_t));
+#ifdef SBR_DEC
+ if (hDecoder->sbr_present_flag == 1)
+ {
+ if (hDecoder->config.outputFormat == FAAD_FMT_DOUBLE)
+ hDecoder->sample_buffer = malloc(2*frame_len*channels*sizeof(double));
+ else
+ hDecoder->sample_buffer = malloc(2*frame_len*channels*sizeof(real_t));
+ } else {
+#endif
+ if (hDecoder->config.outputFormat == FAAD_FMT_DOUBLE)
+ hDecoder->sample_buffer = malloc(frame_len*channels*sizeof(double));
+ else
+ hDecoder->sample_buffer = malloc(frame_len*channels*sizeof(real_t));
+#ifdef SBR_DEC
+ }
+#endif
}
sample_buffer = hDecoder->sample_buffer;
@@ -871,6 +936,13 @@
time_out[ch] = (real_t*)malloc(frame_len*2*sizeof(real_t));
memset(time_out[ch], 0, frame_len*2*sizeof(real_t));
}
+#ifdef SBR_DEC
+ if (time_out2[ch] == NULL)
+ {
+ time_out2[ch] = (real_t*)malloc(frame_len*2*sizeof(real_t));
+ memset(time_out2[ch], 0, frame_len*2*sizeof(real_t));
+ }
+#endif
/* filter bank */
#ifdef SSR_DEC
@@ -919,9 +991,53 @@
#endif
}
- sample_buffer = output_to_PCM(hDecoder, time_out, sample_buffer,
- output_channels, frame_len, outputFormat);
+#ifdef SBR_DEC
+ if (hDecoder->sbr_present_flag == 1)
+ {
+ for (i = 0; i < ch_ele; i++)
+ {
+ if (syntax_elements[i]->paired_channel != -1)
+ {
+ memcpy(time_out2[syntax_elements[i]->channel],
+ time_out[syntax_elements[i]->channel], frame_len*sizeof(real_t));
+ memcpy(time_out2[syntax_elements[i]->paired_channel],
+ time_out[syntax_elements[i]->paired_channel], frame_len*sizeof(real_t));
+ sbrDecodeFrame(hDecoder->sbr[i],
+ time_out2[syntax_elements[i]->channel],
+ time_out2[syntax_elements[i]->paired_channel], ID_CPE,
+ hDecoder->postSeekResetFlag);
+ } else {
+ memcpy(time_out2[syntax_elements[i]->channel],
+ time_out[syntax_elements[i]->channel], frame_len*sizeof(real_t));
+ sbrDecodeFrame(hDecoder->sbr[i],
+ time_out2[syntax_elements[i]->channel],
+ NULL, ID_SCE,
+ hDecoder->postSeekResetFlag);
+ }
+ }
+ frame_len *= 2;
+ hInfo->samples *= 2;
+ hInfo->samplerate *= 2;
+ sample_buffer = output_to_PCM(hDecoder, time_out2, sample_buffer,
+ output_channels, frame_len, outputFormat);
+ } else {
+#endif
+ sample_buffer = output_to_PCM(hDecoder, time_out, sample_buffer,
+ output_channels, frame_len, outputFormat);
+#ifdef SBR_DEC
+ }
+#endif
+
+ /* gapless playback */
+ if (hDecoder->samplesLeft != 0)
+ {
+ hInfo->samples = hDecoder->samplesLeft*channels;
+ }
+ hDecoder->samplesLeft = 0;
+
+ hDecoder->postSeekResetFlag = 0;
+
hDecoder->frame++;
#ifdef LD_DEC
if (object_type != LD)
@@ -929,6 +1045,32 @@
#endif
if (hDecoder->frame <= 1)
hInfo->samples = 0;
+
+#if 0
+ if (hDecoder->frame == 2 && hDecoder->sbr_present_flag == 1)
+ {
+ uint8_t samplesize;
+ switch (outputFormat)
+ {
+ case FAAD_FMT_16BIT: case FAAD_FMT_16BIT_DITHER:
+ case FAAD_FMT_16BIT_L_SHAPE: case FAAD_FMT_16BIT_M_SHAPE:
+ case FAAD_FMT_16BIT_H_SHAPE:
+ samplesize = 2;
+ break;
+ case FAAD_FMT_24BIT:
+ case FAAD_FMT_32BIT:
+ case FAAD_FMT_FLOAT:
+ samplesize = 4;
+ break;
+ case FAAD_FMT_DOUBLE:
+ samplesize = 8;
+ break;
+ }
+ hInfo->samples = 512*channels;
+ memmove(sample_buffer, (void*)((char*)sample_buffer + 1536*channels*samplesize), hInfo->samples*samplesize);
+ }
+#endif
+
#ifdef LD_DEC
} else {
/* LD encoders will give lower delay */
--- a/libfaad/decoder.h
+++ b/libfaad/decoder.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: decoder.h,v 1.25 2003/07/09 11:53:07 menno Exp $
+** 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: decoder.h,v 1.26 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __DECODER_H__
--- a/libfaad/drc.c
+++ b/libfaad/drc.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: drc.c,v 1.12 2002/11/28 18:48:30 menno Exp $
+** 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: drc.c,v 1.13 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
--- a/libfaad/drc.h
+++ b/libfaad/drc.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: drc.h,v 1.6 2002/11/28 18:48:30 menno Exp $
+** 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: drc.h,v 1.7 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __DRC_H__
--- a/libfaad/error.c
+++ b/libfaad/error.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: error.c,v 1.9 2003/04/13 18:27:09 menno Exp $
+** 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: error.c,v 1.10 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
--- a/libfaad/error.h
+++ b/libfaad/error.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: error.h,v 1.4 2003/04/27 18:53:22 menno Exp $
+** 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: error.h,v 1.5 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __ERROR_H__
--- a/libfaad/filtbank.c
+++ b/libfaad/filtbank.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: filtbank.c,v 1.24 2003/02/04 16:49:37 menno Exp $
+** 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: filtbank.c,v 1.25 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
--- a/libfaad/filtbank.h
+++ b/libfaad/filtbank.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: filtbank.h,v 1.10 2002/11/28 18:48:30 menno Exp $
+** 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: filtbank.h,v 1.11 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __FILTBANK_H__
--- a/libfaad/fixed.h
+++ b/libfaad/fixed.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: fixed.h,v 1.8 2003/06/19 21:20:59 menno Exp $
+** 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: fixed.h,v 1.9 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __FIXED_H__
--- a/libfaad/hcr.c
+++ b/libfaad/hcr.c
@@ -1,5 +1,5 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
** Copyright (C) 2002 A. Kurpiers
**
** This program is free software; you can redistribute it and/or modify
@@ -16,9 +16,16 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcr.c,v 1.4 2003/06/23 15:21:19 menno Exp $
+** 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: hcr.c,v 1.5 2003/07/29 08:20:12 menno Exp $
**/
+
#include "common.h"
#include "structs.h"
@@ -37,32 +44,6 @@
#ifdef ERROR_RESILIENCE
-//FIXME these tables are not needed twice actually
-
-static hcb *hcb_table[] = {
- 0, hcb1_1, hcb2_1, 0, hcb4_1, 0, hcb6_1, 0, hcb8_1, 0, hcb10_1, hcb11_1
-};
-
-static hcb_2_quad *hcb_2_quad_table[] = {
- 0, hcb1_2, hcb2_2, 0, hcb4_2, 0, 0, 0, 0, 0, 0, 0
-};
-
-static hcb_2_pair *hcb_2_pair_table[] = {
- 0, 0, 0, 0, 0, 0, hcb6_2, 0, hcb8_2, 0, hcb10_2, hcb11_2
-};
-
-static hcb_bin_pair *hcb_bin_table[] = {
- 0, 0, 0, 0, 0, hcb5, 0, hcb7, 0, hcb9, 0, 0
-};
-
-static uint8_t hcbN[] = { 0, 5, 5, 0, 5, 0, 5, 0, 5, 0, 6, 5 };
-
-
-/* defines whether a huffman codebook is unsigned or not */
-/* Table 4.6.2 */
-static uint8_t unsigned_cb[] = { 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0,
- /* codebook 16 to 31 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-};
typedef struct
{
/* bit input */
@@ -120,7 +101,7 @@
int8_t ret;
ret = getbits(ld, 1, &res);
- *result = res & 1;
+ *result = (int8_t)(res & 1);
return ret;
}
@@ -270,7 +251,7 @@
if (getbits(ld, i, &off))
return -1;
j = off + (1<<i);
- sp[k] = neg ? -j : j;
+ sp[k] = (int16_t)((neg) ? -j : j);
}
}
}
--- a/libfaad/huffman.h
+++ b/libfaad/huffman.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: huffman.h,v 1.12 2002/09/27 08:37:22 menno Exp $
+** 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: huffman.h,v 1.13 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __HUFFMAN_H__
@@ -55,33 +61,33 @@
}
-static hcb *hcb_table[] = {
+hcb *hcb_table[] = {
0, hcb1_1, hcb2_1, 0, hcb4_1, 0, hcb6_1, 0, hcb8_1, 0, hcb10_1, hcb11_1
};
-static hcb_2_quad *hcb_2_quad_table[] = {
+hcb_2_quad *hcb_2_quad_table[] = {
0, hcb1_2, hcb2_2, 0, hcb4_2, 0, 0, 0, 0, 0, 0, 0
};
-static hcb_2_pair *hcb_2_pair_table[] = {
+hcb_2_pair *hcb_2_pair_table[] = {
0, 0, 0, 0, 0, 0, hcb6_2, 0, hcb8_2, 0, hcb10_2, hcb11_2
};
-static hcb_bin_pair *hcb_bin_table[] = {
+hcb_bin_pair *hcb_bin_table[] = {
0, 0, 0, 0, 0, hcb5, 0, hcb7, 0, hcb9, 0, 0
};
-static uint8_t hcbN[] = { 0, 5, 5, 0, 5, 0, 5, 0, 5, 0, 6, 5 };
+uint8_t hcbN[] = { 0, 5, 5, 0, 5, 0, 5, 0, 5, 0, 6, 5 };
/* defines whether a huffman codebook is unsigned or not */
/* Table 4.6.2 */
-static uint8_t unsigned_cb[] = { 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0,
+uint8_t unsigned_cb[] = { 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0,
/* codebook 16 to 31 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
-static int hcb_2_quad_table_size[] = { 0, 114, 86, 0, 185, 0, 0, 0, 0, 0, 0, 0 };
-static int hcb_2_pair_table_size[] = { 0, 0, 0, 0, 0, 0, 126, 0, 83, 0, 210, 373 };
-static int hcb_bin_table_size[] = { 0, 0, 0, 161, 0, 161, 0, 127, 0, 337, 0, 0 };
+int hcb_2_quad_table_size[] = { 0, 114, 86, 0, 185, 0, 0, 0, 0, 0, 0, 0 };
+int hcb_2_pair_table_size[] = { 0, 0, 0, 0, 0, 0, 126, 0, 83, 0, 210, 373 };
+int hcb_bin_table_size[] = { 0, 0, 0, 161, 0, 161, 0, 127, 0, 337, 0, 0 };
static INLINE void huffman_sign_bits(bitfile *ld, int16_t *sp, uint8_t len)
{
@@ -285,6 +291,13 @@
return err;
}
+static int16_t huffman_codebook(uint8_t i)
+{
+ static const uint32_t data = 16428320;
+ if (i == 0) return (int16_t)(data >> 16) & 0xFFFF;
+ else return (int16_t)data & 0xFFFF;
+}
+
static INLINE uint8_t huffman_spectral_data(uint8_t cb, bitfile *ld, int16_t *sp)
{
switch (cb)
@@ -306,6 +319,10 @@
case 8: /* 2-step method for data pairs */
case 10:
return huffman_2step_pair_sign(cb, ld, sp);
+ case 12: {
+ uint8_t err = huffman_2step_quad(1, ld, sp);
+ sp[0] = huffman_codebook(0); sp[1] = huffman_codebook(1);
+ return err; }
case 11:
#ifdef ERROR_RESILIENCE
/* VCB11 uses codebook 11 */
--- a/libfaad/ic_predict.c
+++ b/libfaad/ic_predict.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ic_predict.c,v 1.11 2003/06/23 15:21:19 menno Exp $
+** 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: ic_predict.c,v 1.12 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
--- a/libfaad/ic_predict.h
+++ b/libfaad/ic_predict.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ic_predict.h,v 1.6 2002/11/28 18:48:30 menno Exp $
+** 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: ic_predict.h,v 1.7 2003/07/29 08:20:12 menno Exp $
**/
#ifdef MAIN_DEC
--- a/libfaad/iq_table.h
+++ b/libfaad/iq_table.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: iq_table.h,v 1.3 2003/05/16 08:31:14 menno Exp $
+** 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: iq_table.h,v 1.4 2003/07/29 08:20:12 menno Exp $
**/
#ifndef IQ_TABLE_H__
--- a/libfaad/is.c
+++ b/libfaad/is.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: is.c,v 1.10 2002/11/28 18:48:30 menno Exp $
+** 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: is.c,v 1.11 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
--- a/libfaad/is.h
+++ b/libfaad/is.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: is.h,v 1.4 2002/06/13 11:03:27 menno Exp $
+** 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: is.h,v 1.5 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __IS_H__
--- a/libfaad/kbd_win.h
+++ b/libfaad/kbd_win.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: kbd_win.h,v 1.4 2002/09/08 18:14:37 menno Exp $
+** 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: kbd_win.h,v 1.5 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __KBD_WIN_H__
--- a/libfaad/libfaad.dsp
+++ b/libfaad/libfaad.dsp
@@ -163,6 +163,46 @@
# End Source File
# Begin Source File
+SOURCE=.\sbr_dct.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_dec.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_e_nf.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_fbt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_hfadj.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_hfgen.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_huff.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_qmf.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_syntax.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_tf_grid.c
+# End Source File
+# Begin Source File
+
SOURCE=.\specrec.c
# End Source File
# Begin Source File
@@ -263,10 +303,6 @@
# End Source File
# Begin Source File
-SOURCE=.\fftw\config.h
-# End Source File
-# Begin Source File
-
SOURCE=.\decoder.h
# End Source File
# Begin Source File
@@ -344,6 +380,50 @@
# Begin Source File
SOURCE=.\rvlc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_dct.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_dec.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_e_nf.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_fbt.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_hfadj.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_hfgen.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_huff.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_noise.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_qmf.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_syntax.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sbr_tf_grid.h
# End Source File
# Begin Source File
--- a/libfaad/lt_predict.c
+++ b/libfaad/lt_predict.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,9 +16,14 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: lt_predict.c,v 1.10 2002/11/28 18:48:30 menno Exp $
+** 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: lt_predict.c,v 1.11 2003/07/29 08:20:12 menno Exp $
**/
-
#include "common.h"
#include "structs.h"
--- a/libfaad/lt_predict.h
+++ b/libfaad/lt_predict.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: lt_predict.h,v 1.4 2002/03/16 13:38:37 menno Exp $
+** 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: lt_predict.h,v 1.5 2003/07/29 08:20:12 menno Exp $
**/
#ifdef LTP_DEC
--- a/libfaad/mdct.c
+++ b/libfaad/mdct.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: mdct.c,v 1.25 2003/05/15 20:58:46 menno Exp $
+** 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: mdct.c,v 1.26 2003/07/29 08:20:12 menno Exp $
**/
/*
--- a/libfaad/mdct.h
+++ b/libfaad/mdct.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: mdct.h,v 1.13 2002/11/28 18:48:30 menno Exp $
+** 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: mdct.h,v 1.14 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __MDCT_H__
--- a/libfaad/mp4.c
+++ b/libfaad/mp4.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: mp4.c,v 1.16 2003/07/09 11:53:07 menno Exp $
+** 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: mp4.c,v 1.17 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
@@ -47,7 +53,11 @@
#else
0, /* 4 AAC LTP */
#endif
- 0, /* 5 Reserved */
+#ifdef SBR_DEC
+ 1, /* 5 SBR */
+#else
+ 0, /* 5 SBR */
+#endif
0, /* 6 AAC Scalable */
0, /* 7 TwinVQ */
0, /* 8 CELP */
@@ -115,6 +125,9 @@
{
bitfile ld;
int8_t result = 0;
+#ifdef SBR_DEC
+ int8_t bits_to_decode = 0;
+#endif
if (pBuffer == NULL)
return -7;
@@ -155,6 +168,25 @@
return -3;
}
+#ifdef SBR_DEC
+ mp4ASC->sbr_present_flag = -1;
+ if (mp4ASC->objectTypeIndex == 5)
+ {
+ mp4ASC->sbr_present_flag = 1;
+ mp4ASC->samplingFrequencyIndex = (uint8_t)faad_getbits(&ld, 4
+ DEBUGVAR(1,5,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
+ if (mp4ASC->samplingFrequencyIndex == 15)
+ {
+ mp4ASC->samplingFrequency = (uint32_t)faad_getbits(&ld, 24
+ DEBUGVAR(1,6,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
+ } else {
+ mp4ASC->samplingFrequency = sample_rates[mp4ASC->samplingFrequencyIndex];
+ }
+ mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(&ld, 5
+ DEBUGVAR(1,7,"parse_audio_decoder_specific_info(): ObjectTypeIndex"));
+ }
+#endif
+
/* get GASpecificConfig */
if (mp4ASC->objectTypeIndex == 1 || mp4ASC->objectTypeIndex == 2 ||
mp4ASC->objectTypeIndex == 3 || mp4ASC->objectTypeIndex == 4 ||
@@ -180,6 +212,42 @@
/* shorter frames not allowed for SSR */
if ((mp4ASC->objectTypeIndex == 4) && mp4ASC->frameLengthFlag)
return -6;
+#endif
+
+
+#ifdef SBR_DEC
+ bits_to_decode = buffer_size*8 - faad_get_processed_bits(&ld);
+
+ if ((mp4ASC->objectTypeIndex != 5) && (bits_to_decode >= 16))
+ {
+ int16_t syncExtensionType = (int16_t)faad_getbits(&ld, 11
+ DEBUGVAR(1,9,"parse_audio_decoder_specific_info(): syncExtensionType"));
+
+ if (syncExtensionType == 0x2b7)
+ {
+ mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(&ld, 5
+ DEBUGVAR(1,10,"parse_audio_decoder_specific_info(): extensionAudioObjectType"));
+
+ if (mp4ASC->objectTypeIndex == 5)
+ {
+ mp4ASC->sbr_present_flag = (uint8_t)faad_get1bit(&ld
+ DEBUGVAR(1,11,"parse_audio_decoder_specific_info(): sbr_present_flag"));
+
+ if (mp4ASC->sbr_present_flag)
+ {
+ mp4ASC->samplingFrequencyIndex = (uint8_t)faad_getbits(&ld, 4
+ DEBUGVAR(1,12,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
+ if (mp4ASC->samplingFrequencyIndex == 15)
+ {
+ mp4ASC->samplingFrequency = (uint32_t)faad_getbits(&ld, 24
+ DEBUGVAR(1,13,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
+ } else {
+ mp4ASC->samplingFrequency = sample_rates[mp4ASC->samplingFrequencyIndex];
+ }
+ }
+ }
+ }
+ }
#endif
faad_endbits(&ld);
--- a/libfaad/mp4.h
+++ b/libfaad/mp4.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: mp4.h,v 1.8 2003/07/09 11:53:07 menno Exp $
+** 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: mp4.h,v 1.9 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __MP4_H__
--- a/libfaad/ms.c
+++ b/libfaad/ms.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ms.c,v 1.4 2002/11/28 18:48:30 menno Exp $
+** 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: ms.c,v 1.5 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
--- a/libfaad/ms.h
+++ b/libfaad/ms.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ms.h,v 1.3 2002/06/13 11:03:27 menno Exp $
+** 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: ms.h,v 1.4 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __MS_H__
--- a/libfaad/output.c
+++ b/libfaad/output.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: output.c,v 1.19 2003/07/09 13:55:59 menno Exp $
+** 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.20 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
--- a/libfaad/output.h
+++ b/libfaad/output.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: output.h,v 1.7 2003/07/08 13:45:45 menno Exp $
+** 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.h,v 1.8 2003/07/29 08:20:12 menno Exp $
**/
#ifndef __OUTPUT_H__
--- a/libfaad/pns.c
+++ b/libfaad/pns.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: pns.c,v 1.20 2002/12/22 19:58:31 menno Exp $
+** 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: pns.c,v 1.21 2003/07/29 08:20:12 menno Exp $
**/
#include "common.h"
--- a/libfaad/pns.h
+++ b/libfaad/pns.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: pns.h,v 1.10 2002/09/27 08:37:22 menno Exp $
+** 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: pns.h,v 1.11 2003/07/29 08:20:13 menno Exp $
**/
#ifndef __PNS_H__
--- a/libfaad/pulse.c
+++ b/libfaad/pulse.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: pulse.c,v 1.5 2003/04/13 18:27:09 menno Exp $
+** 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: pulse.c,v 1.6 2003/07/29 08:20:13 menno Exp $
**/
#include "common.h"
--- a/libfaad/pulse.h
+++ b/libfaad/pulse.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: pulse.h,v 1.4 2003/04/13 18:27:09 menno Exp $
+** 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: pulse.h,v 1.5 2003/07/29 08:20:13 menno Exp $
**/
#ifndef __PULSE_H__
--- a/libfaad/rvlc.c
+++ b/libfaad/rvlc.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: rvlc.c,v 1.4 2003/04/02 18:31:08 menno Exp $
+** 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: rvlc.c,v 1.5 2003/07/29 08:20:13 menno Exp $
**/
/* RVLC scalefactor decoding
@@ -198,8 +204,6 @@
ics->scale_factors[g][sfb] = noise_energy;
break;
- case BOOKSCL: /* invalid books */
- return 3;
default: /* spectral books */
/* decode scale factor */
@@ -298,8 +302,6 @@
ics->scale_factors[g][sfb] = noise_energy;
break;
- case BOOKSCL: /* invalid books */
- return 3;
default: /* spectral books */
if (sf_pcm_flag || (sfb == 0))
--- a/libfaad/rvlc.h
+++ b/libfaad/rvlc.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: rvlc.h,v 1.1 2002/11/28 18:48:30 menno Exp $
+** 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: rvlc.h,v 1.2 2003/07/29 08:20:13 menno Exp $
**/
#ifndef __RVLC_SCF_H__
--- /dev/null
+++ b/libfaad/sbr_dct.c
@@ -1,0 +1,4274 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_dct.c,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+#include "common.h"
+
+#ifdef SBR_DEC
+
+#ifdef _MSC_VER
+#pragma warning(disable:4305)
+#pragma warning(disable:4244)
+#endif
+
+#define MUL_C_R(B,A) MUL_R_C(A,B)
+
+#include "sbr_dct.h"
+
+#ifdef SBR_LOW_POWER
+
+void DCT3_32_unscaled(real_t *y, real_t *x)
+{
+ real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
+ real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
+ real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
+ real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
+ real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
+ real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
+ real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
+ real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
+ real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
+ real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
+ real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
+ real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
+ real_t f121, f122, f123, f124, f125, f126, f127, f128, f129, f130;
+ real_t f131, f132, f133, f134, f135, f136, f137, f138, f139, f140;
+ real_t f141, f142, f143, f144, f145, f146, f147, f148, f149, f150;
+ real_t f151, f152, f153, f154, f155, f156, f157, f158, f159, f160;
+ real_t f161, f162, f163, f164, f165, f166, f167, f168, f169, f170;
+ real_t f171, f172, f173, f174, f175, f176, f177, f178, f179, f180;
+ real_t f181, f182, f183, f184, f185, f186, f187, f188, f189, f190;
+ real_t f191, f192, f193, f194, f195, f196, f197, f198, f199, f200;
+ real_t f201, f202, f203, f204, f205, f206, f207, f208, f209, f210;
+ real_t f211, f212, f213, f214, f215, f216, f217, f218, f219, f220;
+ real_t f221, f222, f223, f224, f225, f226, f227, f228, f229, f230;
+ real_t f231, f232, f233, f234, f235, f236, f237, f238, f239, f240;
+ real_t f241, f242, f243, f244, f245, f246, f247, f248, f249, f250;
+ real_t f251, f252, f253, f254, f255, f256, f257, f258, f259, f260;
+ real_t f261, f262, f263, f264, f265, f266, f267, f268, f269, f270;
+ real_t f271, f272;
+
+ f0 = MUL_C_R(COEF_CONST(0.7071067811865476), x[16]);
+ f1 = x[0] - f0;
+ f2 = x[0] + f0;
+ f3 = x[8] + x[24];
+ f4 = MUL_C_R(COEF_CONST(1.3065629648763766), x[8]);
+ f5 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f3);
+ f6 = MUL_C_R(COEF_CONST((-0.5411961001461967)), x[24]);
+ f7 = f4 + f5;
+ f8 = f6 - f5;
+ f9 = f2 - f8;
+ f10 = f2 + f8;
+ f11 = f1 - f7;
+ f12 = f1 + f7;
+ f13 = x[4] + x[28];
+ f14 = MUL_C_R(COEF_CONST(1.1758756024193588), x[4]);
+ f15 = MUL_C_R(COEF_CONST((-0.9807852804032304)), f13);
+ f16 = MUL_C_R(COEF_CONST((-0.7856949583871021)), x[28]);
+ f17 = f14 + f15;
+ f18 = f16 - f15;
+ f19 = x[12] + x[20];
+ f20 = MUL_C_R(COEF_CONST(1.3870398453221473), x[12]);
+ f21 = MUL_C_R(COEF_CONST((-0.8314696123025455)), f19);
+ f22 = MUL_C_R(COEF_CONST((-0.2758993792829436)), x[20]);
+ f23 = f20 + f21;
+ f24 = f22 - f21;
+ f25 = f18 - f24;
+ f26 = f18 + f24;
+ f27 = MUL_C_R(COEF_CONST(0.7071067811865476), f25);
+ f28 = f17 - f23;
+ f29 = f17 + f23;
+ f30 = MUL_C_R(COEF_CONST(0.7071067811865476), f29);
+ f31 = f27 - f30;
+ f32 = f27 + f30;
+ f33 = f10 - f26;
+ f34 = f10 + f26;
+ f35 = f12 - f32;
+ f36 = f12 + f32;
+ f37 = f11 - f31;
+ f38 = f11 + f31;
+ f39 = f9 - f28;
+ f40 = f9 + f28;
+ f41 = x[2] + x[30];
+ f42 = MUL_C_R(COEF_CONST(1.0932018670017569), x[2]);
+ f43 = MUL_C_R(COEF_CONST((-0.9951847266721969)), f41);
+ f44 = MUL_C_R(COEF_CONST((-0.8971675863426368)), x[30]);
+ f45 = f42 + f43;
+ f46 = f44 - f43;
+ f47 = x[6] + x[26];
+ f48 = MUL_C_R(COEF_CONST(1.2472250129866711), x[6]);
+ f49 = MUL_C_R(COEF_CONST((-0.9569403357322089)), f47);
+ f50 = MUL_C_R(COEF_CONST((-0.6666556584777469)), x[26]);
+ f51 = f48 + f49;
+ f52 = f50 - f49;
+ f53 = x[10] + x[22];
+ f54 = MUL_C_R(COEF_CONST(1.3533180011743526), x[10]);
+ f55 = MUL_C_R(COEF_CONST((-0.8819212643483551)), f53);
+ f56 = MUL_C_R(COEF_CONST((-0.4105245275223575)), x[22]);
+ f57 = f54 + f55;
+ f58 = f56 - f55;
+ f59 = x[14] + x[18];
+ f60 = MUL_C_R(COEF_CONST(1.4074037375263826), x[14]);
+ f61 = MUL_C_R(COEF_CONST((-0.7730104533627369)), f59);
+ f62 = MUL_C_R(COEF_CONST((-0.1386171691990913)), x[18]);
+ f63 = f60 + f61;
+ f64 = f62 - f61;
+ f65 = f46 - f64;
+ f66 = f46 + f64;
+ f67 = f52 - f58;
+ f68 = f52 + f58;
+ f69 = f66 - f68;
+ f70 = f66 + f68;
+ f71 = MUL_C_R(COEF_CONST(0.7071067811865476), f69);
+ f72 = f65 + f67;
+ f73 = MUL_C_R(COEF_CONST(1.3065629648763766), f65);
+ f74 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f72);
+ f75 = MUL_C_R(COEF_CONST((-0.5411961001461967)), f67);
+ f76 = f73 + f74;
+ f77 = f75 - f74;
+ f78 = f45 - f63;
+ f79 = f45 + f63;
+ f80 = f51 - f57;
+ f81 = f51 + f57;
+ f82 = f79 + f81;
+ f83 = MUL_C_R(COEF_CONST(1.3065629648763770), f79);
+ f84 = MUL_C_R(COEF_CONST((-0.3826834323650904)), f82);
+ f85 = MUL_C_R(COEF_CONST(0.5411961001461961), f81);
+ f86 = f83 + f84;
+ f87 = f85 - f84;
+ f88 = f78 - f80;
+ f89 = f78 + f80;
+ f90 = MUL_C_R(COEF_CONST(0.7071067811865476), f89);
+ f91 = f77 - f87;
+ f92 = f77 + f87;
+ f93 = f71 - f90;
+ f94 = f71 + f90;
+ f95 = f76 - f86;
+ f96 = f76 + f86;
+ f97 = f34 - f70;
+ f98 = f34 + f70;
+ f99 = f36 - f92;
+ f100 = f36 + f92;
+ f101 = f38 - f91;
+ f102 = f38 + f91;
+ f103 = f40 - f94;
+ f104 = f40 + f94;
+ f105 = f39 - f93;
+ f106 = f39 + f93;
+ f107 = f37 - f96;
+ f108 = f37 + f96;
+ f109 = f35 - f95;
+ f110 = f35 + f95;
+ f111 = f33 - f88;
+ f112 = f33 + f88;
+ f113 = x[1] + x[31];
+ f114 = MUL_C_R(COEF_CONST(1.0478631305325901), x[1]);
+ f115 = MUL_C_R(COEF_CONST((-0.9987954562051724)), f113);
+ f116 = MUL_C_R(COEF_CONST((-0.9497277818777548)), x[31]);
+ f117 = f114 + f115;
+ f118 = f116 - f115;
+ f119 = x[5] + x[27];
+ f120 = MUL_C_R(COEF_CONST(1.2130114330978077), x[5]);
+ f121 = MUL_C_R(COEF_CONST((-0.9700312531945440)), f119);
+ f122 = MUL_C_R(COEF_CONST((-0.7270510732912803)), x[27]);
+ f123 = f120 + f121;
+ f124 = f122 - f121;
+ f125 = x[9] + x[23];
+ f126 = MUL_C_R(COEF_CONST(1.3315443865537255), x[9]);
+ f127 = MUL_C_R(COEF_CONST((-0.9039892931234433)), f125);
+ f128 = MUL_C_R(COEF_CONST((-0.4764341996931612)), x[23]);
+ f129 = f126 + f127;
+ f130 = f128 - f127;
+ f131 = x[13] + x[19];
+ f132 = MUL_C_R(COEF_CONST(1.3989068359730781), x[13]);
+ f133 = MUL_C_R(COEF_CONST((-0.8032075314806453)), f131);
+ f134 = MUL_C_R(COEF_CONST((-0.2075082269882124)), x[19]);
+ f135 = f132 + f133;
+ f136 = f134 - f133;
+ f137 = x[17] + x[15];
+ f138 = MUL_C_R(COEF_CONST(1.4125100802019777), x[17]);
+ f139 = MUL_C_R(COEF_CONST((-0.6715589548470187)), f137);
+ f140 = MUL_C_R(COEF_CONST(0.0693921705079402), x[15]);
+ f141 = f138 + f139;
+ f142 = f140 - f139;
+ f143 = x[21] + x[11];
+ f144 = MUL_C_R(COEF_CONST(1.3718313541934939), x[21]);
+ f145 = MUL_C_R(COEF_CONST((-0.5141027441932219)), f143);
+ f146 = MUL_C_R(COEF_CONST(0.3436258658070501), x[11]);
+ f147 = f144 + f145;
+ f148 = f146 - f145;
+ f149 = x[25] + x[7];
+ f150 = MUL_C_R(COEF_CONST(1.2784339185752409), x[25]);
+ f151 = MUL_C_R(COEF_CONST((-0.3368898533922200)), f149);
+ f152 = MUL_C_R(COEF_CONST(0.6046542117908008), x[7]);
+ f153 = f150 + f151;
+ f154 = f152 - f151;
+ f155 = x[29] + x[3];
+ f156 = MUL_C_R(COEF_CONST(1.1359069844201433), x[29]);
+ f157 = MUL_C_R(COEF_CONST((-0.1467304744553624)), f155);
+ f158 = MUL_C_R(COEF_CONST(0.8424460355094185), x[3]);
+ f159 = f156 + f157;
+ f160 = f158 - f157;
+ f161 = f118 - f142;
+ f162 = f118 + f142;
+ f163 = f117 - f141;
+ f164 = f117 + f141;
+ f165 = f124 - f148;
+ f166 = f124 + f148;
+ f167 = f123 - f147;
+ f168 = f123 + f147;
+ f169 = f130 - f154;
+ f170 = f130 + f154;
+ f171 = f129 - f153;
+ f172 = f129 + f153;
+ f173 = f136 - f160;
+ f174 = f136 + f160;
+ f175 = f135 - f159;
+ f176 = f135 + f159;
+ f177 = f161 + f163;
+ f178 = MUL_C_R(COEF_CONST(1.1758756024193588), f161);
+ f179 = MUL_C_R(COEF_CONST((-0.9807852804032304)), f177);
+ f180 = MUL_C_R(COEF_CONST((-0.7856949583871021)), f163);
+ f181 = f178 + f179;
+ f182 = f180 - f179;
+ f183 = f165 + f167;
+ f184 = MUL_C_R(COEF_CONST(1.3870398453221475), f165);
+ f185 = MUL_C_R(COEF_CONST((-0.5555702330196022)), f183);
+ f186 = MUL_C_R(COEF_CONST(0.2758993792829431), f167);
+ f187 = f184 + f185;
+ f188 = f186 - f185;
+ f189 = f169 + f171;
+ f190 = MUL_C_R(COEF_CONST(0.7856949583871022), f169);
+ f191 = MUL_C_R(COEF_CONST(0.1950903220161283), f189);
+ f192 = MUL_C_R(COEF_CONST(1.1758756024193586), f171);
+ f193 = f190 + f191;
+ f194 = f192 - f191;
+ f195 = f173 + f175;
+ f196 = MUL_C_R(COEF_CONST((-0.2758993792829430)), f173);
+ f197 = MUL_C_R(COEF_CONST(0.8314696123025452), f195);
+ f198 = MUL_C_R(COEF_CONST(1.3870398453221475), f175);
+ f199 = f196 + f197;
+ f200 = f198 - f197;
+ f201 = f162 - f170;
+ f202 = f162 + f170;
+ f203 = f164 - f172;
+ f204 = f164 + f172;
+ f205 = f166 - f174;
+ f206 = f166 + f174;
+ f207 = f168 - f176;
+ f208 = f168 + f176;
+ f209 = f182 - f194;
+ f210 = f182 + f194;
+ f211 = f181 - f193;
+ f212 = f181 + f193;
+ f213 = f188 - f200;
+ f214 = f188 + f200;
+ f215 = f187 - f199;
+ f216 = f187 + f199;
+ f217 = f201 + f203;
+ f218 = MUL_C_R(COEF_CONST(1.3065629648763766), f201);
+ f219 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f217);
+ f220 = MUL_C_R(COEF_CONST((-0.5411961001461967)), f203);
+ f221 = f218 + f219;
+ f222 = f220 - f219;
+ f223 = f205 + f207;
+ f224 = MUL_C_R(COEF_CONST(0.5411961001461969), f205);
+ f225 = MUL_C_R(COEF_CONST(0.3826834323650898), f223);
+ f226 = MUL_C_R(COEF_CONST(1.3065629648763766), f207);
+ f227 = f224 + f225;
+ f228 = f226 - f225;
+ f229 = f209 + f211;
+ f230 = MUL_C_R(COEF_CONST(1.3065629648763766), f209);
+ f231 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f229);
+ f232 = MUL_C_R(COEF_CONST((-0.5411961001461967)), f211);
+ f233 = f230 + f231;
+ f234 = f232 - f231;
+ f235 = f213 + f215;
+ f236 = MUL_C_R(COEF_CONST(0.5411961001461969), f213);
+ f237 = MUL_C_R(COEF_CONST(0.3826834323650898), f235);
+ f238 = MUL_C_R(COEF_CONST(1.3065629648763766), f215);
+ f239 = f236 + f237;
+ f240 = f238 - f237;
+ f241 = f202 - f206;
+ f242 = f202 + f206;
+ f243 = f204 - f208;
+ f244 = f204 + f208;
+ f245 = f222 - f228;
+ f246 = f222 + f228;
+ f247 = f221 - f227;
+ f248 = f221 + f227;
+ f249 = f210 - f214;
+ f250 = f210 + f214;
+ f251 = f212 - f216;
+ f252 = f212 + f216;
+ f253 = f234 - f240;
+ f254 = f234 + f240;
+ f255 = f233 - f239;
+ f256 = f233 + f239;
+ f257 = f241 - f243;
+ f258 = f241 + f243;
+ f259 = MUL_C_R(COEF_CONST(0.7071067811865474), f257);
+ f260 = MUL_C_R(COEF_CONST(0.7071067811865474), f258);
+ f261 = f245 - f247;
+ f262 = f245 + f247;
+ f263 = MUL_C_R(COEF_CONST(0.7071067811865474), f261);
+ f264 = MUL_C_R(COEF_CONST(0.7071067811865474), f262);
+ f265 = f249 - f251;
+ f266 = f249 + f251;
+ f267 = MUL_C_R(COEF_CONST(0.7071067811865474), f265);
+ f268 = MUL_C_R(COEF_CONST(0.7071067811865474), f266);
+ f269 = f253 - f255;
+ f270 = f253 + f255;
+ f271 = MUL_C_R(COEF_CONST(0.7071067811865474), f269);
+ f272 = MUL_C_R(COEF_CONST(0.7071067811865474), f270);
+ y[31] = f98 - f242;
+ y[0] = f98 + f242;
+ y[30] = f100 - f250;
+ y[1] = f100 + f250;
+ y[29] = f102 - f254;
+ y[2] = f102 + f254;
+ y[28] = f104 - f246;
+ y[3] = f104 + f246;
+ y[27] = f106 - f264;
+ y[4] = f106 + f264;
+ y[26] = f108 - f272;
+ y[5] = f108 + f272;
+ y[25] = f110 - f268;
+ y[6] = f110 + f268;
+ y[24] = f112 - f260;
+ y[7] = f112 + f260;
+ y[23] = f111 - f259;
+ y[8] = f111 + f259;
+ y[22] = f109 - f267;
+ y[9] = f109 + f267;
+ y[21] = f107 - f271;
+ y[10] = f107 + f271;
+ y[20] = f105 - f263;
+ y[11] = f105 + f263;
+ y[19] = f103 - f248;
+ y[12] = f103 + f248;
+ y[18] = f101 - f256;
+ y[13] = f101 + f256;
+ y[17] = f99 - f252;
+ y[14] = f99 + f252;
+ y[16] = f97 - f244;
+ y[15] = f97 + f244;
+}
+
+void DCT2_64_unscaled(real_t *y, real_t *x)
+{
+ int16_t i0;
+ real_t f2, f3, f4, f5, f6, f7, f8, f9, f10;
+ real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
+ real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
+ real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
+ real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
+ real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
+ real_t f61, f62, f65, f66, f67, f68, f71, f72, f73, f74;
+ real_t f75, f76, f77, f78, f79, f80, f81, f82, f85, f86;
+ real_t f87, f88, f91, f92, f93, f94, f95, f96, f97, f98;
+ real_t f99, f100, f101, f102, f103, f104, f105, f106, f107, f108;
+ real_t f109, f110, f111, f112, f113, f114, f115, f116, f117, f118;
+ real_t f119, f120, f121, f122, f123, f124, f125, f126, f127, f128;
+ real_t f129, f130, f133, f134, f135, f136, f139, f140, f141, f142;
+ real_t f145, f146, f147, f148, f151, f152, f153, f154, f155, f156;
+ real_t f157, f158, f159, f160, f161, f162, f163, f164, f165, f166;
+ real_t f167, f168, f169, f170, f171, f172, f173, f174, f175, f176;
+ real_t f177, f178, f179, f180, f181, f182, f183, f184, f185, f186;
+ real_t f187, f188, f189, f190, f191, f192, f193, f194, f195, f196;
+ real_t f197, f198, f199, f200, f201, f202, f203, f204, f205, f206;
+ real_t f207, f208, f209, f210, f211, f213, f214, f215, f216, f217;
+ real_t f218, f219, f220, f221, f222, f223, f224, f225, f226, f227;
+ real_t f228, f229, f230, f231, f232, f233, f234, f235, f236, f237;
+ real_t f238, f239, f240, f241, f242, f243, f244, f245, f246, f247;
+ real_t f248, f249, f250, f251, f252, f253, f254, f255, f256, f257;
+ real_t f258, f259, f260, f261, f262, f263, f264, f265, f266, f267;
+ real_t f268, f269, f270, f271, f272, f273, f274, f275, f276, f277;
+ real_t f279, f280, f295, f296, f297, f298, f299, f300, f301, f302;
+ real_t f303, f304, f305, f306, f307, f308, f309, f310, f311, f312;
+ real_t f313, f314, f315, f316, f317, f318, f319, f320, f321, f322;
+ real_t f323, f324, f325, f326, f327, f328, f329, f330, f331, f332;
+ real_t f333, f334, f335, f336, f337, f338, f339, f340, f341, f342;
+ real_t f343, f344, f345, f346, f347, f348, f349, f350, f351, f352;
+ real_t f353, f354, f355, f356, f357, f358, f359, f360, f361, f362;
+ real_t f363, f364, f365, f366, f367, f368, f369, f370, f371, f372;
+ real_t f373, f374, f375, f376, f377, f378, f379, f380, f381, f382;
+ real_t f383, f384, f385, f386, f387, f388, f389, f390, f391, f392;
+ real_t f393, f394, f395, f396, f397, f398, f399, f400, f401, f402;
+ real_t f403, f404, f405, f406, f407, f408, f409, f410, f411, f412;
+ real_t f413, f414, f415, f416, f417, f418, f419, f420, f421, f422;
+ real_t f423, f424, f425, f426, f427, f428, f429, f430, f431, f432;
+ real_t f433, f434, f435, f436, f437, f438, f439, f440, f441, f442;
+ real_t f443, f444, f445, f446, f447, f448, f449, f450, f451, f452;
+ real_t f453, f454, f455, f456, f457, f458, f459, f460, f461, f462;
+ real_t f463, f464, f465, f466, f467, f468, f469, f470, f471, f472;
+ real_t f473, f474, f475, f476, f477, f478, f479, f480, f481, f482;
+ real_t f483, f484, f485, f486, f487, f488, f489, f490, f491, f492;
+ real_t f493, f494, f495, f496, f497, f498, f499, f500, f501, f502;
+ real_t f503, f504, f505, f506, f507, f508, f509, f510, f511, f512;
+ real_t f513, f514, f515, f516, f517, f518, f519, f520, f521, f522;
+ real_t f523, f524, f525, f526, f527, f528, f529, f530, f531, f532;
+ real_t f533, f534, f535, f536, f537, f538, f539, f540, f541, f542;
+ real_t f543, f544, f545, f546, f547, f548, f549, f550, f551, f552;
+ real_t f553, f554, f557, f558, f559, f560, f563, f564, f565, f566;
+ real_t f569, f570, f571, f572, f575, f576, f577, f578, f581, f582;
+ real_t f583, f584, f587, f588, f589, f590, f593, f594, f595, f596;
+ real_t f599, f600, f601, f602, f605, f606, f607, f608, f611, f612;
+ real_t f613, f614, f617, f618, f619, f620, f623, f624, f625, f626;
+ real_t f629, f630, f631, f632, f635, f636, f637, f638, f641, f642;
+ real_t f643, f644;
+ static real_t t2[64];
+
+ for (i0=0; i0<32; i0++)
+ {
+ t2[2*i0+1] = x[i0] - x[-i0+63];
+ t2[2*i0] = x[i0] + x[-i0+63];
+ }
+ f2 = t2[0] - t2[62];
+ f3 = t2[0] + t2[62];
+ f4 = t2[2] - t2[60];
+ f5 = t2[2] + t2[60];
+ f6 = t2[4] - t2[58];
+ f7 = t2[4] + t2[58];
+ f8 = t2[6] - t2[56];
+ f9 = t2[6] + t2[56];
+ f10 = t2[8] - t2[54];
+ f11 = t2[8] + t2[54];
+ f12 = t2[10] - t2[52];
+ f13 = t2[10] + t2[52];
+ f14 = t2[12] - t2[50];
+ f15 = t2[12] + t2[50];
+ f16 = t2[14] - t2[48];
+ f17 = t2[14] + t2[48];
+ f18 = t2[16] - t2[46];
+ f19 = t2[16] + t2[46];
+ f20 = t2[18] - t2[44];
+ f21 = t2[18] + t2[44];
+ f22 = t2[20] - t2[42];
+ f23 = t2[20] + t2[42];
+ f24 = t2[22] - t2[40];
+ f25 = t2[22] + t2[40];
+ f26 = t2[24] - t2[38];
+ f27 = t2[24] + t2[38];
+ f28 = t2[26] - t2[36];
+ f29 = t2[26] + t2[36];
+ f30 = t2[28] - t2[34];
+ f31 = t2[28] + t2[34];
+ f32 = t2[30] - t2[32];
+ f33 = t2[30] + t2[32];
+ f34 = f3 - f33;
+ f35 = f3 + f33;
+ f36 = f5 - f31;
+ f37 = f5 + f31;
+ f38 = f7 - f29;
+ f39 = f7 + f29;
+ f40 = f9 - f27;
+ f41 = f9 + f27;
+ f42 = f11 - f25;
+ f43 = f11 + f25;
+ f44 = f13 - f23;
+ f45 = f13 + f23;
+ f46 = f15 - f21;
+ f47 = f15 + f21;
+ f48 = f17 - f19;
+ f49 = f17 + f19;
+ f50 = f35 - f49;
+ f51 = f35 + f49;
+ f52 = f37 - f47;
+ f53 = f37 + f47;
+ f54 = f39 - f45;
+ f55 = f39 + f45;
+ f56 = f41 - f43;
+ f57 = f41 + f43;
+ f58 = f51 - f57;
+ f59 = f51 + f57;
+ f60 = f53 - f55;
+ f61 = f53 + f55;
+ f62 = f59 - f61;
+ y[0] = f59 + f61;
+ y[32] = MUL_C_R(COEF_CONST(0.7071067811865476), f62);
+ f65 = f58 + f60;
+ f66 = MUL_C_R(COEF_CONST(1.3065629648763766), f58);
+ f67 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f65);
+ f68 = MUL_C_R(COEF_CONST((-0.5411961001461967)), f60);
+ y[48] = f66 + f67;
+ y[16] = f68 - f67;
+ f71 = f52 - f54;
+ f72 = f52 + f54;
+ f73 = MUL_C_R(COEF_CONST(0.7071067811865476), f72);
+ f74 = MUL_C_R(COEF_CONST(0.7071067811865476), f71);
+ f75 = f50 - f73;
+ f76 = f50 + f73;
+ f77 = f56 - f74;
+ f78 = f56 + f74;
+ f79 = f78 + f76;
+ f80 = MUL_C_R(COEF_CONST((-0.7856949583871021)), f78);
+ f81 = MUL_C_R(COEF_CONST(0.9807852804032304), f79);
+ f82 = MUL_C_R(COEF_CONST(1.1758756024193588), f76);
+ y[8] = f80 + f81;
+ y[56] = f82 - f81;
+ f85 = f77 + f75;
+ f86 = MUL_C_R(COEF_CONST(0.2758993792829431), f77);
+ f87 = MUL_C_R(COEF_CONST(0.5555702330196022), f85);
+ f88 = MUL_C_R(COEF_CONST(1.3870398453221475), f75);
+ y[40] = f86 + f87;
+ y[24] = f88 - f87;
+ f91 = f40 - f42;
+ f92 = f40 + f42;
+ f93 = MUL_C_R(COEF_CONST(0.7071067811865476), f92);
+ f94 = MUL_C_R(COEF_CONST(0.7071067811865476), f91);
+ f95 = f38 - f44;
+ f96 = f38 + f44;
+ f97 = MUL_C_R(COEF_CONST(0.7071067811865476), f96);
+ f98 = MUL_C_R(COEF_CONST(0.7071067811865476), f95);
+ f99 = f34 - f93;
+ f100 = f34 + f93;
+ f101 = f48 - f94;
+ f102 = f48 + f94;
+ f103 = f36 - f97;
+ f104 = f36 + f97;
+ f105 = f46 - f98;
+ f106 = f46 + f98;
+ f107 = f106 + f104;
+ f108 = MUL_C_R(COEF_CONST((-0.5411961001461969)), f106);
+ f109 = MUL_C_R(COEF_CONST(0.9238795325112867), f107);
+ f110 = MUL_C_R(COEF_CONST(1.3065629648763766), f104);
+ f111 = f108 + f109;
+ f112 = f110 - f109;
+ f113 = f105 + f103;
+ f114 = MUL_C_R(COEF_CONST(1.3065629648763770), f105);
+ f115 = MUL_C_R(COEF_CONST((-0.3826834323650904)), f113);
+ f116 = MUL_C_R(COEF_CONST(0.5411961001461961), f103);
+ f117 = f114 + f115;
+ f118 = f116 - f115;
+ f119 = f100 - f111;
+ f120 = f100 + f111;
+ f121 = f102 - f112;
+ f122 = f102 + f112;
+ f123 = f99 - f117;
+ f124 = f99 + f117;
+ f125 = f101 - f118;
+ f126 = f101 + f118;
+ f127 = f122 + f120;
+ f128 = MUL_C_R(COEF_CONST((-0.8971675863426361)), f122);
+ f129 = MUL_C_R(COEF_CONST(0.9951847266721968), f127);
+ f130 = MUL_C_R(COEF_CONST(1.0932018670017576), f120);
+ y[4] = f128 + f129;
+ y[60] = f130 - f129;
+ f133 = f126 + f124;
+ f134 = MUL_C_R(COEF_CONST((-0.4105245275223571)), f126);
+ f135 = MUL_C_R(COEF_CONST(0.8819212643483549), f133);
+ f136 = MUL_C_R(COEF_CONST(1.3533180011743529), f124);
+ y[20] = f134 + f135;
+ y[44] = f136 - f135;
+ f139 = f121 + f119;
+ f140 = MUL_C_R(COEF_CONST(0.1386171691990915), f121);
+ f141 = MUL_C_R(COEF_CONST(0.6343932841636455), f139);
+ f142 = MUL_C_R(COEF_CONST(1.4074037375263826), f119);
+ y[36] = f140 + f141;
+ y[28] = f142 - f141;
+ f145 = f125 + f123;
+ f146 = MUL_C_R(COEF_CONST(0.6666556584777466), f125);
+ f147 = MUL_C_R(COEF_CONST(0.2902846772544623), f145);
+ f148 = MUL_C_R(COEF_CONST(1.2472250129866711), f123);
+ y[52] = f146 + f147;
+ y[12] = f148 - f147;
+ f151 = f2 + f32;
+ f152 = MUL_C_R(COEF_CONST(1.0478631305325901), f2);
+ f153 = MUL_C_R(COEF_CONST((-0.9987954562051724)), f151);
+ f154 = MUL_C_R(COEF_CONST((-0.9497277818777548)), f32);
+ f155 = f152 + f153;
+ f156 = f154 - f153;
+ f157 = f4 + f30;
+ f158 = MUL_C_R(COEF_CONST(1.1359069844201428), f4);
+ f159 = MUL_C_R(COEF_CONST((-0.9891765099647809)), f157);
+ f160 = MUL_C_R(COEF_CONST((-0.8424460355094190)), f30);
+ f161 = f158 + f159;
+ f162 = f160 - f159;
+ f163 = f6 + f28;
+ f164 = MUL_C_R(COEF_CONST(1.2130114330978077), f6);
+ f165 = MUL_C_R(COEF_CONST((-0.9700312531945440)), f163);
+ f166 = MUL_C_R(COEF_CONST((-0.7270510732912803)), f28);
+ f167 = f164 + f165;
+ f168 = f166 - f165;
+ f169 = f8 + f26;
+ f170 = MUL_C_R(COEF_CONST(1.2784339185752405), f8);
+ f171 = MUL_C_R(COEF_CONST((-0.9415440651830209)), f169);
+ f172 = MUL_C_R(COEF_CONST((-0.6046542117908014)), f26);
+ f173 = f170 + f171;
+ f174 = f172 - f171;
+ f175 = f10 + f24;
+ f176 = MUL_C_R(COEF_CONST(1.3315443865537255), f10);
+ f177 = MUL_C_R(COEF_CONST((-0.9039892931234433)), f175);
+ f178 = MUL_C_R(COEF_CONST((-0.4764341996931612)), f24);
+ f179 = f176 + f177;
+ f180 = f178 - f177;
+ f181 = f12 + f22;
+ f182 = MUL_C_R(COEF_CONST(1.3718313541934939), f12);
+ f183 = MUL_C_R(COEF_CONST((-0.8577286100002722)), f181);
+ f184 = MUL_C_R(COEF_CONST((-0.3436258658070507)), f22);
+ f185 = f182 + f183;
+ f186 = f184 - f183;
+ f187 = f14 + f20;
+ f188 = MUL_C_R(COEF_CONST(1.3989068359730781), f14);
+ f189 = MUL_C_R(COEF_CONST((-0.8032075314806453)), f187);
+ f190 = MUL_C_R(COEF_CONST((-0.2075082269882124)), f20);
+ f191 = f188 + f189;
+ f192 = f190 - f189;
+ f193 = f16 + f18;
+ f194 = MUL_C_R(COEF_CONST(1.4125100802019774), f16);
+ f195 = MUL_C_R(COEF_CONST((-0.7409511253549591)), f193);
+ f196 = MUL_C_R(COEF_CONST((-0.0693921705079408)), f18);
+ f197 = f194 + f195;
+ f198 = f196 - f195;
+ f199 = f156 - f198;
+ f200 = f156 + f198;
+ f201 = f162 - f192;
+ f202 = f162 + f192;
+ f203 = f168 - f186;
+ f204 = f168 + f186;
+ f205 = f174 - f180;
+ f206 = f174 + f180;
+ f207 = f200 - f206;
+ f208 = f200 + f206;
+ f209 = f202 - f204;
+ f210 = f202 + f204;
+ f211 = f208 - f210;
+ y[2] = f208 + f210;
+ f213 = MUL_C_R(COEF_CONST(0.7071067811865476), f211);
+ f214 = f207 + f209;
+ f215 = MUL_C_R(COEF_CONST(1.3065629648763766), f207);
+ f216 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f214);
+ f217 = MUL_C_R(COEF_CONST((-0.5411961001461967)), f209);
+ f218 = f215 + f216;
+ f219 = f217 - f216;
+ f220 = f201 - f203;
+ f221 = f201 + f203;
+ f222 = MUL_C_R(COEF_CONST(0.7071067811865476), f221);
+ f223 = MUL_C_R(COEF_CONST(0.7071067811865476), f220);
+ f224 = f199 - f222;
+ f225 = f199 + f222;
+ f226 = f205 - f223;
+ f227 = f205 + f223;
+ f228 = f227 + f225;
+ f229 = MUL_C_R(COEF_CONST((-0.7856949583871021)), f227);
+ f230 = MUL_C_R(COEF_CONST(0.9807852804032304), f228);
+ f231 = MUL_C_R(COEF_CONST(1.1758756024193588), f225);
+ f232 = f229 + f230;
+ f233 = f231 - f230;
+ f234 = f226 + f224;
+ f235 = MUL_C_R(COEF_CONST(0.2758993792829431), f226);
+ f236 = MUL_C_R(COEF_CONST(0.5555702330196022), f234);
+ f237 = MUL_C_R(COEF_CONST(1.3870398453221475), f224);
+ f238 = f235 + f236;
+ f239 = f237 - f236;
+ f240 = f155 - f197;
+ f241 = f155 + f197;
+ f242 = f161 - f191;
+ f243 = f161 + f191;
+ f244 = f167 - f185;
+ f245 = f167 + f185;
+ f246 = f173 - f179;
+ f247 = f173 + f179;
+ f248 = f245 - f243;
+ f249 = f245 + f243;
+ f250 = MUL_C_R(COEF_CONST(0.7071067811865476), f249);
+ f251 = f247 - f250;
+ f252 = f247 + f250;
+ f253 = MUL_C_R(COEF_CONST(0.7071067811865476), f248);
+ f254 = f253 - f241;
+ f255 = f253 + f241;
+ f256 = f255 + f252;
+ f257 = MUL_C_R(COEF_CONST((-0.7856949583871021)), f255);
+ f258 = MUL_C_R(COEF_CONST(0.9807852804032304), f256);
+ f259 = MUL_C_R(COEF_CONST(1.1758756024193588), f252);
+ f260 = f257 + f258;
+ f261 = f259 - f258;
+ f262 = f254 + f251;
+ f263 = MUL_C_R(COEF_CONST((-0.2758993792829430)), f254);
+ f264 = MUL_C_R(COEF_CONST(0.8314696123025452), f262);
+ f265 = MUL_C_R(COEF_CONST(1.3870398453221475), f251);
+ f266 = f263 + f264;
+ f267 = f265 - f264;
+ f268 = f240 - f246;
+ f269 = f240 + f246;
+ f270 = f242 - f244;
+ f271 = f242 + f244;
+ f272 = f269 + f271;
+ f273 = MUL_C_R(COEF_CONST(1.3065629648763770), f269);
+ f274 = MUL_C_R(COEF_CONST((-0.3826834323650904)), f272);
+ f275 = MUL_C_R(COEF_CONST(0.5411961001461961), f271);
+ f276 = f273 + f274;
+ f277 = f275 - f274;
+ y[62] = f268 - f270;
+ f279 = f268 + f270;
+ f280 = MUL_C_R(COEF_CONST(0.7071067811865476), f279);
+ y[10] = f232 - f260;
+ y[6] = f232 + f260;
+ y[18] = f219 - f277;
+ y[14] = f219 + f277;
+ y[26] = f239 + f266;
+ y[22] = f239 - f266;
+ y[34] = f213 - f280;
+ y[30] = f213 + f280;
+ y[42] = f238 - f267;
+ y[38] = f238 + f267;
+ y[50] = f218 - f276;
+ y[46] = f218 + f276;
+ y[58] = f233 + f261;
+ y[54] = f233 - f261;
+ f295 = t2[3] - t2[5];
+ f296 = t2[3] + t2[5];
+ f297 = t2[7] - t2[9];
+ f298 = t2[7] + t2[9];
+ f299 = t2[11] - t2[13];
+ f300 = t2[11] + t2[13];
+ f301 = t2[15] - t2[17];
+ f302 = t2[15] + t2[17];
+ f303 = t2[19] - t2[21];
+ f304 = t2[19] + t2[21];
+ f305 = t2[23] - t2[25];
+ f306 = t2[23] + t2[25];
+ f307 = t2[27] - t2[29];
+ f308 = t2[27] + t2[29];
+ f309 = t2[31] - t2[33];
+ f310 = t2[31] + t2[33];
+ f311 = t2[35] - t2[37];
+ f312 = t2[35] + t2[37];
+ f313 = t2[39] - t2[41];
+ f314 = t2[39] + t2[41];
+ f315 = t2[43] - t2[45];
+ f316 = t2[43] + t2[45];
+ f317 = t2[47] - t2[49];
+ f318 = t2[47] + t2[49];
+ f319 = t2[51] - t2[53];
+ f320 = t2[51] + t2[53];
+ f321 = t2[55] - t2[57];
+ f322 = t2[55] + t2[57];
+ f323 = t2[59] - t2[61];
+ f324 = t2[59] + t2[61];
+ f325 = MUL_C_R(COEF_CONST(0.7071067811865476), f310);
+ f326 = t2[1] - f325;
+ f327 = t2[1] + f325;
+ f328 = f302 + f318;
+ f329 = MUL_C_R(COEF_CONST(1.3065629648763766), f302);
+ f330 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f328);
+ f331 = MUL_C_R(COEF_CONST((-0.5411961001461967)), f318);
+ f332 = f329 + f330;
+ f333 = f331 - f330;
+ f334 = f327 - f333;
+ f335 = f327 + f333;
+ f336 = f326 - f332;
+ f337 = f326 + f332;
+ f338 = f306 - f314;
+ f339 = f306 + f314;
+ f340 = MUL_C_R(COEF_CONST(0.7071067811865476), f339);
+ f341 = f298 - f340;
+ f342 = f298 + f340;
+ f343 = MUL_C_R(COEF_CONST(0.7071067811865476), f338);
+ f344 = f343 - f322;
+ f345 = f343 + f322;
+ f346 = f345 + f342;
+ f347 = MUL_C_R(COEF_CONST((-0.7856949583871021)), f345);
+ f348 = MUL_C_R(COEF_CONST(0.9807852804032304), f346);
+ f349 = MUL_C_R(COEF_CONST(1.1758756024193588), f342);
+ f350 = f347 + f348;
+ f351 = f349 - f348;
+ f352 = f344 + f341;
+ f353 = MUL_C_R(COEF_CONST((-0.2758993792829430)), f344);
+ f354 = MUL_C_R(COEF_CONST(0.8314696123025452), f352);
+ f355 = MUL_C_R(COEF_CONST(1.3870398453221475), f341);
+ f356 = f353 + f354;
+ f357 = f355 - f354;
+ f358 = f335 - f350;
+ f359 = f335 + f350;
+ f360 = f337 - f356;
+ f361 = f337 + f356;
+ f362 = f336 - f357;
+ f363 = f336 + f357;
+ f364 = f334 - f351;
+ f365 = f334 + f351;
+ f366 = MUL_C_R(COEF_CONST(5.1011486186891641), f296);
+ f367 = MUL_C_R(COEF_CONST(1.7224470982383342), f300);
+ f368 = MUL_C_R(COEF_CONST(1.0606776859903475), f304);
+ f369 = MUL_C_R(COEF_CONST(0.7881546234512502), f308);
+ f370 = MUL_C_R(COEF_CONST(0.5024192861881557), f324);
+ f371 = MUL_C_R(COEF_CONST(0.5224986149396889), f320);
+ f372 = MUL_C_R(COEF_CONST(0.5669440348163577), f316);
+ f373 = MUL_C_R(COEF_CONST(0.6468217833599901), f312);
+ f374 = f366 - f370;
+ f375 = f366 + f370;
+ f376 = f367 - f371;
+ f377 = f367 + f371;
+ f378 = f368 - f372;
+ f379 = f368 + f372;
+ f380 = f369 - f373;
+ f381 = f369 + f373;
+ f382 = MUL_C_R(COEF_CONST(0.5097955791041592), f375);
+ f383 = MUL_C_R(COEF_CONST(0.6013448869350453), f377);
+ f384 = MUL_C_R(COEF_CONST(0.8999762231364156), f379);
+ f385 = MUL_C_R(COEF_CONST(2.5629154477415055), f381);
+ f386 = f382 + f385;
+ f387 = f382 - f385;
+ f388 = f383 + f384;
+ f389 = f384 - f383;
+ f390 = f387 - f389;
+ f391 = f387 + f389;
+ f392 = MUL_C_R(COEF_CONST(0.7071067811865476), f390);
+ f393 = f386 - f388;
+ f394 = MUL_C_R(COEF_CONST(1.3065629648763766), f386);
+ f395 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f393);
+ f396 = MUL_C_R(COEF_CONST((-0.5411961001461967)), f388);
+ f397 = f394 + f395;
+ f398 = f395 + f396;
+ f399 = f391 - f398;
+ f400 = f392 - f398;
+ f401 = f392 + f397;
+ f402 = f380 - f374;
+ f403 = f374 + f380;
+ f404 = f378 - f376;
+ f405 = f376 + f378;
+ f406 = f403 + f405;
+ f407 = MUL_C_R(COEF_CONST(1.3065629648763770), f403);
+ f408 = MUL_C_R(COEF_CONST((-0.3826834323650904)), f406);
+ f409 = MUL_C_R(COEF_CONST(0.5411961001461961), f405);
+ f410 = f407 + f408;
+ f411 = f408 - f409;
+ f412 = f402 - f404;
+ f413 = f402 + f404;
+ f414 = MUL_C_R(COEF_CONST(0.7071067811865476), f413);
+ f415 = f411 + f397;
+ f416 = f401 + f411;
+ f417 = f414 + f401;
+ f418 = f400 + f414;
+ f419 = f400 - f410;
+ f420 = f399 - f410;
+ f421 = f412 + f399;
+ f422 = f359 - f397;
+ f423 = f359 + f397;
+ f424 = f361 + f415;
+ f425 = f361 - f415;
+ f426 = f363 - f416;
+ f427 = f363 + f416;
+ f428 = f365 + f417;
+ f429 = f365 - f417;
+ f430 = f364 - f418;
+ f431 = f364 + f418;
+ f432 = f362 + f419;
+ f433 = f362 - f419;
+ f434 = f360 - f420;
+ f435 = f360 + f420;
+ f436 = f358 + f421;
+ f437 = f358 - f421;
+ f438 = MUL_C_R(COEF_CONST(5.1011486186891641), f295);
+ f439 = MUL_C_R(COEF_CONST(1.7224470982383342), f299);
+ f440 = MUL_C_R(COEF_CONST(1.0606776859903475), f303);
+ f441 = MUL_C_R(COEF_CONST(0.7881546234512502), f307);
+ f442 = MUL_C_R(COEF_CONST(0.5024192861881557), f323);
+ f443 = MUL_C_R(COEF_CONST(0.5224986149396889), f319);
+ f444 = MUL_C_R(COEF_CONST(0.5669440348163577), f315);
+ f445 = MUL_C_R(COEF_CONST(0.6468217833599901), f311);
+ f446 = f438 + f442;
+ f447 = f438 - f442;
+ f448 = f439 + f443;
+ f449 = f443 - f439;
+ f450 = f440 + f444;
+ f451 = f440 - f444;
+ f452 = f441 + f445;
+ f453 = f445 - f441;
+ f454 = MUL_C_R(COEF_CONST(0.5097955791041592), f447);
+ f455 = MUL_C_R(COEF_CONST(0.6013448869350453), f449);
+ f456 = MUL_C_R(COEF_CONST(0.8999762231364156), f451);
+ f457 = MUL_C_R(COEF_CONST(2.5629154477415055), f453);
+ f458 = f454 + f457;
+ f459 = f454 - f457;
+ f460 = f455 + f456;
+ f461 = f456 - f455;
+ f462 = f459 - f461;
+ f463 = f459 + f461;
+ f464 = MUL_C_R(COEF_CONST(0.7071067811865476), f462);
+ f465 = f458 - f460;
+ f466 = MUL_C_R(COEF_CONST(1.3065629648763766), f458);
+ f467 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f465);
+ f468 = MUL_C_R(COEF_CONST((-0.5411961001461967)), f460);
+ f469 = f466 + f467;
+ f470 = f467 + f468;
+ f471 = f463 - f470;
+ f472 = f464 - f470;
+ f473 = f464 + f469;
+ f474 = f446 + f452;
+ f475 = f452 - f446;
+ f476 = f448 + f450;
+ f477 = f448 - f450;
+ f478 = f475 + f477;
+ f479 = MUL_C_R(COEF_CONST(1.3065629648763770), f475);
+ f480 = MUL_C_R(COEF_CONST((-0.3826834323650904)), f478);
+ f481 = MUL_C_R(COEF_CONST(0.5411961001461961), f477);
+ f482 = f479 + f480;
+ f483 = f481 - f480;
+ f484 = f474 + f476;
+ f485 = f476 - f474;
+ f486 = MUL_C_R(COEF_CONST(0.7071067811865476), f485);
+ f487 = f483 + f469;
+ f488 = f473 + f483;
+ f489 = f486 + f473;
+ f490 = f472 + f486;
+ f491 = f482 + f472;
+ f492 = f471 + f482;
+ f493 = f471 - f484;
+ f494 = MUL_C_R(COEF_CONST(0.7071067811865476), f309);
+ f495 = t2[63] - f494;
+ f496 = t2[63] + f494;
+ f497 = f317 + f301;
+ f498 = MUL_C_R(COEF_CONST(1.3065629648763766), f317);
+ f499 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f497);
+ f500 = MUL_C_R(COEF_CONST((-0.5411961001461967)), f301);
+ f501 = f498 + f499;
+ f502 = f500 - f499;
+ f503 = f496 - f502;
+ f504 = f496 + f502;
+ f505 = f495 - f501;
+ f506 = f495 + f501;
+ f507 = MUL_C_R(COEF_CONST(0.5097955791041592), f321);
+ f508 = MUL_C_R(COEF_CONST(0.6013448869350453), f313);
+ f509 = MUL_C_R(COEF_CONST(0.8999762231364156), f305);
+ f510 = MUL_C_R(COEF_CONST(2.5629154477415055), f297);
+ f511 = f507 - f510;
+ f512 = f507 + f510;
+ f513 = f508 - f509;
+ f514 = f508 + f509;
+ f515 = f512 - f514;
+ f516 = f512 + f514;
+ f517 = MUL_C_R(COEF_CONST(0.7071067811865476), f515);
+ f518 = f511 + f513;
+ f519 = MUL_C_R(COEF_CONST(1.3065629648763766), f511);
+ f520 = MUL_C_R(COEF_CONST((-0.9238795325112866)), f518);
+ f521 = MUL_C_R(COEF_CONST((-0.5411961001461967)), f513);
+ f522 = f519 + f520;
+ f523 = f521 - f520;
+ f524 = f516 + f523;
+ f525 = f523 + f517;
+ f526 = f517 + f522;
+ f527 = f504 - f524;
+ f528 = f504 + f524;
+ f529 = f506 - f525;
+ f530 = f506 + f525;
+ f531 = f505 - f526;
+ f532 = f505 + f526;
+ f533 = f503 - f522;
+ f534 = f503 + f522;
+ f535 = f493 + f528;
+ f536 = f528 - f493;
+ f537 = f492 + f530;
+ f538 = f492 - f530;
+ f539 = f491 + f532;
+ f540 = f532 - f491;
+ f541 = f490 + f534;
+ f542 = f490 - f534;
+ f543 = f489 + f533;
+ f544 = f533 - f489;
+ f545 = f488 + f531;
+ f546 = f488 - f531;
+ f547 = f487 + f529;
+ f548 = f529 - f487;
+ f549 = f469 + f527;
+ f550 = f469 - f527;
+ f551 = f536 + f423;
+ f552 = MUL_C_R(COEF_CONST((-0.9751575901732920)), f536);
+ f553 = MUL_C_R(COEF_CONST(0.9996988186962043), f551);
+ f554 = MUL_C_R(COEF_CONST(1.0242400472191164), f423);
+ y[1] = f552 + f553;
+ y[63] = f554 - f553;
+ f557 = f538 + f425;
+ f558 = MUL_C_R(COEF_CONST((-0.9237258930790228)), f538);
+ f559 = MUL_C_R(COEF_CONST(0.9972904566786902), f557);
+ f560 = MUL_C_R(COEF_CONST(1.0708550202783576), f425);
+ y[3] = f558 + f559;
+ y[61] = f560 - f559;
+ f563 = f540 + f427;
+ f564 = MUL_C_R(COEF_CONST((-0.8700688593994936)), f540);
+ f565 = MUL_C_R(COEF_CONST(0.9924795345987100), f563);
+ f566 = MUL_C_R(COEF_CONST(1.1148902097979263), f427);
+ y[5] = f564 + f565;
+ y[59] = f566 - f565;
+ f569 = f542 + f429;
+ f570 = MUL_C_R(COEF_CONST((-0.8143157536286398)), f542);
+ f571 = MUL_C_R(COEF_CONST(0.9852776423889412), f569);
+ f572 = MUL_C_R(COEF_CONST(1.1562395311492426), f429);
+ y[7] = f570 + f571;
+ y[57] = f572 - f571;
+ f575 = f544 + f431;
+ f576 = MUL_C_R(COEF_CONST((-0.7566008898816587)), f544);
+ f577 = MUL_C_R(COEF_CONST(0.9757021300385286), f575);
+ f578 = MUL_C_R(COEF_CONST(1.1948033701953984), f431);
+ y[9] = f576 + f577;
+ y[55] = f578 - f577;
+ f581 = f546 + f433;
+ f582 = MUL_C_R(COEF_CONST((-0.6970633083205414)), f546);
+ f583 = MUL_C_R(COEF_CONST(0.9637760657954398), f581);
+ f584 = MUL_C_R(COEF_CONST(1.2304888232703384), f433);
+ y[11] = f582 + f583;
+ y[53] = f584 - f583;
+ f587 = f548 + f435;
+ f588 = MUL_C_R(COEF_CONST((-0.6358464401941451)), f548);
+ f589 = MUL_C_R(COEF_CONST(0.9495281805930367), f587);
+ f590 = MUL_C_R(COEF_CONST(1.2632099209919283), f435);
+ y[13] = f588 + f589;
+ y[51] = f590 - f589;
+ f593 = f550 + f437;
+ f594 = MUL_C_R(COEF_CONST((-0.5730977622997506)), f550);
+ f595 = MUL_C_R(COEF_CONST(0.9329927988347389), f593);
+ f596 = MUL_C_R(COEF_CONST(1.2928878353697271), f437);
+ y[15] = f594 + f595;
+ y[49] = f596 - f595;
+ f599 = f549 + f436;
+ f600 = MUL_C_R(COEF_CONST((-0.5089684416985408)), f549);
+ f601 = MUL_C_R(COEF_CONST(0.9142097557035307), f599);
+ f602 = MUL_C_R(COEF_CONST(1.3194510697085207), f436);
+ y[17] = f600 + f601;
+ y[47] = f602 - f601;
+ f605 = f434 - f547;
+ f606 = MUL_C_R(COEF_CONST((-0.4436129715409087)), f547);
+ f607 = MUL_C_R(COEF_CONST(0.8932243011955153), f605);
+ f608 = MUL_C_R(COEF_CONST(1.3428356308501219), f434);
+ y[19] = f607 - f606;
+ y[45] = f608 - f607;
+ f611 = f545 + f432;
+ f612 = MUL_C_R(COEF_CONST((-0.3771887988789273)), f545);
+ f613 = MUL_C_R(COEF_CONST(0.8700869911087114), f611);
+ f614 = MUL_C_R(COEF_CONST(1.3629851833384954), f432);
+ y[21] = f612 + f613;
+ y[43] = f614 - f613;
+ f617 = f430 - f543;
+ f618 = MUL_C_R(COEF_CONST((-0.3098559453626097)), f543);
+ f619 = MUL_C_R(COEF_CONST(0.8448535652497070), f617);
+ f620 = MUL_C_R(COEF_CONST(1.3798511851368043), f430);
+ y[23] = f619 - f618;
+ y[41] = f620 - f619;
+ f623 = f541 + f428;
+ f624 = MUL_C_R(COEF_CONST((-0.2417766217337384)), f541);
+ f625 = MUL_C_R(COEF_CONST(0.8175848131515837), f623);
+ f626 = MUL_C_R(COEF_CONST(1.3933930045694289), f428);
+ y[25] = f624 + f625;
+ y[39] = f626 - f625;
+ f629 = f426 - f539;
+ f630 = MUL_C_R(COEF_CONST((-0.1731148370459794)), f539);
+ f631 = MUL_C_R(COEF_CONST(0.7883464276266062), f629);
+ f632 = MUL_C_R(COEF_CONST(1.4035780182072330), f426);
+ y[27] = f631 - f630;
+ y[37] = f632 - f631;
+ f635 = f537 + f424;
+ f636 = MUL_C_R(COEF_CONST((-0.1040360035527077)), f537);
+ f637 = MUL_C_R(COEF_CONST(0.7572088465064845), f635);
+ f638 = MUL_C_R(COEF_CONST(1.4103816894602612), f424);
+ y[29] = f636 + f637;
+ y[35] = f638 - f637;
+ f641 = f422 - f535;
+ f642 = MUL_C_R(COEF_CONST((-0.0347065382144000)), f535);
+ f643 = MUL_C_R(COEF_CONST(0.7242470829514669), f641);
+ f644 = MUL_C_R(COEF_CONST(1.4137876276885337), f422);
+ y[31] = f643 - f642;
+ y[33] = f644 - f643;
+}
+
+#else
+
+void DCT4_64(real_t *y, real_t *x)
+{
+ int16_t i0;
+ real_t f2;
+ real_t f3;
+ real_t f4;
+ real_t f5;
+ real_t f6;
+ real_t f7;
+ real_t f8;
+ real_t f9;
+ real_t f10;
+ real_t f11;
+ real_t f12;
+ real_t f13;
+ real_t f14;
+ real_t f15;
+ real_t f16;
+ real_t f17;
+ real_t f18;
+ real_t f19;
+ real_t f20;
+ real_t f21;
+ real_t f22;
+ real_t f23;
+ real_t f24;
+ real_t f25;
+ real_t f26;
+ real_t f27;
+ real_t f28;
+ real_t f29;
+ real_t f30;
+ real_t f31;
+ real_t f32;
+ real_t f33;
+ real_t f34;
+ real_t f35;
+ real_t f36;
+ real_t f37;
+ real_t f38;
+ real_t f39;
+ real_t f40;
+ real_t f41;
+ real_t f42;
+ real_t f43;
+ real_t f44;
+ real_t f45;
+ real_t f46;
+ real_t f47;
+ real_t f48;
+ real_t f49;
+ real_t f50;
+ real_t f51;
+ real_t f52;
+ real_t f53;
+ real_t f54;
+ real_t f55;
+ real_t f56;
+ real_t f57;
+ real_t f58;
+ real_t f59;
+ real_t f60;
+ real_t f61;
+ real_t f62;
+ real_t f63;
+ real_t f64;
+ real_t f65;
+ real_t f66;
+ real_t f67;
+ real_t f68;
+ real_t f69;
+ real_t f70;
+ real_t f71;
+ real_t f72;
+ real_t f73;
+ real_t f74;
+ real_t f75;
+ real_t f76;
+ real_t f77;
+ real_t f78;
+ real_t f79;
+ real_t f80;
+ real_t f81;
+ real_t f82;
+ real_t f83;
+ real_t f84;
+ real_t f85;
+ real_t f86;
+ real_t f87;
+ real_t f88;
+ real_t f89;
+ real_t f90;
+ real_t f91;
+ real_t f92;
+ real_t f93;
+ real_t f94;
+ real_t f95;
+ real_t f96;
+ real_t f97;
+ real_t f98;
+ real_t f99;
+ real_t f100;
+ real_t f101;
+ real_t f102;
+ real_t f103;
+ real_t f104;
+ real_t f105;
+ real_t f106;
+ real_t f107;
+ real_t f108;
+ real_t f109;
+ real_t f110;
+ real_t f111;
+ real_t f112;
+ real_t f113;
+ real_t f114;
+ real_t f115;
+ real_t f116;
+ real_t f117;
+ real_t f118;
+ real_t f119;
+ real_t f120;
+ real_t f121;
+ real_t f122;
+ real_t f123;
+ real_t f124;
+ real_t f125;
+ real_t f126;
+ real_t f127;
+ real_t f128;
+ real_t f129;
+ real_t f130;
+ real_t f131;
+ real_t f132;
+ real_t f133;
+ real_t f134;
+ real_t f135;
+ real_t f136;
+ real_t f137;
+ real_t f138;
+ real_t f139;
+ real_t f140;
+ real_t f141;
+ real_t f142;
+ real_t f143;
+ real_t f144;
+ real_t f145;
+ real_t f146;
+ real_t f147;
+ real_t f148;
+ real_t f149;
+ real_t f150;
+ real_t f151;
+ real_t f152;
+ real_t f153;
+ real_t f154;
+ real_t f155;
+ real_t f156;
+ real_t f157;
+ real_t f158;
+ real_t f159;
+ real_t f160;
+ real_t f161;
+ real_t f162;
+ real_t f163;
+ real_t f164;
+ real_t f165;
+ real_t f166;
+ real_t f167;
+ real_t f168;
+ real_t f169;
+ real_t f170;
+ real_t f171;
+ real_t f172;
+ real_t f173;
+ real_t f174;
+ real_t f175;
+ real_t f176;
+ real_t f177;
+ real_t f178;
+ real_t f179;
+ real_t f180;
+ real_t f181;
+ real_t f182;
+ real_t f183;
+ real_t f184;
+ real_t f185;
+ real_t f186;
+ real_t f187;
+ real_t f188;
+ real_t f189;
+ real_t f190;
+ real_t f191;
+ real_t f192;
+ real_t f193;
+ real_t f194;
+ real_t f195;
+ real_t f196;
+ real_t f197;
+ real_t f198;
+ real_t f199;
+ real_t f200;
+ real_t f201;
+ real_t f202;
+ real_t f203;
+ real_t f204;
+ real_t f205;
+ real_t f206;
+ real_t f207;
+ real_t f208;
+ real_t f209;
+ real_t f210;
+ real_t f211;
+ real_t f212;
+ real_t f213;
+ real_t f214;
+ real_t f215;
+ real_t f216;
+ real_t f217;
+ real_t f218;
+ real_t f219;
+ real_t f220;
+ real_t f221;
+ real_t f222;
+ real_t f223;
+ real_t f224;
+ real_t f225;
+ real_t f226;
+ real_t f227;
+ real_t f228;
+ real_t f229;
+ real_t f230;
+ real_t f231;
+ real_t f232;
+ real_t f233;
+ real_t f234;
+ real_t f235;
+ real_t f236;
+ real_t f237;
+ real_t f238;
+ real_t f239;
+ real_t f240;
+ real_t f241;
+ real_t f242;
+ real_t f243;
+ real_t f244;
+ real_t f245;
+ real_t f246;
+ real_t f247;
+ real_t f248;
+ real_t f249;
+ real_t f250;
+ real_t f251;
+ real_t f252;
+ real_t f253;
+ real_t f254;
+ real_t f255;
+ real_t f256;
+ real_t f257;
+ real_t f258;
+ real_t f259;
+ real_t f260;
+ real_t f261;
+ real_t f262;
+ real_t f263;
+ real_t f264;
+ real_t f265;
+ real_t f266;
+ real_t f267;
+ real_t f268;
+ real_t f269;
+ real_t f270;
+ real_t f271;
+ real_t f272;
+ real_t f273;
+ real_t f274;
+ real_t f275;
+ real_t f276;
+ real_t f277;
+ real_t f278;
+ real_t f279;
+ real_t f280;
+ real_t f281;
+ real_t f282;
+ real_t f283;
+ real_t f284;
+ real_t f285;
+ real_t f286;
+ real_t f287;
+ real_t f288;
+ real_t f289;
+ real_t f290;
+ real_t f291;
+ real_t f292;
+ real_t f293;
+ real_t f294;
+ real_t f295;
+ real_t f296;
+ real_t f297;
+ real_t f298;
+ real_t f299;
+ real_t f300;
+ real_t f301;
+ real_t f302;
+ real_t f303;
+ real_t f304;
+ real_t f305;
+ real_t f306;
+ real_t f307;
+ real_t f308;
+ real_t f309;
+ real_t f310;
+ real_t f311;
+ real_t f312;
+ real_t f313;
+ real_t f314;
+ real_t f315;
+ real_t f316;
+ real_t f317;
+ real_t f318;
+ real_t f319;
+ real_t f320;
+ real_t f321;
+ real_t f322;
+ real_t f323;
+ real_t f324;
+ real_t f325;
+ real_t f326;
+ real_t f327;
+ real_t f328;
+ real_t f329;
+ real_t f330;
+ real_t f331;
+ real_t f332;
+ real_t f333;
+ real_t f334;
+ real_t f335;
+ real_t f336;
+ real_t f337;
+ real_t f338;
+ real_t f339;
+ real_t f340;
+ real_t f341;
+ real_t f342;
+ real_t f343;
+ real_t f344;
+ real_t f345;
+ real_t f346;
+ real_t f347;
+ real_t f348;
+ real_t f349;
+ real_t f350;
+ real_t f351;
+ real_t f352;
+ real_t f353;
+ real_t f354;
+ real_t f355;
+ real_t f356;
+ real_t f357;
+ real_t f358;
+ real_t f359;
+ real_t f360;
+ real_t f361;
+ real_t f362;
+ real_t f363;
+ real_t f364;
+ real_t f365;
+ real_t f366;
+ real_t f367;
+ real_t f368;
+ real_t f369;
+ real_t f370;
+ real_t f371;
+ real_t f372;
+ real_t f373;
+ real_t f374;
+ real_t f375;
+ real_t f376;
+ real_t f377;
+ real_t f378;
+ real_t f379;
+ real_t f380;
+ real_t f381;
+ real_t f382;
+ real_t f383;
+ real_t f384;
+ real_t f385;
+ real_t f386;
+ real_t f387;
+ real_t f388;
+ real_t f389;
+ real_t f390;
+ real_t f391;
+ real_t f392;
+ real_t f393;
+ real_t f394;
+ real_t f395;
+ real_t f396;
+ real_t f397;
+ real_t f398;
+ real_t f399;
+ real_t f400;
+ real_t f401;
+ real_t f402;
+ real_t f403;
+ real_t f404;
+ real_t f405;
+ real_t f406;
+ real_t f407;
+ real_t f408;
+ real_t f409;
+ real_t f410;
+ real_t f411;
+ real_t f412;
+ real_t f413;
+ real_t f414;
+ real_t f415;
+ real_t f416;
+ real_t f417;
+ real_t f418;
+ real_t f419;
+ real_t f420;
+ real_t f421;
+ real_t f422;
+ real_t f423;
+ real_t f424;
+ real_t f425;
+ real_t f426;
+ real_t f427;
+ real_t f428;
+ real_t f429;
+ real_t f430;
+ real_t f431;
+ real_t f432;
+ real_t f433;
+ real_t f434;
+ real_t f435;
+ real_t f436;
+ real_t f437;
+ real_t f438;
+ real_t f439;
+ real_t f440;
+ real_t f441;
+ real_t f442;
+ real_t f443;
+ real_t f444;
+ real_t f445;
+ real_t f446;
+ real_t f447;
+ real_t f448;
+ real_t f449;
+ real_t f450;
+ real_t f451;
+ real_t f452;
+ real_t f453;
+ real_t f454;
+ real_t f455;
+ real_t f456;
+ real_t f457;
+ real_t f458;
+ real_t f459;
+ real_t f460;
+ real_t f461;
+ real_t f462;
+ real_t f463;
+ real_t f464;
+ real_t f465;
+ real_t f466;
+ real_t f467;
+ real_t f468;
+ real_t f469;
+ real_t f470;
+ real_t f471;
+ real_t f472;
+ real_t f473;
+ real_t f474;
+ real_t f475;
+ real_t f476;
+ real_t f477;
+ real_t f478;
+ real_t f479;
+ real_t f480;
+ real_t f481;
+ real_t f482;
+ real_t f483;
+ real_t f484;
+ real_t f485;
+ real_t f486;
+ real_t f487;
+ real_t f488;
+ real_t f489;
+ real_t f490;
+ real_t f491;
+ real_t f492;
+ real_t f493;
+ real_t f494;
+ real_t f495;
+ real_t f496;
+ real_t f497;
+ real_t f498;
+ real_t f499;
+ real_t f500;
+ real_t f501;
+ real_t f502;
+ real_t f503;
+ real_t f504;
+ real_t f505;
+ real_t f506;
+ real_t f507;
+ real_t f508;
+ real_t f509;
+ real_t f510;
+ real_t f511;
+ real_t f512;
+ real_t f513;
+ real_t f514;
+ real_t f515;
+ real_t f516;
+ real_t f517;
+ real_t f518;
+ real_t f519;
+ real_t f520;
+ real_t f521;
+ real_t f522;
+ real_t f523;
+ real_t f524;
+ real_t f525;
+ real_t f526;
+ real_t f527;
+ real_t f528;
+ real_t f529;
+ real_t f530;
+ real_t f531;
+ real_t f532;
+ real_t f533;
+ real_t f534;
+ real_t f535;
+ real_t f536;
+ real_t f537;
+ real_t f538;
+ real_t f539;
+ real_t f540;
+ real_t f541;
+ real_t f542;
+ real_t f543;
+ real_t f544;
+ real_t f545;
+ real_t f546;
+ real_t f547;
+ real_t f548;
+ real_t f549;
+ real_t f550;
+ real_t f551;
+ real_t f552;
+ real_t f553;
+ real_t f554;
+ real_t f555;
+ real_t f556;
+ real_t f557;
+ real_t f558;
+ real_t f559;
+ real_t f560;
+ real_t f561;
+ real_t f562;
+ real_t f563;
+ real_t f564;
+ real_t f565;
+ real_t f566;
+ real_t f567;
+ real_t f568;
+ real_t f569;
+ real_t f570;
+ real_t f571;
+ real_t f572;
+ real_t f573;
+ real_t f574;
+ real_t f575;
+ real_t f576;
+ real_t f577;
+ real_t f578;
+ real_t f579;
+ real_t f580;
+ real_t f581;
+ real_t f582;
+ real_t f583;
+ real_t f584;
+ real_t f585;
+ real_t f586;
+ real_t f587;
+ real_t f588;
+ real_t f589;
+ real_t f590;
+ real_t f591;
+ real_t f592;
+ real_t f593;
+ real_t f594;
+ real_t f595;
+ real_t f596;
+ real_t f597;
+ real_t f598;
+ real_t f599;
+ real_t f600;
+ real_t f601;
+ real_t f602;
+ real_t f603;
+ real_t f604;
+ real_t f605;
+ real_t f606;
+ real_t f607;
+ real_t f608;
+ real_t f609;
+ real_t f610;
+ real_t f611;
+ real_t f612;
+ real_t f613;
+ real_t f614;
+ real_t f615;
+ real_t f618;
+ real_t f619;
+ real_t f620;
+ real_t f621;
+ real_t f624;
+ real_t f625;
+ real_t f626;
+ real_t f627;
+ real_t f630;
+ real_t f631;
+ real_t f632;
+ real_t f633;
+ real_t f636;
+ real_t f637;
+ real_t f638;
+ real_t f639;
+ real_t f642;
+ real_t f643;
+ real_t f644;
+ real_t f645;
+ real_t f648;
+ real_t f649;
+ real_t f650;
+ real_t f651;
+ real_t f654;
+ real_t f655;
+ real_t f656;
+ real_t f657;
+ real_t f660;
+ real_t f661;
+ real_t f662;
+ real_t f663;
+ real_t f666;
+ real_t f667;
+ real_t f668;
+ real_t f669;
+ real_t f672;
+ real_t f673;
+ real_t f674;
+ real_t f675;
+ real_t f678;
+ real_t f679;
+ real_t f680;
+ real_t f681;
+ real_t f684;
+ real_t f685;
+ real_t f686;
+ real_t f687;
+ real_t f690;
+ real_t f691;
+ real_t f692;
+ real_t f693;
+ real_t f696;
+ real_t f697;
+ real_t f698;
+ real_t f699;
+ real_t f702;
+ real_t f703;
+ real_t f704;
+ real_t f705;
+ real_t f708;
+ real_t f709;
+ real_t f710;
+ real_t f711;
+ real_t f714;
+ real_t f715;
+ real_t f716;
+ real_t f717;
+ real_t f720;
+ real_t f721;
+ real_t f722;
+ real_t f723;
+ real_t f726;
+ real_t f727;
+ real_t f728;
+ real_t f729;
+ real_t f732;
+ real_t f733;
+ real_t f734;
+ real_t f735;
+ real_t f738;
+ real_t f739;
+ real_t f740;
+ real_t f741;
+ real_t f744;
+ real_t f745;
+ real_t f746;
+ real_t f747;
+ real_t f750;
+ real_t f751;
+ real_t f752;
+ real_t f753;
+ real_t f756;
+ real_t f757;
+ real_t f758;
+ real_t f759;
+ real_t f762;
+ real_t f763;
+ real_t f764;
+ real_t f765;
+ real_t f768;
+ real_t f769;
+ real_t f770;
+ real_t f771;
+ real_t f774;
+ real_t f775;
+ real_t f776;
+ real_t f777;
+ real_t f780;
+ real_t f781;
+ real_t f782;
+ real_t f783;
+ real_t f786;
+ real_t f787;
+ real_t f788;
+ real_t f789;
+ real_t f792;
+ real_t f793;
+ real_t f794;
+ real_t f795;
+ real_t f798;
+ real_t f799;
+ real_t f800;
+ real_t f801;
+ static real_t t2[64];
+
+ t2[0] = x[0];
+ for (i0=0; i0<31; i0++)
+ {
+ t2[2*i0+1] = x[2*i0+1] - x[2*i0+2];
+ t2[2*i0+2] = x[2*i0+1] + x[2*i0+2];
+ }
+ t2[63] = x[63];
+ f2 = 0.7071067811865476 * t2[32];
+ f3 = x[0] - f2;
+ f4 = x[0] + f2;
+ f5 = t2[16] + t2[48];
+ f6 = 1.3065629648763766 * t2[16];
+ f7 = (-0.9238795325112866) * f5;
+ f8 = (-0.5411961001461967) * t2[48];
+ f9 = f6 + f7;
+ f10 = f8 - f7;
+ f11 = f4 - f10;
+ f12 = f4 + f10;
+ f13 = f3 - f9;
+ f14 = f3 + f9;
+ f15 = t2[8] + t2[56];
+ f16 = 1.1758756024193588 * t2[8];
+ f17 = (-0.9807852804032304) * f15;
+ f18 = (-0.7856949583871021) * t2[56];
+ f19 = f16 + f17;
+ f20 = f18 - f17;
+ f21 = t2[24] + t2[40];
+ f22 = 1.3870398453221473 * t2[24];
+ f23 = (-0.8314696123025455) * f21;
+ f24 = (-0.2758993792829436) * t2[40];
+ f25 = f22 + f23;
+ f26 = f24 - f23;
+ f27 = f20 - f26;
+ f28 = f20 + f26;
+ f29 = 0.7071067811865476 * f27;
+ f30 = f19 - f25;
+ f31 = f19 + f25;
+ f32 = 0.7071067811865476 * f31;
+ f33 = f29 - f32;
+ f34 = f29 + f32;
+ f35 = f12 - f28;
+ f36 = f12 + f28;
+ f37 = f14 - f34;
+ f38 = f14 + f34;
+ f39 = f13 - f33;
+ f40 = f13 + f33;
+ f41 = f11 - f30;
+ f42 = f11 + f30;
+ f43 = t2[4] + t2[60];
+ f44 = 1.0932018670017569 * t2[4];
+ f45 = (-0.9951847266721969) * f43;
+ f46 = (-0.8971675863426368) * t2[60];
+ f47 = f44 + f45;
+ f48 = f46 - f45;
+ f49 = t2[12] + t2[52];
+ f50 = 1.2472250129866711 * t2[12];
+ f51 = (-0.9569403357322089) * f49;
+ f52 = (-0.6666556584777469) * t2[52];
+ f53 = f50 + f51;
+ f54 = f52 - f51;
+ f55 = t2[20] + t2[44];
+ f56 = 1.3533180011743526 * t2[20];
+ f57 = (-0.8819212643483551) * f55;
+ f58 = (-0.4105245275223575) * t2[44];
+ f59 = f56 + f57;
+ f60 = f58 - f57;
+ f61 = t2[28] + t2[36];
+ f62 = 1.4074037375263826 * t2[28];
+ f63 = (-0.7730104533627369) * f61;
+ f64 = (-0.1386171691990913) * t2[36];
+ f65 = f62 + f63;
+ f66 = f64 - f63;
+ f67 = f48 - f66;
+ f68 = f48 + f66;
+ f69 = f54 - f60;
+ f70 = f54 + f60;
+ f71 = f68 - f70;
+ f72 = f68 + f70;
+ f73 = 0.7071067811865476 * f71;
+ f74 = f67 + f69;
+ f75 = 1.3065629648763766 * f67;
+ f76 = (-0.9238795325112866) * f74;
+ f77 = (-0.5411961001461967) * f69;
+ f78 = f75 + f76;
+ f79 = f77 - f76;
+ f80 = f47 - f65;
+ f81 = f47 + f65;
+ f82 = f53 - f59;
+ f83 = f53 + f59;
+ f84 = f81 + f83;
+ f85 = 1.3065629648763770 * f81;
+ f86 = (-0.3826834323650904) * f84;
+ f87 = 0.5411961001461961 * f83;
+ f88 = f85 + f86;
+ f89 = f87 - f86;
+ f90 = f80 - f82;
+ f91 = f80 + f82;
+ f92 = 0.7071067811865476 * f91;
+ f93 = f79 - f89;
+ f94 = f79 + f89;
+ f95 = f73 - f92;
+ f96 = f73 + f92;
+ f97 = f78 - f88;
+ f98 = f78 + f88;
+ f99 = f36 - f72;
+ f100 = f36 + f72;
+ f101 = f38 - f94;
+ f102 = f38 + f94;
+ f103 = f40 - f93;
+ f104 = f40 + f93;
+ f105 = f42 - f96;
+ f106 = f42 + f96;
+ f107 = f41 - f95;
+ f108 = f41 + f95;
+ f109 = f39 - f98;
+ f110 = f39 + f98;
+ f111 = f37 - f97;
+ f112 = f37 + f97;
+ f113 = f35 - f90;
+ f114 = f35 + f90;
+ f115 = t2[2] + t2[62];
+ f116 = 1.0478631305325901 * t2[2];
+ f117 = (-0.9987954562051724) * f115;
+ f118 = (-0.9497277818777548) * t2[62];
+ f119 = f116 + f117;
+ f120 = f118 - f117;
+ f121 = t2[10] + t2[54];
+ f122 = 1.2130114330978077 * t2[10];
+ f123 = (-0.9700312531945440) * f121;
+ f124 = (-0.7270510732912803) * t2[54];
+ f125 = f122 + f123;
+ f126 = f124 - f123;
+ f127 = t2[18] + t2[46];
+ f128 = 1.3315443865537255 * t2[18];
+ f129 = (-0.9039892931234433) * f127;
+ f130 = (-0.4764341996931612) * t2[46];
+ f131 = f128 + f129;
+ f132 = f130 - f129;
+ f133 = t2[26] + t2[38];
+ f134 = 1.3989068359730781 * t2[26];
+ f135 = (-0.8032075314806453) * f133;
+ f136 = (-0.2075082269882124) * t2[38];
+ f137 = f134 + f135;
+ f138 = f136 - f135;
+ f139 = t2[34] + t2[30];
+ f140 = 1.4125100802019777 * t2[34];
+ f141 = (-0.6715589548470187) * f139;
+ f142 = 0.0693921705079402 * t2[30];
+ f143 = f140 + f141;
+ f144 = f142 - f141;
+ f145 = t2[42] + t2[22];
+ f146 = 1.3718313541934939 * t2[42];
+ f147 = (-0.5141027441932219) * f145;
+ f148 = 0.3436258658070501 * t2[22];
+ f149 = f146 + f147;
+ f150 = f148 - f147;
+ f151 = t2[50] + t2[14];
+ f152 = 1.2784339185752409 * t2[50];
+ f153 = (-0.3368898533922200) * f151;
+ f154 = 0.6046542117908008 * t2[14];
+ f155 = f152 + f153;
+ f156 = f154 - f153;
+ f157 = t2[58] + t2[6];
+ f158 = 1.1359069844201433 * t2[58];
+ f159 = (-0.1467304744553624) * f157;
+ f160 = 0.8424460355094185 * t2[6];
+ f161 = f158 + f159;
+ f162 = f160 - f159;
+ f163 = f120 - f144;
+ f164 = f120 + f144;
+ f165 = f119 - f143;
+ f166 = f119 + f143;
+ f167 = f126 - f150;
+ f168 = f126 + f150;
+ f169 = f125 - f149;
+ f170 = f125 + f149;
+ f171 = f132 - f156;
+ f172 = f132 + f156;
+ f173 = f131 - f155;
+ f174 = f131 + f155;
+ f175 = f138 - f162;
+ f176 = f138 + f162;
+ f177 = f137 - f161;
+ f178 = f137 + f161;
+ f179 = f163 + f165;
+ f180 = 1.1758756024193588 * f163;
+ f181 = (-0.9807852804032304) * f179;
+ f182 = (-0.7856949583871021) * f165;
+ f183 = f180 + f181;
+ f184 = f182 - f181;
+ f185 = f167 + f169;
+ f186 = 1.3870398453221475 * f167;
+ f187 = (-0.5555702330196022) * f185;
+ f188 = 0.2758993792829431 * f169;
+ f189 = f186 + f187;
+ f190 = f188 - f187;
+ f191 = f171 + f173;
+ f192 = 0.7856949583871022 * f171;
+ f193 = 0.1950903220161283 * f191;
+ f194 = 1.1758756024193586 * f173;
+ f195 = f192 + f193;
+ f196 = f194 - f193;
+ f197 = f175 + f177;
+ f198 = (-0.2758993792829430) * f175;
+ f199 = 0.8314696123025452 * f197;
+ f200 = 1.3870398453221475 * f177;
+ f201 = f198 + f199;
+ f202 = f200 - f199;
+ f203 = f164 - f172;
+ f204 = f164 + f172;
+ f205 = f166 - f174;
+ f206 = f166 + f174;
+ f207 = f168 - f176;
+ f208 = f168 + f176;
+ f209 = f170 - f178;
+ f210 = f170 + f178;
+ f211 = f184 - f196;
+ f212 = f184 + f196;
+ f213 = f183 - f195;
+ f214 = f183 + f195;
+ f215 = f190 - f202;
+ f216 = f190 + f202;
+ f217 = f189 - f201;
+ f218 = f189 + f201;
+ f219 = f203 + f205;
+ f220 = 1.3065629648763766 * f203;
+ f221 = (-0.9238795325112866) * f219;
+ f222 = (-0.5411961001461967) * f205;
+ f223 = f220 + f221;
+ f224 = f222 - f221;
+ f225 = f207 + f209;
+ f226 = 0.5411961001461969 * f207;
+ f227 = 0.3826834323650898 * f225;
+ f228 = 1.3065629648763766 * f209;
+ f229 = f226 + f227;
+ f230 = f228 - f227;
+ f231 = f211 + f213;
+ f232 = 1.3065629648763766 * f211;
+ f233 = (-0.9238795325112866) * f231;
+ f234 = (-0.5411961001461967) * f213;
+ f235 = f232 + f233;
+ f236 = f234 - f233;
+ f237 = f215 + f217;
+ f238 = 0.5411961001461969 * f215;
+ f239 = 0.3826834323650898 * f237;
+ f240 = 1.3065629648763766 * f217;
+ f241 = f238 + f239;
+ f242 = f240 - f239;
+ f243 = f204 - f208;
+ f244 = f204 + f208;
+ f245 = f206 - f210;
+ f246 = f206 + f210;
+ f247 = f224 - f230;
+ f248 = f224 + f230;
+ f249 = f223 - f229;
+ f250 = f223 + f229;
+ f251 = f212 - f216;
+ f252 = f212 + f216;
+ f253 = f214 - f218;
+ f254 = f214 + f218;
+ f255 = f236 - f242;
+ f256 = f236 + f242;
+ f257 = f235 - f241;
+ f258 = f235 + f241;
+ f259 = f243 - f245;
+ f260 = f243 + f245;
+ f261 = 0.7071067811865474 * f259;
+ f262 = 0.7071067811865474 * f260;
+ f263 = f247 - f249;
+ f264 = f247 + f249;
+ f265 = 0.7071067811865474 * f263;
+ f266 = 0.7071067811865474 * f264;
+ f267 = f251 - f253;
+ f268 = f251 + f253;
+ f269 = 0.7071067811865474 * f267;
+ f270 = 0.7071067811865474 * f268;
+ f271 = f255 - f257;
+ f272 = f255 + f257;
+ f273 = 0.7071067811865474 * f271;
+ f274 = 0.7071067811865474 * f272;
+ f275 = f100 - f244;
+ f276 = f100 + f244;
+ f277 = f102 - f252;
+ f278 = f102 + f252;
+ f279 = f104 - f256;
+ f280 = f104 + f256;
+ f281 = f106 - f248;
+ f282 = f106 + f248;
+ f283 = f108 - f266;
+ f284 = f108 + f266;
+ f285 = f110 - f274;
+ f286 = f110 + f274;
+ f287 = f112 - f270;
+ f288 = f112 + f270;
+ f289 = f114 - f262;
+ f290 = f114 + f262;
+ f291 = f113 - f261;
+ f292 = f113 + f261;
+ f293 = f111 - f269;
+ f294 = f111 + f269;
+ f295 = f109 - f273;
+ f296 = f109 + f273;
+ f297 = f107 - f265;
+ f298 = f107 + f265;
+ f299 = f105 - f250;
+ f300 = f105 + f250;
+ f301 = f103 - f258;
+ f302 = f103 + f258;
+ f303 = f101 - f254;
+ f304 = f101 + f254;
+ f305 = f99 - f246;
+ f306 = f99 + f246;
+ f307 = t2[1] - t2[61];
+ f308 = 1.0478631305325901 * t2[1];
+ f309 = (-0.9987954562051724) * f307;
+ f310 = (-0.9497277818777548) * t2[61];
+ f311 = f308 + f309;
+ f312 = f309 + f310;
+ f313 = t2[9] - t2[53];
+ f314 = 1.2130114330978077 * t2[9];
+ f315 = (-0.9700312531945440) * f313;
+ f316 = (-0.7270510732912803) * t2[53];
+ f317 = f314 + f315;
+ f318 = f315 + f316;
+ f319 = t2[17] - t2[45];
+ f320 = 1.3315443865537255 * t2[17];
+ f321 = (-0.9039892931234433) * f319;
+ f322 = (-0.4764341996931612) * t2[45];
+ f323 = f320 + f321;
+ f324 = f321 + f322;
+ f325 = t2[25] - t2[37];
+ f326 = 1.3989068359730781 * t2[25];
+ f327 = (-0.8032075314806453) * f325;
+ f328 = (-0.2075082269882124) * t2[37];
+ f329 = f326 + f327;
+ f330 = f327 + f328;
+ f331 = t2[33] - t2[29];
+ f332 = 1.4125100802019777 * t2[33];
+ f333 = (-0.6715589548470187) * f331;
+ f334 = 0.0693921705079402 * t2[29];
+ f335 = f332 + f333;
+ f336 = f333 + f334;
+ f337 = t2[41] - t2[21];
+ f338 = 1.3718313541934939 * t2[41];
+ f339 = (-0.5141027441932219) * f337;
+ f340 = 0.3436258658070501 * t2[21];
+ f341 = f338 + f339;
+ f342 = f339 + f340;
+ f343 = t2[49] - t2[13];
+ f344 = 1.2784339185752409 * t2[49];
+ f345 = (-0.3368898533922200) * f343;
+ f346 = 0.6046542117908008 * t2[13];
+ f347 = f344 + f345;
+ f348 = f345 + f346;
+ f349 = t2[57] - t2[5];
+ f350 = 1.1359069844201433 * t2[57];
+ f351 = (-0.1467304744553624) * f349;
+ f352 = 0.8424460355094185 * t2[5];
+ f353 = f350 + f351;
+ f354 = f351 + f352;
+ f355 = f336 - f312;
+ f356 = f312 + f336;
+ f357 = f311 - f335;
+ f358 = f311 + f335;
+ f359 = f342 - f318;
+ f360 = f318 + f342;
+ f361 = f317 - f341;
+ f362 = f317 + f341;
+ f363 = f348 - f324;
+ f364 = f324 + f348;
+ f365 = f323 - f347;
+ f366 = f323 + f347;
+ f367 = f354 - f330;
+ f368 = f330 + f354;
+ f369 = f329 - f353;
+ f370 = f329 + f353;
+ f371 = f355 + f357;
+ f372 = 1.1758756024193588 * f355;
+ f373 = (-0.9807852804032304) * f371;
+ f374 = (-0.7856949583871021) * f357;
+ f375 = f372 + f373;
+ f376 = f374 - f373;
+ f377 = f359 + f361;
+ f378 = 1.3870398453221475 * f359;
+ f379 = (-0.5555702330196022) * f377;
+ f380 = 0.2758993792829431 * f361;
+ f381 = f378 + f379;
+ f382 = f380 - f379;
+ f383 = f363 + f365;
+ f384 = 0.7856949583871022 * f363;
+ f385 = 0.1950903220161283 * f383;
+ f386 = 1.1758756024193586 * f365;
+ f387 = f384 + f385;
+ f388 = f386 - f385;
+ f389 = f367 + f369;
+ f390 = (-0.2758993792829430) * f367;
+ f391 = 0.8314696123025452 * f389;
+ f392 = 1.3870398453221475 * f369;
+ f393 = f390 + f391;
+ f394 = f392 - f391;
+ f395 = f364 - f356;
+ f396 = f356 + f364;
+ f397 = f358 - f366;
+ f398 = f358 + f366;
+ f399 = f368 - f360;
+ f400 = f360 + f368;
+ f401 = f362 - f370;
+ f402 = f362 + f370;
+ f403 = f376 - f388;
+ f404 = f376 + f388;
+ f405 = f375 - f387;
+ f406 = f375 + f387;
+ f407 = f382 - f394;
+ f408 = f382 + f394;
+ f409 = f381 - f393;
+ f410 = f381 + f393;
+ f411 = f395 + f397;
+ f412 = 1.3065629648763766 * f395;
+ f413 = (-0.9238795325112866) * f411;
+ f414 = (-0.5411961001461967) * f397;
+ f415 = f412 + f413;
+ f416 = f414 - f413;
+ f417 = f399 + f401;
+ f418 = 0.5411961001461969 * f399;
+ f419 = 0.3826834323650898 * f417;
+ f420 = 1.3065629648763766 * f401;
+ f421 = f418 + f419;
+ f422 = f420 - f419;
+ f423 = f403 + f405;
+ f424 = 1.3065629648763766 * f403;
+ f425 = (-0.9238795325112866) * f423;
+ f426 = (-0.5411961001461967) * f405;
+ f427 = f424 + f425;
+ f428 = f426 - f425;
+ f429 = f407 + f409;
+ f430 = 0.5411961001461969 * f407;
+ f431 = 0.3826834323650898 * f429;
+ f432 = 1.3065629648763766 * f409;
+ f433 = f430 + f431;
+ f434 = f432 - f431;
+ f435 = f400 - f396;
+ f436 = f396 + f400;
+ f437 = f398 - f402;
+ f438 = f398 + f402;
+ f439 = f416 - f422;
+ f440 = f416 + f422;
+ f441 = f415 - f421;
+ f442 = f415 + f421;
+ f443 = f404 - f408;
+ f444 = f404 + f408;
+ f445 = f406 - f410;
+ f446 = f406 + f410;
+ f447 = f428 - f434;
+ f448 = f428 + f434;
+ f449 = f427 - f433;
+ f450 = f427 + f433;
+ f451 = f435 - f437;
+ f452 = f435 + f437;
+ f453 = 0.7071067811865474 * f451;
+ f454 = 0.7071067811865474 * f452;
+ f455 = f439 - f441;
+ f456 = f439 + f441;
+ f457 = 0.7071067811865474 * f455;
+ f458 = 0.7071067811865474 * f456;
+ f459 = f443 - f445;
+ f460 = f443 + f445;
+ f461 = 0.7071067811865474 * f459;
+ f462 = 0.7071067811865474 * f460;
+ f463 = f447 - f449;
+ f464 = f447 + f449;
+ f465 = 0.7071067811865474 * f463;
+ f466 = 0.7071067811865474 * f464;
+ f467 = 0.7071067811865476 * t2[31];
+ f468 = x[63] - f467;
+ f469 = x[63] + f467;
+ f470 = t2[47] + t2[15];
+ f471 = 1.3065629648763766 * t2[47];
+ f472 = (-0.9238795325112866) * f470;
+ f473 = (-0.5411961001461967) * t2[15];
+ f474 = f471 + f472;
+ f475 = f473 - f472;
+ f476 = f469 - f475;
+ f477 = f469 + f475;
+ f478 = f468 - f474;
+ f479 = f468 + f474;
+ f480 = t2[55] + t2[7];
+ f481 = 1.1758756024193588 * t2[55];
+ f482 = (-0.9807852804032304) * f480;
+ f483 = (-0.7856949583871021) * t2[7];
+ f484 = f481 + f482;
+ f485 = f483 - f482;
+ f486 = t2[39] + t2[23];
+ f487 = 1.3870398453221473 * t2[39];
+ f488 = (-0.8314696123025455) * f486;
+ f489 = (-0.2758993792829436) * t2[23];
+ f490 = f487 + f488;
+ f491 = f489 - f488;
+ f492 = f485 - f491;
+ f493 = f485 + f491;
+ f494 = 0.7071067811865476 * f492;
+ f495 = f484 - f490;
+ f496 = f484 + f490;
+ f497 = 0.7071067811865476 * f496;
+ f498 = f494 - f497;
+ f499 = f494 + f497;
+ f500 = f477 - f493;
+ f501 = f477 + f493;
+ f502 = f479 - f499;
+ f503 = f479 + f499;
+ f504 = f478 - f498;
+ f505 = f478 + f498;
+ f506 = f476 - f495;
+ f507 = f476 + f495;
+ f508 = t2[59] + t2[3];
+ f509 = 1.0932018670017569 * t2[59];
+ f510 = (-0.9951847266721969) * f508;
+ f511 = (-0.8971675863426368) * t2[3];
+ f512 = f509 + f510;
+ f513 = f511 - f510;
+ f514 = t2[51] + t2[11];
+ f515 = 1.2472250129866711 * t2[51];
+ f516 = (-0.9569403357322089) * f514;
+ f517 = (-0.6666556584777469) * t2[11];
+ f518 = f515 + f516;
+ f519 = f517 - f516;
+ f520 = t2[43] + t2[19];
+ f521 = 1.3533180011743526 * t2[43];
+ f522 = (-0.8819212643483551) * f520;
+ f523 = (-0.4105245275223575) * t2[19];
+ f524 = f521 + f522;
+ f525 = f523 - f522;
+ f526 = t2[35] + t2[27];
+ f527 = 1.4074037375263826 * t2[35];
+ f528 = (-0.7730104533627369) * f526;
+ f529 = (-0.1386171691990913) * t2[27];
+ f530 = f527 + f528;
+ f531 = f529 - f528;
+ f532 = f513 - f531;
+ f533 = f513 + f531;
+ f534 = f519 - f525;
+ f535 = f519 + f525;
+ f536 = f533 - f535;
+ f537 = f533 + f535;
+ f538 = 0.7071067811865476 * f536;
+ f539 = f532 + f534;
+ f540 = 1.3065629648763766 * f532;
+ f541 = (-0.9238795325112866) * f539;
+ f542 = (-0.5411961001461967) * f534;
+ f543 = f540 + f541;
+ f544 = f542 - f541;
+ f545 = f512 - f530;
+ f546 = f512 + f530;
+ f547 = f518 - f524;
+ f548 = f518 + f524;
+ f549 = f546 + f548;
+ f550 = 1.3065629648763770 * f546;
+ f551 = (-0.3826834323650904) * f549;
+ f552 = 0.5411961001461961 * f548;
+ f553 = f550 + f551;
+ f554 = f552 - f551;
+ f555 = f545 - f547;
+ f556 = f545 + f547;
+ f557 = 0.7071067811865476 * f556;
+ f558 = f544 - f554;
+ f559 = f544 + f554;
+ f560 = f538 - f557;
+ f561 = f538 + f557;
+ f562 = f543 - f553;
+ f563 = f543 + f553;
+ f564 = f501 - f537;
+ f565 = f501 + f537;
+ f566 = f503 - f559;
+ f567 = f503 + f559;
+ f568 = f505 - f558;
+ f569 = f505 + f558;
+ f570 = f507 - f561;
+ f571 = f507 + f561;
+ f572 = f506 - f560;
+ f573 = f506 + f560;
+ f574 = f504 - f563;
+ f575 = f504 + f563;
+ f576 = f502 - f562;
+ f577 = f502 + f562;
+ f578 = f500 - f555;
+ f579 = f500 + f555;
+ f580 = f438 - f565;
+ f581 = f438 + f565;
+ f582 = f446 + f567;
+ f583 = f446 - f567;
+ f584 = f450 - f569;
+ f585 = f450 + f569;
+ f586 = f442 + f571;
+ f587 = f442 - f571;
+ f588 = f457 - f573;
+ f589 = f457 + f573;
+ f590 = f465 + f575;
+ f591 = f465 - f575;
+ f592 = f461 - f577;
+ f593 = f461 + f577;
+ f594 = f453 + f579;
+ f595 = f453 - f579;
+ f596 = f454 - f578;
+ f597 = f454 + f578;
+ f598 = f462 + f576;
+ f599 = f462 - f576;
+ f600 = f466 - f574;
+ f601 = f466 + f574;
+ f602 = f458 + f572;
+ f603 = f458 - f572;
+ f604 = f440 - f570;
+ f605 = f440 + f570;
+ f606 = f448 + f568;
+ f607 = f448 - f568;
+ f608 = f444 - f566;
+ f609 = f444 + f566;
+ f610 = f564 - f436;
+ f611 = f436 + f564;
+ f612 = f581 + f276;
+ f613 = (-0.9876531635534246) * f581;
+ f614 = 0.9999247018391445 * f612;
+ f615 = 1.0121962401248645 * f276;
+ y[0] = f613 + f614;
+ y[63] = f615 - f614;
+ f618 = f583 + f278;
+ f619 = (-0.9625151616469906) * f583;
+ f620 = 0.9993223845883495 * f618;
+ f621 = 1.0361296075297086 * f278;
+ y[1] = f619 + f620;
+ y[62] = f621 - f620;
+ f624 = f585 + f280;
+ f625 = (-0.9367973765979405) * f585;
+ f626 = 0.9981181129001492 * f624;
+ f627 = 1.0594388492023579 * f280;
+ y[2] = f625 + f626;
+ y[61] = f627 - f626;
+ f630 = f587 + f282;
+ f631 = (-0.9105152998383381) * f587;
+ f632 = 0.9963126121827780 * f630;
+ f633 = 1.0821099245272179 * f282;
+ y[3] = f631 + f632;
+ y[60] = f633 - f632;
+ f636 = f589 + f284;
+ f637 = (-0.8836847627084729) * f589;
+ f638 = 0.9939069700023561 * f636;
+ f639 = 1.1041291772962392 * f284;
+ y[4] = f637 + f638;
+ y[59] = f639 - f638;
+ f642 = f591 + f286;
+ f643 = (-0.8563219269206538) * f591;
+ f644 = 0.9909026354277800 * f642;
+ f645 = 1.1254833439349063 * f286;
+ y[5] = f643 + f644;
+ y[58] = f645 - f644;
+ f648 = f593 + f288;
+ f649 = (-0.8284432748239970) * f593;
+ f650 = 0.9873014181578584 * f648;
+ f651 = 1.1461595614917197 * f288;
+ y[6] = f649 + f650;
+ y[57] = f651 - f650;
+ f654 = f595 + f290;
+ f655 = (-0.8000655994760753) * f595;
+ f656 = 0.9831054874312163 * f654;
+ f657 = 1.1661453753863573 * f290;
+ y[7] = f655 + f656;
+ y[56] = f657 - f656;
+ f660 = f597 + f292;
+ f661 = (-0.7712059945274091) * f597;
+ f662 = 0.9783173707196277 * f660;
+ f663 = 1.1854287469118463 * f292;
+ y[8] = f661 + f662;
+ y[55] = f663 - f662;
+ f666 = f599 + f294;
+ f667 = (-0.7418818439248888) * f599;
+ f668 = 0.9729399522055601 * f666;
+ f669 = 1.2039980604862313 * f294;
+ y[9] = f667 + f668;
+ y[54] = f669 - f668;
+ f672 = f601 + f296;
+ f673 = (-0.7121108114403374) * f601;
+ f674 = 0.9669764710448521 * f672;
+ f675 = 1.2218421306493668 * f296;
+ y[10] = f673 + f674;
+ y[53] = f675 - f674;
+ f678 = f603 + f298;
+ f679 = (-0.6819108300305128) * f603;
+ f680 = 0.9604305194155658 * f678;
+ f681 = 1.2389502088006188 * f298;
+ y[11] = f679 + f680;
+ y[52] = f681 - f680;
+ f684 = f605 + f300;
+ f685 = (-0.6513000910349656) * f605;
+ f686 = 0.9533060403541938 * f684;
+ f687 = 1.2553119896734219 * f300;
+ y[12] = f685 + f686;
+ y[51] = f687 - f686;
+ f690 = f607 + f302;
+ f691 = (-0.6202970332182582) * f607;
+ f692 = 0.9456073253805213 * f690;
+ f693 = 1.2709176175427843 * f302;
+ y[13] = f691 + f692;
+ y[50] = f693 - f692;
+ f696 = f609 + f304;
+ f697 = (-0.5889203316631404) * f609;
+ f698 = 0.9373390119125750 * f696;
+ f699 = 1.2857576921620095 * f304;
+ y[14] = f697 + f698;
+ y[49] = f699 - f698;
+ f702 = f306 - f611;
+ f703 = (-0.5571888865213779) * f611;
+ f704 = 0.9285060804732155 * f702;
+ f705 = 1.2998232744250531 * f306;
+ y[15] = f704 - f703;
+ y[48] = f705 - f704;
+ f708 = f610 + f305;
+ f709 = (-0.5251218116290097) * f610;
+ f710 = 0.9191138516900578 * f708;
+ f711 = 1.3131058917511058 * f305;
+ y[16] = f709 + f710;
+ y[47] = f711 - f710;
+ f714 = f608 + f303;
+ f715 = (-0.4927384229928850) * f608;
+ f716 = 0.9091679830905223 * f714;
+ f717 = 1.3255975431881595 * f303;
+ y[17] = f715 + f716;
+ y[46] = f717 - f716;
+ f720 = f606 + f301;
+ f721 = (-0.4600582271554261) * f606;
+ f722 = 0.8986744656939538 * f720;
+ f723 = 1.3372907042324815 * f301;
+ y[18] = f721 + f722;
+ y[45] = f723 - f722;
+ f726 = f604 + f299;
+ f727 = (-0.4271009094446139) * f604;
+ f728 = 0.8876396204028539 * f726;
+ f729 = 1.3481783313610940 * f299;
+ y[19] = f727 + f728;
+ y[44] = f729 - f728;
+ f732 = f602 + f297;
+ f733 = (-0.3938863221162838) * f602;
+ f734 = 0.8760700941954066 * f732;
+ f735 = 1.3582538662745294 * f297;
+ y[20] = f733 + f734;
+ y[43] = f735 - f734;
+ f738 = f600 + f295;
+ f739 = (-0.3604344723958691) * f600;
+ f740 = 0.8639728561215867 * f738;
+ f741 = 1.3675112398473042 * f295;
+ y[21] = f739 + f740;
+ y[42] = f741 - f740;
+ f744 = f598 + f293;
+ f745 = (-0.3267655104267964) * f598;
+ f746 = 0.8513551931052652 * f744;
+ f747 = 1.3759448757837340 * f293;
+ y[22] = f745 + f746;
+ y[41] = f747 - f746;
+ f750 = f596 + f291;
+ f751 = (-0.2928997171327915) * f596;
+ f752 = 0.8382247055548380 * f750;
+ f753 = 1.3835496939768843 * f291;
+ y[23] = f751 + f752;
+ y[40] = f753 - f752;
+ f756 = f594 + f289;
+ f757 = (-0.2588574920014121) * f594;
+ f758 = 0.8245893027850253 * f756;
+ f759 = 1.3903211135686386 * f289;
+ y[24] = f757 + f758;
+ y[39] = f759 - f758;
+ f762 = f592 + f287;
+ f763 = (-0.2246593407961559) * f592;
+ f764 = 0.8104571982525948 * f762;
+ f765 = 1.3962550557090336 * f287;
+ y[25] = f763 + f764;
+ y[38] = f765 - f764;
+ f768 = f590 + f285;
+ f769 = (-0.1903258632045579) * f590;
+ f770 = 0.7958369046088835 * f768;
+ f771 = 1.4013479460132090 * f285;
+ y[26] = f769 + f770;
+ y[37] = f771 - f770;
+ f774 = f588 + f283;
+ f775 = (-0.1558777404297079) * f588;
+ f776 = 0.7807372285720944 * f774;
+ f777 = 1.4055967167144807 * f283;
+ y[27] = f775 + f776;
+ y[36] = f777 - f776;
+ f780 = f586 + f281;
+ f781 = (-0.1213357227326675) * f586;
+ f782 = 0.7651672656224590 * f780;
+ f783 = 1.4089988085122505 * f281;
+ y[28] = f781 + f782;
+ y[35] = f783 - f782;
+ f786 = f584 + f279;
+ f787 = (-0.0867206169332875) * f584;
+ f788 = 0.7491363945234593 * f786;
+ f789 = 1.4115521721136310 * f279;
+ y[29] = f787 + f788;
+ y[34] = f789 - f788;
+ f792 = f582 + f277;
+ f793 = (-0.0520532738769597) * f582;
+ f794 = 0.7326542716724128 * f792;
+ f795 = 1.4132552694678659 * f277;
+ y[30] = f793 + f794;
+ y[33] = f795 - f794;
+ f798 = f580 + f275;
+ f799 = (-0.0173545758748457) * f580;
+ f800 = 0.7157308252838186 * f798;
+ f801 = 1.4141070746927915 * f275;
+ y[31] = f799 + f800;
+ y[32] = f801 - f800;
+}
+
+void DST4_64(real_t *y, real_t *x)
+{
+ real_t f1;
+ real_t f3;
+ real_t f5;
+ real_t f7;
+ real_t f9;
+ real_t f11;
+ real_t f13;
+ real_t f15;
+ real_t f17;
+ real_t f19;
+ real_t f21;
+ real_t f23;
+ real_t f25;
+ real_t f27;
+ real_t f29;
+ real_t f31;
+ real_t f33;
+ real_t f35;
+ real_t f37;
+ real_t f39;
+ real_t f41;
+ real_t f43;
+ real_t f45;
+ real_t f47;
+ real_t f49;
+ real_t f51;
+ real_t f53;
+ real_t f55;
+ real_t f57;
+ real_t f59;
+ real_t f61;
+ real_t f63;
+ int16_t i0;
+ real_t f66;
+ real_t f67;
+ real_t f68;
+ real_t f69;
+ real_t f70;
+ real_t f71;
+ real_t f72;
+ real_t f73;
+ real_t f74;
+ real_t f75;
+ real_t f76;
+ real_t f77;
+ real_t f78;
+ real_t f79;
+ real_t f80;
+ real_t f81;
+ real_t f82;
+ real_t f83;
+ real_t f84;
+ real_t f85;
+ real_t f86;
+ real_t f87;
+ real_t f88;
+ real_t f89;
+ real_t f90;
+ real_t f91;
+ real_t f92;
+ real_t f93;
+ real_t f94;
+ real_t f95;
+ real_t f96;
+ real_t f97;
+ real_t f98;
+ real_t f99;
+ real_t f100;
+ real_t f101;
+ real_t f102;
+ real_t f103;
+ real_t f104;
+ real_t f105;
+ real_t f106;
+ real_t f107;
+ real_t f108;
+ real_t f109;
+ real_t f110;
+ real_t f111;
+ real_t f112;
+ real_t f113;
+ real_t f114;
+ real_t f115;
+ real_t f116;
+ real_t f117;
+ real_t f118;
+ real_t f119;
+ real_t f120;
+ real_t f121;
+ real_t f122;
+ real_t f123;
+ real_t f124;
+ real_t f125;
+ real_t f126;
+ real_t f127;
+ real_t f128;
+ real_t f129;
+ real_t f130;
+ real_t f131;
+ real_t f132;
+ real_t f133;
+ real_t f134;
+ real_t f135;
+ real_t f136;
+ real_t f137;
+ real_t f138;
+ real_t f139;
+ real_t f140;
+ real_t f141;
+ real_t f142;
+ real_t f143;
+ real_t f144;
+ real_t f145;
+ real_t f146;
+ real_t f147;
+ real_t f148;
+ real_t f149;
+ real_t f150;
+ real_t f151;
+ real_t f152;
+ real_t f153;
+ real_t f154;
+ real_t f155;
+ real_t f156;
+ real_t f157;
+ real_t f158;
+ real_t f159;
+ real_t f160;
+ real_t f161;
+ real_t f162;
+ real_t f163;
+ real_t f164;
+ real_t f165;
+ real_t f166;
+ real_t f167;
+ real_t f168;
+ real_t f169;
+ real_t f170;
+ real_t f171;
+ real_t f172;
+ real_t f173;
+ real_t f174;
+ real_t f175;
+ real_t f176;
+ real_t f177;
+ real_t f178;
+ real_t f179;
+ real_t f180;
+ real_t f181;
+ real_t f182;
+ real_t f183;
+ real_t f184;
+ real_t f185;
+ real_t f186;
+ real_t f187;
+ real_t f188;
+ real_t f189;
+ real_t f190;
+ real_t f191;
+ real_t f192;
+ real_t f193;
+ real_t f194;
+ real_t f195;
+ real_t f196;
+ real_t f197;
+ real_t f198;
+ real_t f199;
+ real_t f200;
+ real_t f201;
+ real_t f202;
+ real_t f203;
+ real_t f204;
+ real_t f205;
+ real_t f206;
+ real_t f207;
+ real_t f208;
+ real_t f209;
+ real_t f210;
+ real_t f211;
+ real_t f212;
+ real_t f213;
+ real_t f214;
+ real_t f215;
+ real_t f216;
+ real_t f217;
+ real_t f218;
+ real_t f219;
+ real_t f220;
+ real_t f221;
+ real_t f222;
+ real_t f223;
+ real_t f224;
+ real_t f225;
+ real_t f226;
+ real_t f227;
+ real_t f228;
+ real_t f229;
+ real_t f230;
+ real_t f231;
+ real_t f232;
+ real_t f233;
+ real_t f234;
+ real_t f235;
+ real_t f236;
+ real_t f237;
+ real_t f238;
+ real_t f239;
+ real_t f240;
+ real_t f241;
+ real_t f242;
+ real_t f243;
+ real_t f244;
+ real_t f245;
+ real_t f246;
+ real_t f247;
+ real_t f248;
+ real_t f249;
+ real_t f250;
+ real_t f251;
+ real_t f252;
+ real_t f253;
+ real_t f254;
+ real_t f255;
+ real_t f256;
+ real_t f257;
+ real_t f258;
+ real_t f259;
+ real_t f260;
+ real_t f261;
+ real_t f262;
+ real_t f263;
+ real_t f264;
+ real_t f265;
+ real_t f266;
+ real_t f267;
+ real_t f268;
+ real_t f269;
+ real_t f270;
+ real_t f271;
+ real_t f272;
+ real_t f273;
+ real_t f274;
+ real_t f275;
+ real_t f276;
+ real_t f277;
+ real_t f278;
+ real_t f279;
+ real_t f280;
+ real_t f281;
+ real_t f282;
+ real_t f283;
+ real_t f284;
+ real_t f285;
+ real_t f286;
+ real_t f287;
+ real_t f288;
+ real_t f289;
+ real_t f290;
+ real_t f291;
+ real_t f292;
+ real_t f293;
+ real_t f294;
+ real_t f295;
+ real_t f296;
+ real_t f297;
+ real_t f298;
+ real_t f299;
+ real_t f300;
+ real_t f301;
+ real_t f302;
+ real_t f303;
+ real_t f304;
+ real_t f305;
+ real_t f306;
+ real_t f307;
+ real_t f308;
+ real_t f309;
+ real_t f310;
+ real_t f311;
+ real_t f312;
+ real_t f313;
+ real_t f314;
+ real_t f315;
+ real_t f316;
+ real_t f317;
+ real_t f318;
+ real_t f319;
+ real_t f320;
+ real_t f321;
+ real_t f322;
+ real_t f323;
+ real_t f324;
+ real_t f325;
+ real_t f326;
+ real_t f327;
+ real_t f328;
+ real_t f329;
+ real_t f330;
+ real_t f331;
+ real_t f332;
+ real_t f333;
+ real_t f334;
+ real_t f335;
+ real_t f336;
+ real_t f337;
+ real_t f338;
+ real_t f339;
+ real_t f340;
+ real_t f341;
+ real_t f342;
+ real_t f343;
+ real_t f344;
+ real_t f345;
+ real_t f346;
+ real_t f347;
+ real_t f348;
+ real_t f349;
+ real_t f350;
+ real_t f351;
+ real_t f352;
+ real_t f353;
+ real_t f354;
+ real_t f355;
+ real_t f356;
+ real_t f357;
+ real_t f358;
+ real_t f359;
+ real_t f360;
+ real_t f361;
+ real_t f362;
+ real_t f363;
+ real_t f364;
+ real_t f365;
+ real_t f366;
+ real_t f367;
+ real_t f368;
+ real_t f369;
+ real_t f370;
+ real_t f371;
+ real_t f372;
+ real_t f373;
+ real_t f374;
+ real_t f375;
+ real_t f376;
+ real_t f377;
+ real_t f378;
+ real_t f379;
+ real_t f380;
+ real_t f381;
+ real_t f382;
+ real_t f383;
+ real_t f384;
+ real_t f385;
+ real_t f386;
+ real_t f387;
+ real_t f388;
+ real_t f389;
+ real_t f390;
+ real_t f391;
+ real_t f392;
+ real_t f393;
+ real_t f394;
+ real_t f395;
+ real_t f396;
+ real_t f397;
+ real_t f398;
+ real_t f399;
+ real_t f400;
+ real_t f401;
+ real_t f402;
+ real_t f403;
+ real_t f404;
+ real_t f405;
+ real_t f406;
+ real_t f407;
+ real_t f408;
+ real_t f409;
+ real_t f410;
+ real_t f411;
+ real_t f412;
+ real_t f413;
+ real_t f414;
+ real_t f415;
+ real_t f416;
+ real_t f417;
+ real_t f418;
+ real_t f419;
+ real_t f420;
+ real_t f421;
+ real_t f422;
+ real_t f423;
+ real_t f424;
+ real_t f425;
+ real_t f426;
+ real_t f427;
+ real_t f428;
+ real_t f429;
+ real_t f430;
+ real_t f431;
+ real_t f432;
+ real_t f433;
+ real_t f434;
+ real_t f435;
+ real_t f436;
+ real_t f437;
+ real_t f438;
+ real_t f439;
+ real_t f440;
+ real_t f441;
+ real_t f442;
+ real_t f443;
+ real_t f444;
+ real_t f445;
+ real_t f446;
+ real_t f447;
+ real_t f448;
+ real_t f449;
+ real_t f450;
+ real_t f451;
+ real_t f452;
+ real_t f453;
+ real_t f454;
+ real_t f455;
+ real_t f456;
+ real_t f457;
+ real_t f458;
+ real_t f459;
+ real_t f460;
+ real_t f461;
+ real_t f462;
+ real_t f463;
+ real_t f464;
+ real_t f465;
+ real_t f466;
+ real_t f467;
+ real_t f468;
+ real_t f469;
+ real_t f470;
+ real_t f471;
+ real_t f472;
+ real_t f473;
+ real_t f474;
+ real_t f475;
+ real_t f476;
+ real_t f477;
+ real_t f478;
+ real_t f479;
+ real_t f480;
+ real_t f481;
+ real_t f482;
+ real_t f483;
+ real_t f484;
+ real_t f485;
+ real_t f486;
+ real_t f487;
+ real_t f488;
+ real_t f489;
+ real_t f490;
+ real_t f491;
+ real_t f492;
+ real_t f493;
+ real_t f494;
+ real_t f495;
+ real_t f496;
+ real_t f497;
+ real_t f498;
+ real_t f499;
+ real_t f500;
+ real_t f501;
+ real_t f502;
+ real_t f503;
+ real_t f504;
+ real_t f505;
+ real_t f506;
+ real_t f507;
+ real_t f508;
+ real_t f509;
+ real_t f510;
+ real_t f511;
+ real_t f512;
+ real_t f513;
+ real_t f514;
+ real_t f515;
+ real_t f516;
+ real_t f517;
+ real_t f518;
+ real_t f519;
+ real_t f520;
+ real_t f521;
+ real_t f522;
+ real_t f523;
+ real_t f524;
+ real_t f525;
+ real_t f526;
+ real_t f527;
+ real_t f528;
+ real_t f529;
+ real_t f530;
+ real_t f531;
+ real_t f532;
+ real_t f533;
+ real_t f534;
+ real_t f535;
+ real_t f536;
+ real_t f537;
+ real_t f538;
+ real_t f539;
+ real_t f540;
+ real_t f541;
+ real_t f542;
+ real_t f543;
+ real_t f544;
+ real_t f545;
+ real_t f546;
+ real_t f547;
+ real_t f548;
+ real_t f549;
+ real_t f550;
+ real_t f551;
+ real_t f552;
+ real_t f553;
+ real_t f554;
+ real_t f555;
+ real_t f556;
+ real_t f557;
+ real_t f558;
+ real_t f559;
+ real_t f560;
+ real_t f561;
+ real_t f562;
+ real_t f563;
+ real_t f564;
+ real_t f565;
+ real_t f566;
+ real_t f567;
+ real_t f568;
+ real_t f569;
+ real_t f570;
+ real_t f571;
+ real_t f572;
+ real_t f573;
+ real_t f574;
+ real_t f575;
+ real_t f576;
+ real_t f577;
+ real_t f578;
+ real_t f579;
+ real_t f580;
+ real_t f581;
+ real_t f582;
+ real_t f583;
+ real_t f584;
+ real_t f585;
+ real_t f586;
+ real_t f587;
+ real_t f588;
+ real_t f589;
+ real_t f590;
+ real_t f591;
+ real_t f592;
+ real_t f593;
+ real_t f594;
+ real_t f595;
+ real_t f596;
+ real_t f597;
+ real_t f598;
+ real_t f599;
+ real_t f600;
+ real_t f601;
+ real_t f602;
+ real_t f603;
+ real_t f604;
+ real_t f605;
+ real_t f606;
+ real_t f607;
+ real_t f608;
+ real_t f609;
+ real_t f610;
+ real_t f611;
+ real_t f612;
+ real_t f613;
+ real_t f614;
+ real_t f615;
+ real_t f616;
+ real_t f617;
+ real_t f618;
+ real_t f619;
+ real_t f620;
+ real_t f621;
+ real_t f622;
+ real_t f623;
+ real_t f624;
+ real_t f625;
+ real_t f626;
+ real_t f627;
+ real_t f628;
+ real_t f629;
+ real_t f630;
+ real_t f631;
+ real_t f632;
+ real_t f633;
+ real_t f634;
+ real_t f635;
+ real_t f636;
+ real_t f637;
+ real_t f638;
+ real_t f639;
+ real_t f640;
+ real_t f641;
+ real_t f642;
+ real_t f643;
+ real_t f644;
+ real_t f645;
+ real_t f646;
+ real_t f647;
+ real_t f648;
+ real_t f649;
+ real_t f650;
+ real_t f651;
+ real_t f652;
+ real_t f653;
+ real_t f654;
+ real_t f655;
+ real_t f656;
+ real_t f657;
+ real_t f658;
+ real_t f659;
+ real_t f660;
+ real_t f661;
+ real_t f662;
+ real_t f663;
+ real_t f664;
+ real_t f665;
+ real_t f666;
+ real_t f667;
+ real_t f668;
+ real_t f669;
+ real_t f670;
+ real_t f671;
+ real_t f672;
+ real_t f673;
+ real_t f674;
+ real_t f675;
+ real_t f676;
+ real_t f677;
+ real_t f678;
+ real_t f679;
+ real_t f681;
+ real_t f682;
+ real_t f683;
+ real_t f684;
+ real_t f685;
+ real_t f686;
+ real_t f687;
+ real_t f688;
+ real_t f689;
+ real_t f690;
+ real_t f691;
+ real_t f692;
+ real_t f693;
+ real_t f694;
+ real_t f695;
+ real_t f696;
+ real_t f697;
+ real_t f698;
+ real_t f699;
+ real_t f700;
+ real_t f701;
+ real_t f702;
+ real_t f703;
+ real_t f704;
+ real_t f705;
+ real_t f706;
+ real_t f707;
+ real_t f708;
+ real_t f709;
+ real_t f710;
+ real_t f711;
+ real_t f712;
+ real_t f713;
+ real_t f714;
+ real_t f715;
+ real_t f716;
+ real_t f717;
+ real_t f718;
+ real_t f719;
+ real_t f720;
+ real_t f721;
+ real_t f722;
+ real_t f723;
+ real_t f724;
+ real_t f725;
+ real_t f726;
+ real_t f727;
+ real_t f728;
+ real_t f729;
+ real_t f730;
+ real_t f731;
+ real_t f732;
+ real_t f733;
+ real_t f734;
+ real_t f735;
+ real_t f736;
+ real_t f737;
+ real_t f738;
+ real_t f739;
+ real_t f740;
+ real_t f741;
+ real_t f742;
+ real_t f743;
+ real_t f744;
+ real_t f745;
+ real_t f746;
+ real_t f747;
+ real_t f748;
+ real_t f749;
+ real_t f750;
+ real_t f751;
+ real_t f752;
+ real_t f753;
+ real_t f754;
+ real_t f755;
+ real_t f756;
+ real_t f757;
+ real_t f758;
+ real_t f759;
+ real_t f760;
+ real_t f761;
+ real_t f762;
+ real_t f763;
+ real_t f764;
+ real_t f765;
+ real_t f766;
+ real_t f767;
+ real_t f768;
+ real_t f769;
+ real_t f770;
+ static real_t t7[64];
+ static real_t t6[64];
+ static real_t t0[64];
+
+ t7[0] = 0.5000376519155477 * x[0];
+ f1 = 0.5003390374428216 * x[1];
+ t7[2] = 0 - f1;
+ t7[4] = 0.5009427176380873 * x[2];
+ f3 = 0.5018505174842379 * x[3];
+ t7[6] = 0 - f3;
+ t7[8] = 0.5030651913013697 * x[4];
+ f5 = 0.5045904432216454 * x[5];
+ t7[10] = 0 - f5;
+ t7[12] = 0.5064309549285542 * x[6];
+ f7 = 0.5085924210498143 * x[7];
+ t7[14] = 0 - f7;
+ t7[16] = 0.5110815927066812 * x[8];
+ f9 = 0.5139063298475396 * x[9];
+ t7[18] = 0 - f9;
+ t7[20] = 0.5170756631334912 * x[10];
+ f11 = 0.5205998663018917 * x[11];
+ t7[22] = 0 - f11;
+ t7[24] = 0.5244905401147240 * x[12];
+ f13 = 0.5287607092074876 * x[13];
+ t7[26] = 0 - f13;
+ t7[28] = 0.5334249333971333 * x[14];
+ f15 = 0.5384994352919840 * x[15];
+ t7[30] = 0 - f15;
+ t7[32] = 0.5440022463817783 * x[16];
+ f17 = 0.5499533741832360 * x[17];
+ t7[34] = 0 - f17;
+ t7[36] = 0.5563749934898856 * x[18];
+ f19 = 0.5632916653417023 * x[19];
+ t7[38] = 0 - f19;
+ t7[40] = 0.5707305880121454 * x[20];
+ f21 = 0.5787218851348208 * x[21];
+ t7[42] = 0 - f21;
+ t7[44] = 0.5872989370937893 * x[22];
+ f23 = 0.5964987630244563 * x[23];
+ t7[46] = 0 - f23;
+ t7[48] = 0.6063624622721460 * x[24];
+ f25 = 0.6169357260050706 * x[25];
+ t7[50] = 0 - f25;
+ t7[52] = 0.6282694319707711 * x[26];
+ f27 = 0.6404203382416639 * x[27];
+ t7[54] = 0 - f27;
+ t7[56] = 0.6534518953751283 * x[28];
+ f29 = 0.6674352009263413 * x[29];
+ t7[58] = 0 - f29;
+ t7[60] = 0.6824501259764195 * x[30];
+ f31 = 0.6985866506472291 * x[31];
+ t7[62] = 0 - f31;
+ t7[63] = 0.7159464549705746 * x[32];
+ f33 = 0.7346448236478627 * x[33];
+ t7[61] = 0 - f33;
+ t7[59] = 0.7548129391165311 * x[34];
+ f35 = 0.7766006582339630 * x[35];
+ t7[57] = 0 - f35;
+ t7[55] = 0.8001798956216941 * x[36];
+ f37 = 0.8257487738627852 * x[37];
+ t7[53] = 0 - f37;
+ t7[51] = 0.8535367510066064 * x[38];
+ f39 = 0.8838110045596234 * x[39];
+ t7[49] = 0 - f39;
+ t7[47] = 0.9168844461846523 * x[40];
+ f41 = 0.9531258743921193 * x[41];
+ t7[45] = 0 - f41;
+ t7[43] = 0.9929729612675466 * x[42];
+ f43 = 1.0369490409103890 * x[43];
+ t7[41] = 0 - f43;
+ t7[39] = 1.0856850642580145 * x[44];
+ f45 = 1.1399486751015042 * x[45];
+ t7[37] = 0 - f45;
+ t7[35] = 1.2006832557294167 * x[46];
+ f47 = 1.2690611716991191 * x[47];
+ t7[33] = 0 - f47;
+ t7[31] = 1.3465576282062861 * x[48];
+ f49 = 1.4350550884414341 * x[49];
+ t7[29] = 0 - f49;
+ t7[27] = 1.5369941008524954 * x[50];
+ f51 = 1.6555965242641195 * x[51];
+ t7[25] = 0 - f51;
+ t7[23] = 1.7952052190778898 * x[52];
+ f53 = 1.9618178485711659 * x[53];
+ t7[21] = 0 - f53;
+ t7[19] = 2.1639578187519790 * x[54];
+ f55 = 2.4141600002500763 * x[55];
+ t7[17] = 0 - f55;
+ t7[15] = 2.7316450287739396 * x[56];
+ f57 = 3.1474621917819090 * x[57];
+ t7[13] = 0 - f57;
+ t7[11] = 3.7152427383269746 * x[58];
+ f59 = 4.5362909369693565 * x[59];
+ t7[9] = 0 - f59;
+ t7[7] = 5.8276883778446544 * x[60];
+ f61 = 8.1538486024668142 * x[61];
+ t7[5] = 0 - f61;
+ t7[3] = 13.5842902572844600 * x[62];
+ f63 = 40.7446881033518340 * x[63];
+ t7[1] = 0 - f63;
+ for (i0=0; i0<32; i0++)
+ {
+ t6[2*i0+1] = t7[2*i0] - t7[2*i0+1];
+ t6[2*i0] = t7[2*i0] + t7[2*i0+1];
+ }
+ f66 = t6[0] - t6[62];
+ f67 = t6[0] + t6[62];
+ f68 = t6[2] - t6[60];
+ f69 = t6[2] + t6[60];
+ f70 = t6[4] - t6[58];
+ f71 = t6[4] + t6[58];
+ f72 = t6[6] - t6[56];
+ f73 = t6[6] + t6[56];
+ f74 = t6[8] - t6[54];
+ f75 = t6[8] + t6[54];
+ f76 = t6[10] - t6[52];
+ f77 = t6[10] + t6[52];
+ f78 = t6[12] - t6[50];
+ f79 = t6[12] + t6[50];
+ f80 = t6[14] - t6[48];
+ f81 = t6[14] + t6[48];
+ f82 = t6[16] - t6[46];
+ f83 = t6[16] + t6[46];
+ f84 = t6[18] - t6[44];
+ f85 = t6[18] + t6[44];
+ f86 = t6[20] - t6[42];
+ f87 = t6[20] + t6[42];
+ f88 = t6[22] - t6[40];
+ f89 = t6[22] + t6[40];
+ f90 = t6[24] - t6[38];
+ f91 = t6[24] + t6[38];
+ f92 = t6[26] - t6[36];
+ f93 = t6[26] + t6[36];
+ f94 = t6[28] - t6[34];
+ f95 = t6[28] + t6[34];
+ f96 = t6[30] - t6[32];
+ f97 = t6[30] + t6[32];
+ f98 = f67 - f97;
+ f99 = f67 + f97;
+ f100 = f69 - f95;
+ f101 = f69 + f95;
+ f102 = f71 - f93;
+ f103 = f71 + f93;
+ f104 = f73 - f91;
+ f105 = f73 + f91;
+ f106 = f75 - f89;
+ f107 = f75 + f89;
+ f108 = f77 - f87;
+ f109 = f77 + f87;
+ f110 = f79 - f85;
+ f111 = f79 + f85;
+ f112 = f81 - f83;
+ f113 = f81 + f83;
+ f114 = f99 - f113;
+ f115 = f99 + f113;
+ f116 = f101 - f111;
+ f117 = f101 + f111;
+ f118 = f103 - f109;
+ f119 = f103 + f109;
+ f120 = f105 - f107;
+ f121 = f105 + f107;
+ f122 = f115 - f121;
+ f123 = f115 + f121;
+ f124 = f117 - f119;
+ f125 = f117 + f119;
+ f126 = f123 - f125;
+ f127 = f123 + f125;
+ f128 = 0.7071067811865476 * f126;
+ f129 = f122 + f124;
+ f130 = 1.3065629648763766 * f122;
+ f131 = (-0.9238795325112866) * f129;
+ f132 = (-0.5411961001461967) * f124;
+ f133 = f130 + f131;
+ f134 = f132 - f131;
+ f135 = f116 - f118;
+ f136 = f116 + f118;
+ f137 = 0.7071067811865476 * f136;
+ f138 = 0.7071067811865476 * f135;
+ f139 = f114 - f137;
+ f140 = f114 + f137;
+ f141 = f120 - f138;
+ f142 = f120 + f138;
+ f143 = f142 + f140;
+ f144 = (-0.7856949583871021) * f142;
+ f145 = 0.9807852804032304 * f143;
+ f146 = 1.1758756024193588 * f140;
+ f147 = f144 + f145;
+ f148 = f146 - f145;
+ f149 = f141 + f139;
+ f150 = 0.2758993792829431 * f141;
+ f151 = 0.5555702330196022 * f149;
+ f152 = 1.3870398453221475 * f139;
+ f153 = f150 + f151;
+ f154 = f152 - f151;
+ f155 = f100 - f102;
+ f156 = f100 + f102;
+ f157 = f104 - f106;
+ f158 = f104 + f106;
+ f159 = f108 - f110;
+ f160 = f108 + f110;
+ f161 = 0.7071067811865476 * f158;
+ f162 = f98 - f161;
+ f163 = f98 + f161;
+ f164 = f156 + f160;
+ f165 = 1.3065629648763766 * f156;
+ f166 = (-0.9238795325112866) * f164;
+ f167 = (-0.5411961001461967) * f160;
+ f168 = f165 + f166;
+ f169 = f167 - f166;
+ f170 = f163 - f169;
+ f171 = f163 + f169;
+ f172 = f162 - f168;
+ f173 = f162 + f168;
+ f174 = f155 + f159;
+ f175 = 1.3065629648763770 * f155;
+ f176 = (-0.3826834323650904) * f174;
+ f177 = 0.5411961001461961 * f159;
+ f178 = f175 + f176;
+ f179 = f177 - f176;
+ f180 = 0.7071067811865476 * f157;
+ f181 = f180 - f112;
+ f182 = f180 + f112;
+ f183 = f179 - f182;
+ f184 = f179 + f182;
+ f185 = f178 - f181;
+ f186 = f178 + f181;
+ f187 = f184 + f171;
+ f188 = (-0.8971675863426361) * f184;
+ f189 = 0.9951847266721968 * f187;
+ f190 = 1.0932018670017576 * f171;
+ f191 = f188 + f189;
+ f192 = f190 - f189;
+ f193 = f186 + f173;
+ f194 = (-0.6666556584777466) * f186;
+ f195 = 0.9569403357322089 * f193;
+ f196 = 1.2472250129866713 * f173;
+ f197 = f194 + f195;
+ f198 = f196 - f195;
+ f199 = f185 + f172;
+ f200 = (-0.4105245275223571) * f185;
+ f201 = 0.8819212643483549 * f199;
+ f202 = 1.3533180011743529 * f172;
+ f203 = f200 + f201;
+ f204 = f202 - f201;
+ f205 = f183 + f170;
+ f206 = (-0.1386171691990915) * f183;
+ f207 = 0.7730104533627370 * f205;
+ f208 = 1.4074037375263826 * f170;
+ f209 = f206 + f207;
+ f210 = f208 - f207;
+ f211 = f66 + f96;
+ f212 = 1.0478631305325901 * f66;
+ f213 = (-0.9987954562051724) * f211;
+ f214 = (-0.9497277818777548) * f96;
+ f215 = f212 + f213;
+ f216 = f214 - f213;
+ f217 = f70 + f92;
+ f218 = 1.2130114330978077 * f70;
+ f219 = (-0.9700312531945440) * f217;
+ f220 = (-0.7270510732912803) * f92;
+ f221 = f218 + f219;
+ f222 = f220 - f219;
+ f223 = f74 + f88;
+ f224 = 1.3315443865537255 * f74;
+ f225 = (-0.9039892931234433) * f223;
+ f226 = (-0.4764341996931612) * f88;
+ f227 = f224 + f225;
+ f228 = f226 - f225;
+ f229 = f78 + f84;
+ f230 = 1.3989068359730781 * f78;
+ f231 = (-0.8032075314806453) * f229;
+ f232 = (-0.2075082269882124) * f84;
+ f233 = f230 + f231;
+ f234 = f232 - f231;
+ f235 = f82 + f80;
+ f236 = 1.4125100802019777 * f82;
+ f237 = (-0.6715589548470187) * f235;
+ f238 = 0.0693921705079402 * f80;
+ f239 = f236 + f237;
+ f240 = f238 - f237;
+ f241 = f86 + f76;
+ f242 = 1.3718313541934939 * f86;
+ f243 = (-0.5141027441932219) * f241;
+ f244 = 0.3436258658070501 * f76;
+ f245 = f242 + f243;
+ f246 = f244 - f243;
+ f247 = f90 + f72;
+ f248 = 1.2784339185752409 * f90;
+ f249 = (-0.3368898533922200) * f247;
+ f250 = 0.6046542117908008 * f72;
+ f251 = f248 + f249;
+ f252 = f250 - f249;
+ f253 = f94 + f68;
+ f254 = 1.1359069844201433 * f94;
+ f255 = (-0.1467304744553624) * f253;
+ f256 = 0.8424460355094185 * f68;
+ f257 = f254 + f255;
+ f258 = f256 - f255;
+ f259 = f216 - f240;
+ f260 = f216 + f240;
+ f261 = f215 - f239;
+ f262 = f215 + f239;
+ f263 = f222 - f246;
+ f264 = f222 + f246;
+ f265 = f221 - f245;
+ f266 = f221 + f245;
+ f267 = f228 - f252;
+ f268 = f228 + f252;
+ f269 = f227 - f251;
+ f270 = f227 + f251;
+ f271 = f234 - f258;
+ f272 = f234 + f258;
+ f273 = f233 - f257;
+ f274 = f233 + f257;
+ f275 = f259 + f261;
+ f276 = 1.1758756024193588 * f259;
+ f277 = (-0.9807852804032304) * f275;
+ f278 = (-0.7856949583871021) * f261;
+ f279 = f276 + f277;
+ f280 = f278 - f277;
+ f281 = f263 + f265;
+ f282 = 1.3870398453221475 * f263;
+ f283 = (-0.5555702330196022) * f281;
+ f284 = 0.2758993792829431 * f265;
+ f285 = f282 + f283;
+ f286 = f284 - f283;
+ f287 = f267 + f269;
+ f288 = 0.7856949583871022 * f267;
+ f289 = 0.1950903220161283 * f287;
+ f290 = 1.1758756024193586 * f269;
+ f291 = f288 + f289;
+ f292 = f290 - f289;
+ f293 = f271 + f273;
+ f294 = (-0.2758993792829430) * f271;
+ f295 = 0.8314696123025452 * f293;
+ f296 = 1.3870398453221475 * f273;
+ f297 = f294 + f295;
+ f298 = f296 - f295;
+ f299 = f260 - f268;
+ f300 = f260 + f268;
+ f301 = f262 - f270;
+ f302 = f262 + f270;
+ f303 = f264 - f272;
+ f304 = f264 + f272;
+ f305 = f266 - f274;
+ f306 = f266 + f274;
+ f307 = f280 - f292;
+ f308 = f280 + f292;
+ f309 = f279 - f291;
+ f310 = f279 + f291;
+ f311 = f286 - f298;
+ f312 = f286 + f298;
+ f313 = f285 - f297;
+ f314 = f285 + f297;
+ f315 = f299 + f301;
+ f316 = 1.3065629648763766 * f299;
+ f317 = (-0.9238795325112866) * f315;
+ f318 = (-0.5411961001461967) * f301;
+ f319 = f316 + f317;
+ f320 = f318 - f317;
+ f321 = f303 + f305;
+ f322 = 0.5411961001461969 * f303;
+ f323 = 0.3826834323650898 * f321;
+ f324 = 1.3065629648763766 * f305;
+ f325 = f322 + f323;
+ f326 = f324 - f323;
+ f327 = f307 + f309;
+ f328 = 1.3065629648763766 * f307;
+ f329 = (-0.9238795325112866) * f327;
+ f330 = (-0.5411961001461967) * f309;
+ f331 = f328 + f329;
+ f332 = f330 - f329;
+ f333 = f311 + f313;
+ f334 = 0.5411961001461969 * f311;
+ f335 = 0.3826834323650898 * f333;
+ f336 = 1.3065629648763766 * f313;
+ f337 = f334 + f335;
+ f338 = f336 - f335;
+ f339 = f300 - f304;
+ f340 = f300 + f304;
+ f341 = f302 - f306;
+ f342 = f302 + f306;
+ f343 = f320 - f326;
+ f344 = f320 + f326;
+ f345 = f319 - f325;
+ f346 = f319 + f325;
+ f347 = f308 - f312;
+ f348 = f308 + f312;
+ f349 = f310 - f314;
+ f350 = f310 + f314;
+ f351 = f332 - f338;
+ f352 = f332 + f338;
+ f353 = f331 - f337;
+ f354 = f331 + f337;
+ f355 = f339 - f341;
+ f356 = f339 + f341;
+ f357 = 0.7071067811865474 * f355;
+ f358 = 0.7071067811865474 * f356;
+ f359 = f343 - f345;
+ f360 = f343 + f345;
+ f361 = 0.7071067811865474 * f359;
+ f362 = 0.7071067811865474 * f360;
+ f363 = f347 - f349;
+ f364 = f347 + f349;
+ f365 = 0.7071067811865474 * f363;
+ f366 = 0.7071067811865474 * f364;
+ f367 = f351 - f353;
+ f368 = f351 + f353;
+ f369 = 0.7071067811865474 * f367;
+ f370 = 0.7071067811865474 * f368;
+ f371 = t6[31] - t6[33];
+ f372 = t6[31] + t6[33];
+ f373 = 0.7071067811865476 * f372;
+ f374 = 0.7071067811865476 * f371;
+ f375 = t6[17] - t6[47];
+ f376 = t6[17] + t6[47];
+ f377 = 0.7071067811865476 * f376;
+ f378 = 0.7071067811865476 * f375;
+ f379 = t6[25] - t6[39];
+ f380 = t6[25] + t6[39];
+ f381 = 0.7071067811865476 * f380;
+ f382 = 0.7071067811865476 * f379;
+ f383 = t6[23] - t6[41];
+ f384 = t6[23] + t6[41];
+ f385 = 0.7071067811865476 * f384;
+ f386 = 0.7071067811865476 * f383;
+ f387 = t6[29] - t6[35];
+ f388 = t6[29] + t6[35];
+ f389 = 0.7071067811865476 * f388;
+ f390 = 0.7071067811865476 * f387;
+ f391 = t6[19] - t6[45];
+ f392 = t6[19] + t6[45];
+ f393 = 0.7071067811865476 * f392;
+ f394 = 0.7071067811865476 * f391;
+ f395 = t6[27] - t6[37];
+ f396 = t6[27] + t6[37];
+ f397 = 0.7071067811865476 * f396;
+ f398 = 0.7071067811865476 * f395;
+ f399 = t6[21] - t6[43];
+ f400 = t6[21] + t6[43];
+ f401 = 0.7071067811865476 * f400;
+ f402 = 0.7071067811865476 * f399;
+ f403 = t6[1] - f373;
+ f404 = t6[1] + f373;
+ f405 = t6[63] - f374;
+ f406 = t6[63] + f374;
+ f407 = t6[15] - f377;
+ f408 = t6[15] + f377;
+ f409 = t6[49] - f378;
+ f410 = t6[49] + f378;
+ f411 = t6[7] - f381;
+ f412 = t6[7] + f381;
+ f413 = t6[57] - f382;
+ f414 = t6[57] + f382;
+ f415 = t6[9] - f385;
+ f416 = t6[9] + f385;
+ f417 = t6[55] - f386;
+ f418 = t6[55] + f386;
+ f419 = t6[3] - f389;
+ f420 = t6[3] + f389;
+ f421 = t6[61] - f390;
+ f422 = t6[61] + f390;
+ f423 = t6[13] - f393;
+ f424 = t6[13] + f393;
+ f425 = t6[51] - f394;
+ f426 = t6[51] + f394;
+ f427 = t6[5] - f397;
+ f428 = t6[5] + f397;
+ f429 = t6[59] - f398;
+ f430 = t6[59] + f398;
+ f431 = t6[11] - f401;
+ f432 = t6[11] + f401;
+ f433 = t6[53] - f402;
+ f434 = t6[53] + f402;
+ f435 = f410 + f408;
+ f436 = (-0.5411961001461969) * f410;
+ f437 = 0.9238795325112867 * f435;
+ f438 = 1.3065629648763766 * f408;
+ f439 = f436 + f437;
+ f440 = f438 - f437;
+ f441 = f409 + f407;
+ f442 = 1.3065629648763770 * f409;
+ f443 = (-0.3826834323650904) * f441;
+ f444 = 0.5411961001461961 * f407;
+ f445 = f442 + f443;
+ f446 = f444 - f443;
+ f447 = f418 + f416;
+ f448 = (-0.5411961001461969) * f418;
+ f449 = 0.9238795325112867 * f447;
+ f450 = 1.3065629648763766 * f416;
+ f451 = f448 + f449;
+ f452 = f450 - f449;
+ f453 = f417 + f415;
+ f454 = 1.3065629648763770 * f417;
+ f455 = (-0.3826834323650904) * f453;
+ f456 = 0.5411961001461961 * f415;
+ f457 = f454 + f455;
+ f458 = f456 - f455;
+ f459 = f426 + f424;
+ f460 = (-0.5411961001461969) * f426;
+ f461 = 0.9238795325112867 * f459;
+ f462 = 1.3065629648763766 * f424;
+ f463 = f460 + f461;
+ f464 = f462 - f461;
+ f465 = f425 + f423;
+ f466 = 1.3065629648763770 * f425;
+ f467 = (-0.3826834323650904) * f465;
+ f468 = 0.5411961001461961 * f423;
+ f469 = f466 + f467;
+ f470 = f468 - f467;
+ f471 = f434 + f432;
+ f472 = (-0.5411961001461969) * f434;
+ f473 = 0.9238795325112867 * f471;
+ f474 = 1.3065629648763766 * f432;
+ f475 = f472 + f473;
+ f476 = f474 - f473;
+ f477 = f433 + f431;
+ f478 = 1.3065629648763770 * f433;
+ f479 = (-0.3826834323650904) * f477;
+ f480 = 0.5411961001461961 * f431;
+ f481 = f478 + f479;
+ f482 = f480 - f479;
+ f483 = f404 - f439;
+ f484 = f404 + f439;
+ f485 = f406 - f440;
+ f486 = f406 + f440;
+ f487 = f403 - f445;
+ f488 = f403 + f445;
+ f489 = f405 - f446;
+ f490 = f405 + f446;
+ f491 = f412 - f451;
+ f492 = f412 + f451;
+ f493 = f414 - f452;
+ f494 = f414 + f452;
+ f495 = f411 - f457;
+ f496 = f411 + f457;
+ f497 = f413 - f458;
+ f498 = f413 + f458;
+ f499 = f420 - f463;
+ f500 = f420 + f463;
+ f501 = f422 - f464;
+ f502 = f422 + f464;
+ f503 = f419 - f469;
+ f504 = f419 + f469;
+ f505 = f421 - f470;
+ f506 = f421 + f470;
+ f507 = f428 - f475;
+ f508 = f428 + f475;
+ f509 = f430 - f476;
+ f510 = f430 + f476;
+ f511 = f427 - f481;
+ f512 = f427 + f481;
+ f513 = f429 - f482;
+ f514 = f429 + f482;
+ f515 = f494 + f492;
+ f516 = (-0.7856949583871021) * f494;
+ f517 = 0.9807852804032304 * f515;
+ f518 = 1.1758756024193588 * f492;
+ f519 = f516 + f517;
+ f520 = f518 - f517;
+ f521 = f498 + f496;
+ f522 = 0.2758993792829431 * f498;
+ f523 = 0.5555702330196022 * f521;
+ f524 = 1.3870398453221475 * f496;
+ f525 = f522 + f523;
+ f526 = f524 - f523;
+ f527 = f493 + f491;
+ f528 = 1.1758756024193591 * f493;
+ f529 = (-0.1950903220161287) * f527;
+ f530 = 0.7856949583871016 * f491;
+ f531 = f528 + f529;
+ f532 = f530 - f529;
+ f533 = f497 + f495;
+ f534 = 1.3870398453221473 * f497;
+ f535 = (-0.8314696123025455) * f533;
+ f536 = (-0.2758993792829436) * f495;
+ f537 = f534 + f535;
+ f538 = f536 - f535;
+ f539 = f510 + f508;
+ f540 = (-0.7856949583871021) * f510;
+ f541 = 0.9807852804032304 * f539;
+ f542 = 1.1758756024193588 * f508;
+ f543 = f540 + f541;
+ f544 = f542 - f541;
+ f545 = f514 + f512;
+ f546 = 0.2758993792829431 * f514;
+ f547 = 0.5555702330196022 * f545;
+ f548 = 1.3870398453221475 * f512;
+ f549 = f546 + f547;
+ f550 = f548 - f547;
+ f551 = f509 + f507;
+ f552 = 1.1758756024193591 * f509;
+ f553 = (-0.1950903220161287) * f551;
+ f554 = 0.7856949583871016 * f507;
+ f555 = f552 + f553;
+ f556 = f554 - f553;
+ f557 = f513 + f511;
+ f558 = 1.3870398453221473 * f513;
+ f559 = (-0.8314696123025455) * f557;
+ f560 = (-0.2758993792829436) * f511;
+ f561 = f558 + f559;
+ f562 = f560 - f559;
+ f563 = f484 - f519;
+ f564 = f484 + f519;
+ f565 = f486 - f520;
+ f566 = f486 + f520;
+ f567 = f488 - f525;
+ f568 = f488 + f525;
+ f569 = f490 - f526;
+ f570 = f490 + f526;
+ f571 = f483 - f531;
+ f572 = f483 + f531;
+ f573 = f485 - f532;
+ f574 = f485 + f532;
+ f575 = f487 - f537;
+ f576 = f487 + f537;
+ f577 = f489 - f538;
+ f578 = f489 + f538;
+ f579 = f500 - f543;
+ f580 = f500 + f543;
+ f581 = f502 - f544;
+ f582 = f502 + f544;
+ f583 = f504 - f549;
+ f584 = f504 + f549;
+ f585 = f506 - f550;
+ f586 = f506 + f550;
+ f587 = f499 - f555;
+ f588 = f499 + f555;
+ f589 = f501 - f556;
+ f590 = f501 + f556;
+ f591 = f503 - f561;
+ f592 = f503 + f561;
+ f593 = f505 - f562;
+ f594 = f505 + f562;
+ f595 = f582 + f580;
+ f596 = (-0.8971675863426361) * f582;
+ f597 = 0.9951847266721968 * f595;
+ f598 = 1.0932018670017576 * f580;
+ f599 = f596 + f597;
+ f600 = f598 - f597;
+ f601 = f586 + f584;
+ f602 = (-0.4105245275223571) * f586;
+ f603 = 0.8819212643483549 * f601;
+ f604 = 1.3533180011743529 * f584;
+ f605 = f602 + f603;
+ f606 = f604 - f603;
+ f607 = f590 + f588;
+ f608 = 0.1386171691990915 * f590;
+ f609 = 0.6343932841636455 * f607;
+ f610 = 1.4074037375263826 * f588;
+ f611 = f608 + f609;
+ f612 = f610 - f609;
+ f613 = f594 + f592;
+ f614 = 0.6666556584777466 * f594;
+ f615 = 0.2902846772544623 * f613;
+ f616 = 1.2472250129866711 * f592;
+ f617 = f614 + f615;
+ f618 = f616 - f615;
+ f619 = f581 + f579;
+ f620 = 1.0932018670017574 * f581;
+ f621 = (-0.0980171403295605) * f619;
+ f622 = 0.8971675863426364 * f579;
+ f623 = f620 + f621;
+ f624 = f622 - f621;
+ f625 = f585 + f583;
+ f626 = 1.3533180011743529 * f585;
+ f627 = (-0.4713967368259979) * f625;
+ f628 = 0.4105245275223569 * f583;
+ f629 = f626 + f627;
+ f630 = f628 - f627;
+ f631 = f589 + f587;
+ f632 = 1.4074037375263826 * f589;
+ f633 = (-0.7730104533627369) * f631;
+ f634 = (-0.1386171691990913) * f587;
+ f635 = f632 + f633;
+ f636 = f634 - f633;
+ f637 = f593 + f591;
+ f638 = 1.2472250129866711 * f593;
+ f639 = (-0.9569403357322089) * f637;
+ f640 = (-0.6666556584777469) * f591;
+ f641 = f638 + f639;
+ f642 = f640 - f639;
+ f643 = f564 - f599;
+ f644 = f564 + f599;
+ f645 = f566 - f600;
+ f646 = f566 + f600;
+ f647 = f568 - f605;
+ f648 = f568 + f605;
+ f649 = f570 - f606;
+ f650 = f570 + f606;
+ f651 = f572 - f611;
+ f652 = f572 + f611;
+ f653 = f574 - f612;
+ f654 = f574 + f612;
+ f655 = f576 - f617;
+ f656 = f576 + f617;
+ f657 = f578 - f618;
+ f658 = f578 + f618;
+ f659 = f563 - f623;
+ f660 = f563 + f623;
+ f661 = f565 - f624;
+ f662 = f565 + f624;
+ f663 = f567 - f629;
+ f664 = f567 + f629;
+ f665 = f569 - f630;
+ f666 = f569 + f630;
+ f667 = f571 - f635;
+ f668 = f571 + f635;
+ f669 = f573 - f636;
+ f670 = f573 + f636;
+ f671 = f575 - f641;
+ f672 = f575 + f641;
+ f673 = f577 - f642;
+ f674 = f577 + f642;
+ f675 = f646 + f644;
+ f676 = (-0.9751575901732920) * f646;
+ f677 = 0.9996988186962043 * f675;
+ f678 = 1.0242400472191164 * f644;
+ f679 = f676 + f677;
+ t0[63] = f678 - f677;
+ f681 = f650 + f648;
+ f682 = (-0.8700688593994936) * f650;
+ f683 = 0.9924795345987100 * f681;
+ f684 = 1.1148902097979263 * f648;
+ f685 = f682 + f683;
+ f686 = f684 - f683;
+ f687 = f654 + f652;
+ f688 = (-0.7566008898816587) * f654;
+ f689 = 0.9757021300385286 * f687;
+ f690 = 1.1948033701953984 * f652;
+ f691 = f688 + f689;
+ f692 = f690 - f689;
+ f693 = f658 + f656;
+ f694 = (-0.6358464401941451) * f658;
+ f695 = 0.9495281805930367 * f693;
+ f696 = 1.2632099209919283 * f656;
+ f697 = f694 + f695;
+ f698 = f696 - f695;
+ f699 = f662 + f660;
+ f700 = (-0.5089684416985408) * f662;
+ f701 = 0.9142097557035307 * f699;
+ f702 = 1.3194510697085207 * f660;
+ f703 = f700 + f701;
+ f704 = f702 - f701;
+ f705 = f666 + f664;
+ f706 = (-0.3771887988789273) * f666;
+ f707 = 0.8700869911087114 * f705;
+ f708 = 1.3629851833384954 * f664;
+ f709 = f706 + f707;
+ f710 = f708 - f707;
+ f711 = f670 + f668;
+ f712 = (-0.2417766217337384) * f670;
+ f713 = 0.8175848131515837 * f711;
+ f714 = 1.3933930045694289 * f668;
+ f715 = f712 + f713;
+ f716 = f714 - f713;
+ f717 = f674 + f672;
+ f718 = (-0.1040360035527077) * f674;
+ f719 = 0.7572088465064845 * f717;
+ f720 = 1.4103816894602612 * f672;
+ f721 = f718 + f719;
+ f722 = f720 - f719;
+ f723 = f645 + f643;
+ f724 = 0.0347065382144002 * f645;
+ f725 = 0.6895405447370668 * f723;
+ f726 = 1.4137876276885337 * f643;
+ f727 = f724 + f725;
+ f728 = f726 - f725;
+ f729 = f649 + f647;
+ f730 = 0.1731148370459795 * f649;
+ f731 = 0.6152315905806268 * f729;
+ f732 = 1.4035780182072330 * f647;
+ f733 = f730 + f731;
+ f734 = f732 - f731;
+ f735 = f653 + f651;
+ f736 = 0.3098559453626100 * f653;
+ f737 = 0.5349976198870972 * f735;
+ f738 = 1.3798511851368043 * f651;
+ f739 = f736 + f737;
+ f740 = f738 - f737;
+ f741 = f657 + f655;
+ f742 = 0.4436129715409088 * f657;
+ f743 = 0.4496113296546065 * f741;
+ f744 = 1.3428356308501219 * f655;
+ f745 = f742 + f743;
+ f746 = f744 - f743;
+ f747 = f661 + f659;
+ f748 = 0.5730977622997509 * f661;
+ f749 = 0.3598950365349881 * f747;
+ f750 = 1.2928878353697271 * f659;
+ f751 = f748 + f749;
+ f752 = f750 - f749;
+ f753 = f665 + f663;
+ f754 = 0.6970633083205415 * f665;
+ f755 = 0.2667127574748984 * f753;
+ f756 = 1.2304888232703382 * f663;
+ f757 = f754 + f755;
+ f758 = f756 - f755;
+ f759 = f669 + f667;
+ f760 = 0.8143157536286401 * f669;
+ f761 = 0.1709618887603012 * f759;
+ f762 = 1.1562395311492424 * f667;
+ f763 = f760 + f761;
+ f764 = f762 - f761;
+ f765 = f673 + f671;
+ f766 = 0.9237258930790228 * f673;
+ f767 = 0.0735645635996674 * f765;
+ f768 = 1.0708550202783576 * f671;
+ f769 = f766 + f767;
+ f770 = f768 - f767;
+ t0[0] = f127 + f679;
+ t0[1] = f679 + f340;
+ t0[2] = f340 + f770;
+ t0[3] = f770 + f191;
+ t0[4] = f191 + f685;
+ t0[5] = f685 + f348;
+ t0[6] = f348 + f764;
+ t0[7] = f764 + f147;
+ t0[8] = f147 + f691;
+ t0[9] = f691 + f352;
+ t0[10] = f352 + f758;
+ t0[11] = f758 + f197;
+ t0[12] = f197 + f697;
+ t0[13] = f697 + f344;
+ t0[14] = f344 + f752;
+ t0[15] = f752 + f134;
+ t0[16] = f134 + f703;
+ t0[17] = f703 + f362;
+ t0[18] = f362 + f746;
+ t0[19] = f746 + f203;
+ t0[20] = f203 + f709;
+ t0[21] = f709 + f370;
+ t0[22] = f370 + f740;
+ t0[23] = f740 + f154;
+ t0[24] = f154 + f715;
+ t0[25] = f715 + f366;
+ t0[26] = f366 + f734;
+ t0[27] = f734 + f209;
+ t0[28] = f209 + f721;
+ t0[29] = f721 + f358;
+ t0[30] = f358 + f728;
+ t0[31] = f728 + f128;
+ t0[32] = f128 + f727;
+ t0[33] = f727 + f357;
+ t0[34] = f357 + f722;
+ t0[35] = f722 + f210;
+ t0[36] = f210 + f733;
+ t0[37] = f733 + f365;
+ t0[38] = f365 + f716;
+ t0[39] = f716 + f153;
+ t0[40] = f153 + f739;
+ t0[41] = f739 + f369;
+ t0[42] = f369 + f710;
+ t0[43] = f710 + f204;
+ t0[44] = f204 + f745;
+ t0[45] = f745 + f361;
+ t0[46] = f361 + f704;
+ t0[47] = f704 + f133;
+ t0[48] = f133 + f751;
+ t0[49] = f751 + f346;
+ t0[50] = f346 + f698;
+ t0[51] = f698 + f198;
+ t0[52] = f198 + f757;
+ t0[53] = f757 + f354;
+ t0[54] = f354 + f692;
+ t0[55] = f692 + f148;
+ t0[56] = f148 + f763;
+ t0[57] = f763 + f350;
+ t0[58] = f350 + f686;
+ t0[59] = f686 + f192;
+ t0[60] = f192 + f769;
+ t0[61] = f769 + f342;
+ t0[62] = f342 + t0[63];
+ for (i0=0; i0<64; i0++)
+ {
+ y[i0] = t0[-i0+63];
+ }
+}
+
+#endif
+
+#endif
+
--- /dev/null
+++ b/libfaad/sbr_dct.h
@@ -1,0 +1,45 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_dct.h,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_DCT_H__
+#define __SBR_DCT_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void DCT3_32_unscaled(real_t *y, real_t *x);
+void DCT2_64_unscaled(real_t *y, real_t *x);
+void DCT4_64(real_t *y, real_t *x);
+void DST4_64(real_t *y, real_t *x);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
--- /dev/null
+++ b/libfaad/sbr_dec.c
@@ -1,0 +1,357 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_dec.c,v 1.5 2003/07/29 08:20:13 menno Exp $
+**/
+
+/*
+ SBR Decoder overview:
+
+ To achieve a synchronized output signal, the following steps have to be
+ acknowledged in the decoder:
+ - The bitstream parser divides the bitstream into two parts; the AAC
+ core coder part and the SBR part.
+ - The SBR bitstream part is fed to the bitstream de-multiplexer followed
+ by de-quantization The raw data is Huffman decoded.
+ - The AAC bitstream part is fed to the AAC core decoder, where the
+ bitstream data of the current frame is decoded, yielding a time domain
+ audio signal block of 1024 samples. The block length could easily be
+ adapted to other sizes e.g. 960.
+ - The core coder audio block is fed to the analysis QMF bank using a
+ delay of 1312 samples.
+ - The analysis QMF bank performs the filtering of the delayed core coder
+ audio signal. The output from the filtering is stored in the matrix
+ Xlow. The output from the analysis QMF bank is delayed tHFGen subband
+ samples, before being fed to the synthesis QMF bank. To achieve
+ synchronization tHFGen = 32, i.e. the value must equal the number of
+ subband samples corresponding to one frame.
+ - The HF generator calculates XHigh given the matrix XLow. The process
+ is guided by the SBR data contained in the current frame.
+ - The envelope adjuster calculates the matrix Y given the matrix XHigh
+ and the SBR envelope data, extracted from the SBR bitstream. To
+ achieve synchronization, tHFAdj has to be set to tHFAdj = 0, i.e. the
+ envelope adjuster operates on data delayed tHFGen subband samples.
+ - The synthesis QMF bank operates on the delayed output from the analysis
+ QMF bank and the output from the envelope adjuster.
+ */
+
+#include "common.h"
+#include "structs.h"
+
+#ifdef SBR_DEC
+
+#include <stdlib.h>
+
+#include "syntax.h"
+#include "bits.h"
+#include "sbr_syntax.h"
+#include "sbr_qmf.h"
+#include "sbr_hfgen.h"
+#include "sbr_hfadj.h"
+
+
+sbr_info *sbrDecodeInit()
+{
+ sbr_info *sbr = malloc(sizeof(sbr_info));
+ memset(sbr, 0, sizeof(sbr_info));
+
+ sbr->bs_freq_scale = 2;
+ sbr->bs_alter_scale = 1;
+ sbr->bs_noise_bands = 2;
+ sbr->bs_limiter_bands = 2;
+ sbr->bs_limiter_gains = 2;
+ sbr->bs_interpol_freq = 1;
+ sbr->bs_smoothing_mode = 1;
+ sbr->bs_start_freq = 5;
+ sbr->bs_amp_res = 1;
+ sbr->bs_samplerate_mode = 1;
+ sbr->prevEnvIsShort[0] = -1;
+ sbr->prevEnvIsShort[1] = -1;
+ sbr->header_count = 0;
+
+ return sbr;
+}
+
+void sbrDecodeEnd(sbr_info *sbr)
+{
+ uint8_t j;
+
+ if (sbr)
+ {
+ qmfa_end(sbr->qmfa[0]);
+ qmfs_end(sbr->qmfs[0]);
+ if (sbr->id_aac == ID_CPE)
+ {
+ qmfa_end(sbr->qmfa[1]);
+ qmfs_end(sbr->qmfs[1]);
+ }
+
+ if (sbr->Xcodec[0]) free(sbr->Xcodec[0]);
+ if (sbr->Xsbr[0]) free(sbr->Xsbr[0]);
+ if (sbr->Xcodec[1]) free(sbr->Xcodec[1]);
+ if (sbr->Xsbr[1]) free(sbr->Xsbr[1]);
+
+ for (j = 0; j < 5; j++)
+ {
+ if (sbr->G_temp_prev[0][j]) free(sbr->G_temp_prev[0][j]);
+ if (sbr->Q_temp_prev[0][j]) free(sbr->Q_temp_prev[0][j]);
+ if (sbr->G_temp_prev[1][j]) free(sbr->G_temp_prev[1][j]);
+ if (sbr->Q_temp_prev[1][j]) free(sbr->Q_temp_prev[1][j]);
+ }
+
+ free(sbr);
+ }
+}
+
+void sbr_save_prev_data(sbr_info *sbr, uint8_t ch)
+{
+ uint8_t i;
+
+ /* save data for next frame */
+ sbr->kx_prev = sbr->kx;
+
+ sbr->L_E_prev[ch] = sbr->L_E[ch];
+
+ sbr->f_prev[ch] = sbr->f[ch][sbr->L_E[ch] - 1];
+ for (i = 0; i < 64; i++)
+ {
+ sbr->E_prev[ch][i] = sbr->E[ch][i][sbr->L_E[ch] - 1];
+ sbr->Q_prev[ch][i] = sbr->Q[ch][i][sbr->L_Q[ch] - 1];
+ }
+
+ for (i = 0; i < 64; i++)
+ {
+ sbr->bs_add_harmonic_prev[ch][i] = sbr->bs_add_harmonic[ch][i];
+ }
+ sbr->bs_add_harmonic_flag_prev[ch] = sbr->bs_add_harmonic_flag[ch];
+
+ if (sbr->l_A[ch] == sbr->L_E[ch])
+ sbr->prevEnvIsShort[ch] = 0;
+ else
+ sbr->prevEnvIsShort[ch] = -1;
+}
+
+
+void sbrDecodeFrame(sbr_info *sbr, real_t *left_channel,
+ real_t *right_channel, uint8_t id_aac,
+ uint8_t just_seeked)
+{
+ int16_t i, k, l;
+
+ uint8_t dont_process = 0;
+ uint8_t ch, channels, ret;
+ real_t *ch_buf;
+
+ qmf_t X[32*64];
+#ifdef SBR_LOW_POWER
+ real_t deg[64];
+#endif
+
+ bitfile *ld = (bitfile*)malloc(sizeof(bitfile));
+
+
+ sbr->id_aac = id_aac;
+ channels = (id_aac == ID_SCE) ? 1 : 2;
+
+ /* initialise and read the bitstream */
+ faad_initbits(ld, sbr->data, sbr->data_size);
+
+ ret = sbr_extension_data(ld, sbr, id_aac);
+
+ if (sbr->data) free(sbr->data);
+ sbr->data = NULL;
+
+ ret = ld->error ? ld->error : ret;
+ faad_endbits(ld);
+ if (ld) free(ld);
+ ld = NULL;
+ if (ret || (sbr->header_count == 0))
+ {
+ /* don't process just upsample */
+ dont_process = 1;
+ }
+
+ if (just_seeked)
+ sbr->just_seeked = 1;
+ else
+ sbr->just_seeked = 0;
+
+ for (ch = 0; ch < channels; ch++)
+ {
+ if (sbr->frame == 0)
+ {
+ uint8_t j;
+ sbr->qmfa[ch] = qmfa_init(32);
+ sbr->qmfs[ch] = qmfs_init(64);
+
+ for (j = 0; j < 5; j++)
+ {
+ sbr->G_temp_prev[ch][j] = malloc(64*sizeof(real_t));
+ sbr->Q_temp_prev[ch][j] = malloc(64*sizeof(real_t));
+ }
+
+ sbr->Xsbr[ch] = malloc((32+tHFGen)*64 * sizeof(qmf_t));
+ sbr->Xcodec[ch] = malloc((32+tHFGen)*32 * sizeof(qmf_t));
+
+ memset(sbr->Xsbr[ch], 0, (32+tHFGen)*64 * sizeof(qmf_t));
+ memset(sbr->Xcodec[ch], 0, (32+tHFGen)*32 * sizeof(qmf_t));
+ }
+
+ if (ch == 0)
+ ch_buf = left_channel;
+ else
+ ch_buf = right_channel;
+
+ for (i = 0; i < tHFAdj; i++)
+ {
+ int8_t j;
+ for (j = sbr->kx_prev; j < sbr->kx; j++)
+ {
+ QMF_RE(sbr->Xcodec[ch][i*32 + j]) = 0;
+#ifndef SBR_LOW_POWER
+ QMF_IM(sbr->Xcodec[ch][i*32 + j]) = 0;
+#endif
+ }
+ }
+
+ /* subband analysis */
+ sbr_qmf_analysis_32(sbr->qmfa[ch], ch_buf, sbr->Xcodec[ch], tHFGen);
+
+ if (!dont_process)
+ {
+ /* insert high frequencies here */
+ /* hf generation using patching */
+ hf_generation(sbr, sbr->Xcodec[ch], sbr->Xsbr[ch]
+#ifdef SBR_LOW_POWER
+ ,deg
+#endif
+ ,ch);
+
+#ifdef SBR_LOW_POWER
+ for (l = sbr->t_E[ch][0]; l < sbr->t_E[ch][sbr->L_E[ch]]; l++)
+ {
+ for (k = 0; k < sbr->kx; k++)
+ {
+ QMF_RE(sbr->Xsbr[ch][(tHFAdj + l)*64 + k]) = 0;
+ }
+ }
+#endif
+
+ /* hf adjustment */
+ hf_adjustment(sbr, sbr->Xsbr[ch]
+#ifdef SBR_LOW_POWER
+ ,deg
+#endif
+ ,ch);
+ }
+
+ if ((sbr->just_seeked != 0) || dont_process)
+ {
+ for (l = 0; l < 32; l++)
+ {
+ for (k = 0; k < 32; k++)
+ {
+ QMF_RE(X[l * 64 + k]) = QMF_RE(sbr->Xcodec[ch][(l + tHFAdj)*32 + k]);
+#ifndef SBR_LOW_POWER
+ QMF_IM(X[l * 64 + k]) = QMF_IM(sbr->Xcodec[ch][(l + tHFAdj)*32 + k]);
+#endif
+ }
+ for (k = 32; k < 64; k++)
+ {
+ QMF_RE(X[l * 64 + k]) = 0;
+#ifndef SBR_LOW_POWER
+ QMF_IM(X[l * 64 + k]) = 0;
+#endif
+ }
+ }
+ } else {
+ for (l = 0; l < 32; l++)
+ {
+ uint8_t xover_band;
+
+ if (l < sbr->t_E[ch][0])
+ xover_band = sbr->kx_prev;
+ else
+ xover_band = sbr->kx;
+
+ for (k = 0; k < xover_band; k++)
+ {
+ QMF_RE(X[l * 64 + k]) = QMF_RE(sbr->Xcodec[ch][(l + tHFAdj)*32 + k]);
+#ifndef SBR_LOW_POWER
+ QMF_IM(X[l * 64 + k]) = QMF_IM(sbr->Xcodec[ch][(l + tHFAdj)*32 + k]);
+#endif
+ }
+ for (k = xover_band; k < 64; k++)
+ {
+ QMF_RE(X[l * 64 + k]) = QMF_RE(sbr->Xsbr[ch][(l + tHFAdj)*64 + k]);
+#ifndef SBR_LOW_POWER
+ QMF_IM(X[l * 64 + k]) = QMF_IM(sbr->Xsbr[ch][(l + tHFAdj)*64 + k]);
+#endif
+ }
+#ifdef SBR_LOW_POWER
+ QMF_RE(X[l * 64 + xover_band - 1]) += QMF_RE(sbr->Xsbr[ch][(l + tHFAdj)*64 + xover_band - 1]);
+#endif
+ }
+ }
+
+ /* subband synthesis */
+ sbr_qmf_synthesis_64(sbr->qmfs[ch], (const complex_t*)X, ch_buf);
+
+ for (i = 0; i < 32; i++)
+ {
+ int8_t j;
+ for (j = 0; j < tHFGen; j++)
+ {
+ QMF_RE(sbr->Xcodec[ch][j*32 + i]) = QMF_RE(sbr->Xcodec[ch][(j+32)*32 + i]);
+#ifndef SBR_LOW_POWER
+ QMF_IM(sbr->Xcodec[ch][j*32 + i]) = QMF_IM(sbr->Xcodec[ch][(j+32)*32 + i]);
+#endif
+ }
+ }
+ for (i = 0; i < 64; i++)
+ {
+ int8_t j;
+ for (j = 0; j < tHFGen; j++)
+ {
+ QMF_RE(sbr->Xsbr[ch][j*64 + i]) = QMF_RE(sbr->Xsbr[ch][(j+32)*64 + i]);
+#ifndef SBR_LOW_POWER
+ QMF_IM(sbr->Xsbr[ch][j*64 + i]) = QMF_IM(sbr->Xsbr[ch][(j+32)*64 + i]);
+#endif
+ }
+ }
+ }
+
+ if (sbr->bs_header_flag)
+ sbr->just_seeked = 0;
+
+ if (sbr->header_count != 0)
+ {
+ for (ch = 0; ch < channels; ch++)
+ sbr_save_prev_data(sbr, ch);
+ }
+
+ sbr->frame++;
+}
+
+#endif
--- /dev/null
+++ b/libfaad/sbr_dec.h
@@ -1,0 +1,199 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_dec.h,v 1.4 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_DEC_H__
+#define __SBR_DEC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+#if 0
+ real_t post_exp_re[64];
+ real_t post_exp_im[64];
+#endif
+ real_t *x;
+ uint8_t channels;
+} qmfa_info;
+
+typedef struct {
+ real_t *v;
+ uint8_t channels;
+} qmfs_info;
+
+typedef struct
+{
+ uint32_t sample_rate;
+
+ uint8_t rate;
+ uint8_t just_seeked;
+
+ uint8_t amp_res[2];
+
+ uint8_t k0;
+ uint8_t kx;
+ uint8_t M;
+ uint8_t N_master;
+ uint8_t N_high;
+ uint8_t N_low;
+ uint8_t N_Q;
+ uint8_t N_L[4];
+ uint8_t n[2];
+
+ uint8_t f_master[64];
+ uint8_t f_table_res[2][64];
+ uint8_t f_table_noise[64];
+ uint8_t f_table_lim[4][64];
+#ifdef SBR_LOW_POWER
+ uint8_t f_group[5][64];
+ uint8_t N_G[5];
+#endif
+
+ uint8_t table_map_k_to_g[64];
+
+ uint8_t abs_bord_lead[2];
+ uint8_t abs_bord_trail[2];
+ uint8_t n_rel_lead[2];
+ uint8_t n_rel_trail[2];
+
+ uint8_t L_E[2];
+ uint8_t L_E_prev[2];
+ uint8_t L_Q[2];
+
+ uint8_t t_E[2][6];
+ uint8_t t_Q[2][3];
+ uint8_t f[2][6];
+ uint8_t f_prev[2];
+
+ real_t *G_temp_prev[2][5];
+ real_t *Q_temp_prev[2][5];
+
+ int16_t E[2][64][5];
+ int16_t E_prev[2][64];
+ real_t E_orig[2][64][5];
+ real_t E_curr[2][64][5];
+ int32_t Q[2][64][2];
+ int32_t Q_prev[2][64];
+ real_t Q_orig[2][64][2];
+
+ int8_t l_A[2];
+ int8_t l_A_prev[2];
+
+ uint8_t bs_invf_mode[2][5];
+ uint8_t bs_invf_mode_prev[2][5];
+ real_t bwArray[2][64];
+ real_t bwArray_prev[2][64];
+
+ uint8_t noPatches;
+ uint8_t patchNoSubbands[64];
+ uint8_t patchStartSubband[64];
+
+ uint8_t bs_add_harmonic[2][64];
+ uint8_t bs_add_harmonic_prev[2][64];
+
+ uint16_t index_noise_prev[2];
+ uint8_t psi_is_prev[2];
+
+ uint8_t bs_start_freq_prev;
+ uint8_t bs_stop_freq_prev;
+ uint8_t bs_xover_band_prev;
+ uint8_t bs_freq_scale_prev;
+ uint8_t bs_alter_scale_prev;
+ uint8_t bs_noise_bands_prev;
+
+ int8_t prevEnvIsShort[2];
+
+ int8_t kx_prev;
+
+ uint8_t Reset;
+ uint32_t frame;
+ uint32_t header_count;
+
+ uint8_t *data;
+ uint16_t data_size;
+
+ uint8_t id_aac;
+ qmfa_info *qmfa[2];
+ qmfs_info *qmfs[2];
+
+ qmf_t *Xsbr[2];
+ qmf_t *Xcodec[2];
+
+
+ /* to get it compiling */
+ /* we'll see during the coding of all the tools, whether
+ these are all used or not.
+ */
+ uint8_t bs_header_flag;
+ uint8_t bs_crc_flag;
+ uint16_t bs_sbr_crc_bits;
+ uint8_t bs_protocol_version;
+ uint8_t bs_amp_res;
+ uint8_t bs_start_freq;
+ uint8_t bs_stop_freq;
+ uint8_t bs_xover_band;
+ uint8_t bs_freq_scale;
+ uint8_t bs_alter_scale;
+ uint8_t bs_noise_bands;
+ uint8_t bs_limiter_bands;
+ uint8_t bs_limiter_gains;
+ uint8_t bs_interpol_freq;
+ uint8_t bs_smoothing_mode;
+ uint8_t bs_samplerate_mode;
+ uint8_t bs_add_harmonic_flag[2];
+ uint8_t bs_add_harmonic_flag_prev[2];
+ uint8_t bs_extended_data;
+ uint8_t bs_extension_id;
+ uint8_t bs_extension_data;
+ uint8_t bs_coupling;
+ uint8_t bs_frame_class[2];
+ uint8_t bs_rel_bord[2][9];
+ uint8_t bs_rel_bord_0[2][9];
+ uint8_t bs_rel_bord_1[2][9];
+ uint8_t bs_pointer[2];
+ uint8_t bs_abs_bord_0[2];
+ uint8_t bs_abs_bord_1[2];
+ uint8_t bs_num_rel_0[2];
+ uint8_t bs_num_rel_1[2];
+ uint8_t bs_df_env[2][9];
+ uint8_t bs_df_noise[2][3];
+} sbr_info;
+
+sbr_info *sbrDecodeInit();
+void sbrDecodeEnd(sbr_info *sbr);
+
+void sbrDecodeFrame(sbr_info *sbr, real_t *left_channel,
+ real_t *right_channel, uint8_t id_aac,
+ uint8_t just_seeked);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
--- /dev/null
+++ b/libfaad/sbr_e_nf.c
@@ -1,0 +1,357 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_e_nf.c,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+#include "common.h"
+#include "structs.h"
+
+#ifdef SBR_DEC
+
+#include <stdlib.h>
+
+#include "sbr_syntax.h"
+#include "sbr_e_nf.h"
+
+void extract_envelope_data(sbr_info *sbr, uint8_t ch)
+{
+ uint8_t l, k;
+
+#if 0
+ if (sbr->frame == 19)
+ {
+ sbr->frame = 19;
+ }
+#endif
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ if (sbr->bs_df_env[ch][l] == 0)
+ {
+ for (k = 1; k < sbr->n[sbr->f[ch][l]]; k++)
+ {
+ sbr->E[ch][k][l] = sbr->E[ch][k - 1][l] + sbr->E[ch][k][l];
+ }
+
+ } else { /* bs_df_env == 1 */
+
+ uint8_t g = (l == 0) ? sbr->f_prev[ch] : sbr->f[ch][l-1];
+ int16_t E_prev;
+
+ if (sbr->f[ch][l] == g)
+ {
+ for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
+ {
+ if (l == 0)
+ E_prev = sbr->E_prev[ch][k];
+ else
+ E_prev = sbr->E[ch][k][l - 1];
+
+ sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
+ }
+
+ } else if ((g == 1) && (sbr->f[ch][l] == 0)) {
+ uint8_t i;
+
+ for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
+ {
+ for (i = 0; i < sbr->N_high; i++)
+ {
+ if (sbr->f_table_res[HI_RES][i] == sbr->f_table_res[LO_RES][k])
+ {
+ if (l == 0)
+ E_prev = sbr->E_prev[ch][i];
+ else
+ E_prev = sbr->E[ch][i][l - 1];
+
+ sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
+ }
+ }
+ }
+
+ } else if ((g == 0) && (sbr->f[ch][l] == 1)) {
+ uint8_t i;
+
+ for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
+ {
+ for (i = 0; i < sbr->N_low; i++)
+ {
+ if ((sbr->f_table_res[LO_RES][i] <= sbr->f_table_res[HI_RES][k]) &&
+ (sbr->f_table_res[HI_RES][k] < sbr->f_table_res[LO_RES][i + 1]))
+ {
+ if (l == 0)
+ E_prev = sbr->E_prev[ch][i];
+ else
+ E_prev = sbr->E[ch][i][l - 1];
+
+ sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
+ }
+ }
+ }
+ }
+ }
+ }
+
+#if 0
+ if (sbr->frame == 23)
+ {
+ int l, k;
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
+ {
+ //printf("l:%d k:%d E:%d\n",l,k, sbr->E[ch][k][l]);
+ printf("%d\n", sbr->E[ch][k][l]);
+ }
+ }
+ printf("\n");
+ }
+#endif
+}
+
+void extract_noise_floor_data(sbr_info *sbr, uint8_t ch)
+{
+ uint8_t l, k;
+
+ for (l = 0; l < sbr->L_Q[ch]; l++)
+ {
+ if (sbr->bs_df_noise[ch][l] == 0)
+ {
+ for (k = 1; k < sbr->N_Q; k++)
+ {
+ sbr->Q[ch][k][l] = sbr->Q[ch][k][l] + sbr->Q[ch][k-1][l];
+ }
+ } else {
+ if (l == 0)
+ {
+ for (k = 0; k < sbr->N_Q; k++)
+ {
+ sbr->Q[ch][k][l] = sbr->Q_prev[ch][k] + sbr->Q[ch][k][0];
+ }
+ } else {
+ for (k = 0; k < sbr->N_Q; k++)
+ {
+ sbr->Q[ch][k][l] = sbr->Q[ch][k][l - 1] + sbr->Q[ch][k][l];
+ }
+ }
+ }
+ }
+
+#if 0
+ if (sbr->frame == 23)
+ {
+ int l, k;
+
+ for (l = 0; l < sbr->L_Q[ch]; l++)
+ {
+ for (k = 0; k < sbr->N_Q; k++)
+ {
+ //printf("l:%d k:%d E:%d\n",l,k, sbr->E[ch][k][l]);
+ printf("%d\n", sbr->Q[ch][k][l]);
+ }
+ }
+ printf("\n");
+ }
+#endif
+}
+
+/* FIXME: pow() not needed */
+void envelope_noise_dequantisation(sbr_info *sbr, uint8_t ch)
+{
+ if (sbr->bs_coupling == 0)
+ {
+ uint8_t l, k;
+#ifdef FIXED_POINT
+ uint8_t amp = (sbr->amp_res[ch]) ? 0 : 1;
+#else
+ real_t amp = (sbr->amp_res[ch]) ? 1.0 : 0.5;
+#endif
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
+ {
+#ifndef FIXED_POINT
+ /* +6 for the *64 */
+ sbr->E_orig[ch][k][l] = pow(2, sbr->E[ch][k][l]*amp + 6);
+#else
+ int8_t exp;
+
+ /* +6 for the *64 and -10 for the /32 in the synthesis QMF
+ * since this is a energy value: (x/32)^2 = (x^2)/1024
+ */
+ exp = (sbr->E[ch][k][l] >> amp) + 6 - 10;
+
+// printf("%d\n", exp);
+
+ if (exp < 0)
+ sbr->E_orig[ch][k][l] = 0; //REAL_CONST(1) >> -exp;
+ else
+ sbr->E_orig[ch][k][l] = 1 << exp; //REAL_CONST(1) << exp;
+
+ if (amp && (sbr->E[ch][k][l] & 1))
+ sbr->E_orig[ch][k][l] = MUL(sbr->E_orig[ch][k][l], REAL_CONST(1.414213562));
+#endif
+ }
+ }
+
+ for (l = 0; l < sbr->L_Q[ch]; l++)
+ {
+ for (k = 0; k < sbr->N_Q; k++)
+ {
+ if (sbr->Q[ch][k][l] < 0 || sbr->Q[ch][k][l] > 30)
+ sbr->Q_orig[ch][k][l] = 0;
+ else {
+#ifndef FIXED_POINT
+ sbr->Q_orig[ch][k][l] = pow(2, NOISE_FLOOR_OFFSET - sbr->Q[ch][k][l]);
+#else
+ int8_t exp = NOISE_FLOOR_OFFSET - sbr->Q[ch][k][l];
+ if (exp < 0)
+ sbr->Q_orig[ch][k][l] = REAL_CONST(1) >> -exp;
+ else
+ sbr->Q_orig[ch][k][l] = REAL_CONST(1) << exp;
+#endif
+ }
+ }
+ }
+ }
+}
+
+void unmap_envelope_noise(sbr_info *sbr)
+{
+ uint8_t l, k;
+#ifdef FIXED_POINT
+ uint8_t amp0 = (sbr->amp_res[0]) ? 0 : 1;
+ uint8_t amp1 = (sbr->amp_res[1]) ? 0 : 1;
+#else
+ real_t amp0 = (sbr->amp_res[0]) ? 1.0 : 0.5;
+ real_t amp1 = (sbr->amp_res[1]) ? 1.0 : 0.5;
+#endif
+
+ for (l = 0; l < sbr->L_E[0]; l++)
+ {
+ for (k = 0; k < sbr->n[sbr->f[0][l]]; k++)
+ {
+ real_t l_temp, r_temp;
+
+#ifdef FIXED_POINT
+ int8_t exp;
+
+ /* +6: * 64 ; +1: * 2 ; -10: /1024 QMF */
+ exp = (sbr->E[0][k][l] >> amp0) - 3;
+
+// printf("%d\n", exp);
+
+ if (exp < 0)
+ l_temp = REAL_CONST(1) >> -exp;
+ else
+ l_temp = REAL_CONST(1) << exp;
+
+ if (amp0 && (sbr->E[0][k][l] & 1))
+ l_temp = MUL(l_temp, REAL_CONST(1.414213562373095));
+
+ /* UN_MAP removed: (x / 4096) same as (x >> 12) */
+ exp = (sbr->E[1][k][l] >> amp1) - 12;
+
+// printf("%d\n", exp);
+
+ if (exp < 0)
+ r_temp = REAL_CONST(1) >> -exp;
+ else
+ r_temp = REAL_CONST(1) << exp;
+
+ if (amp1 && (sbr->E[1][k][l] & 1))
+ r_temp = MUL(r_temp, REAL_CONST(1.414213562373095));
+#else
+ /* +6: * 64 ; +1: * 2 */
+ l_temp = pow(2, sbr->E[0][k][l]*amp0 + 7);
+ /* UN_MAP removed: (x / 4096) same as (x >> 12) */
+ r_temp = pow(2, sbr->E[1][k][l]*amp1 - 12);
+#endif
+
+
+#ifdef FIXED_POINT
+ {
+ real_t tmp = REAL_CONST(1.0) + r_temp;
+ sbr->E_orig[1][k][l] = SBR_DIV(l_temp, tmp);
+ }
+#else
+ sbr->E_orig[1][k][l] = l_temp / (1.0 + r_temp);
+#endif
+ sbr->E_orig[0][k][l] = MUL(r_temp, sbr->E_orig[1][k][l]);
+
+#ifdef FIXED_POINT
+ sbr->E_orig[0][k][l] >>= REAL_BITS;
+ sbr->E_orig[1][k][l] >>= REAL_BITS;
+#endif
+
+ //printf("%f\t%f\n", sbr->E_orig[0][k][l] /(float)(1<<REAL_BITS), sbr->E_orig[1][k][l] /(float)(1<<REAL_BITS));
+ //printf("%f\t%f\n", sbr->E_orig[0][k][l]/1024., sbr->E_orig[1][k][l]/1024.);
+ }
+ }
+ for (l = 0; l < sbr->L_Q[0]; l++)
+ {
+ for (k = 0; k < sbr->N_Q; k++)
+ {
+ if ((sbr->Q[0][k][l] < 0 || sbr->Q[0][k][l] > 30) ||
+ (sbr->Q[1][k][l] < 0 || sbr->Q[1][k][l] > 30))
+ {
+ sbr->Q_orig[0][k][l] = 0;
+ sbr->Q_orig[1][k][l] = 0;
+ } else {
+ real_t l_temp, r_temp;
+
+#ifndef FIXED_POINT
+ l_temp = pow(2.0, NOISE_FLOOR_OFFSET - sbr->Q[0][k][l] + 1);
+ r_temp = pow(2.0, sbr->Q[1][k][l] - 12);
+#else
+ int8_t exp;
+
+ exp = NOISE_FLOOR_OFFSET - sbr->Q[0][k][l] + 1;
+ if (exp < 0)
+ l_temp = REAL_CONST(1) >> -exp;
+ else
+ l_temp = REAL_CONST(1) << exp;
+
+ exp = sbr->Q[1][k][l] - 12;
+ if (exp < 0)
+ r_temp = REAL_CONST(1) >> -exp;
+ else
+ r_temp = REAL_CONST(1) << exp;
+#endif
+
+#ifdef FIXED_POINT
+ sbr->Q_orig[1][k][l] = SBR_DIV(l_temp, (REAL_CONST(1.0) + r_temp));
+#else
+ sbr->Q_orig[1][k][l] = l_temp / (1.0 + r_temp);
+#endif
+ sbr->Q_orig[0][k][l] = MUL(r_temp, sbr->Q_orig[1][k][l]);
+ }
+ }
+ }
+}
+
+#endif
--- /dev/null
+++ b/libfaad/sbr_e_nf.h
@@ -1,0 +1,44 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_e_nf.h,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_E_NF_H__
+#define __SBR_E_NF_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void extract_envelope_data(sbr_info *sbr, uint8_t ch);
+void extract_noise_floor_data(sbr_info *sbr, uint8_t ch);
+void envelope_noise_dequantisation(sbr_info *sbr, uint8_t ch);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
--- /dev/null
+++ b/libfaad/sbr_fbt.c
@@ -1,0 +1,541 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_fbt.c,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+/* Calculate frequency band tables */
+
+#include "common.h"
+#include "structs.h"
+
+#ifdef SBR_DEC
+
+#include <stdlib.h>
+
+#include "sbr_syntax.h"
+#include "sbr_fbt.h"
+
+
+/* calculate the start QMF channel for the master frequency band table */
+/* parameter is also called k0 */
+uint16_t qmf_start_channel(uint8_t bs_start_freq, uint8_t bs_samplerate_mode,
+ uint32_t sample_rate)
+{
+ static int8_t offset[7][16] = {
+ { -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7 },
+ { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13 },
+ { -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 },
+ { -6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 },
+ { -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20 },
+ { -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24 },
+ { 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24, 28, 33 }
+ };
+ uint8_t startMin;
+
+ if (sample_rate >= 64000)
+ {
+ startMin = (uint8_t)((5000.*128.)/(float)sample_rate + 0.5);
+ } else if (sample_rate < 32000) {
+ startMin = (uint8_t)((3000.*128.)/(float)sample_rate + 0.5);
+ } else {
+ startMin = (uint8_t)((4000.*128.)/(float)sample_rate + 0.5);
+ }
+
+ if (bs_samplerate_mode)
+ {
+ switch (sample_rate)
+ {
+ case 16000:
+ return startMin + offset[0][bs_start_freq];
+ case 22050:
+ return startMin + offset[1][bs_start_freq];
+ case 24000:
+ return startMin + offset[2][bs_start_freq];
+ case 32000:
+ return startMin + offset[3][bs_start_freq];
+ default:
+ if (sample_rate > 64000)
+ {
+ return startMin + offset[5][bs_start_freq];
+ } else { /* 44100 <= sample_rate <= 64000 */
+ return startMin + offset[4][bs_start_freq];
+ }
+ }
+ } else {
+ return startMin + offset[6][bs_start_freq];
+ }
+}
+
+static int32_t longcmp(const void *a, const void *b)
+{
+ return ((int32_t)(*(int32_t*)a - *(int32_t*)b));
+}
+
+/* calculate the stop QMF channel for the master frequency band table */
+/* parameter is also called k2 */
+uint16_t qmf_stop_channel(uint8_t bs_stop_freq, uint32_t sample_rate,
+ uint16_t k0)
+{
+ if (bs_stop_freq == 15)
+ {
+ return min(64, k0 * 3);
+ } else if (bs_stop_freq == 14) {
+ return min(64, k0 * 2);
+ } else {
+ uint8_t i;
+ uint8_t stopMin;
+ int32_t stopDk[13], stopDk_t[14], k2;
+
+ if (sample_rate >= 64000)
+ {
+ stopMin = (uint8_t)((10000.*128.)/(float)sample_rate + 0.5);
+ } else if (sample_rate < 32000) {
+ stopMin = (uint8_t)((6000.*128.)/(float)sample_rate + 0.5);
+ } else {
+ stopMin = (uint8_t)((8000.*128.)/(float)sample_rate + 0.5);
+ }
+
+ for (i = 0; i <= 13; i++)
+ {
+ stopDk_t[i] = (int32_t)(stopMin*pow(64.0/stopMin, i/13.0) + 0.5);
+ }
+ for (i = 0; i < 13; i++)
+ {
+ stopDk[i] = stopDk_t[i+1] - stopDk_t[i];
+ }
+
+ /* needed? or does this always reverse the array? */
+ qsort(stopDk, 13, sizeof(stopDk[0]), longcmp);
+
+ k2 = stopMin;
+ for (i = 0; i < bs_stop_freq; i++)
+ {
+ k2 += stopDk[i];
+ }
+ return min(64, k2);
+ }
+
+ return 0;
+}
+
+/* calculate the master frequency table from k0, k2, bs_freq_scale
+ and bs_alter_scale
+
+ version for bs_freq_scale = 0
+*/
+void master_frequency_table_fs0(sbr_info *sbr, uint16_t k0, uint16_t k2,
+ uint8_t bs_alter_scale)
+{
+ int8_t incr;
+ uint8_t k;
+ uint8_t dk;
+ uint32_t nrBands, k2Achieved;
+ int32_t k2Diff, vDk[64];
+
+ memset(vDk, 0, 64*sizeof(int32_t));
+
+ /* mft only defined for k2 > k0 */
+ if (k2 <= k0)
+ {
+ sbr->N_master = 0;
+ return;
+ }
+
+ dk = bs_alter_scale ? 2 : 1;
+ nrBands = 2 * (int32_t)((float)(k2-k0)/(dk*2) + (-1+dk)/2.0f);
+ nrBands = min(nrBands, 64);
+
+ k2Achieved = k0 + nrBands * dk;
+ k2Diff = k2 - k2Achieved;
+ /* for (k = 0; k <= nrBands; k++) Typo fix */
+ for (k = 0; k < nrBands; k++)
+ vDk[k] = dk;
+
+ if (k2Diff)
+ {
+ incr = (k2Diff > 0) ? -1 : 1;
+ k = (k2Diff > 0) ? (nrBands-1) : 0;
+
+ while (k2Diff != 0)
+ {
+ vDk[k] -= incr;
+ k += incr;
+ k2Diff += incr;
+ }
+ }
+
+ sbr->f_master[0] = k0;
+ for (k = 1; k <= nrBands; k++)
+ sbr->f_master[k] = sbr->f_master[k-1] + vDk[k-1];
+
+ sbr->N_master = nrBands;
+ sbr->N_master = min(sbr->N_master, 64);
+
+#if 0
+ printf("f_master[%d]: ", nrBands);
+ for (k = 0; k <= nrBands; k++)
+ {
+ printf("%d ", sbr->f_master[k]);
+ }
+ printf("\n");
+#endif
+}
+
+/*
+ version for bs_freq_scale > 0
+*/
+void master_frequency_table(sbr_info *sbr, uint16_t k0, uint16_t k2,
+ uint8_t bs_freq_scale, uint8_t bs_alter_scale)
+{
+ uint8_t k, bands, twoRegions;
+ uint16_t k1;
+ uint32_t nrBand0, nrBand1;
+ int32_t vDk0[64], vDk1[64];
+ int32_t vk0[64], vk1[64];
+ float warp;
+ uint8_t temp1[] = { 12, 10, 8 };
+ float temp2[] = { 1.0, 1.3 };
+
+ /* without memset code enters infinte loop,
+ so there must be some wrong table access */
+ memset(vDk0, 0, 64*sizeof(int32_t));
+ memset(vDk1, 0, 64*sizeof(int32_t));
+ memset(vk0, 0, 64*sizeof(int32_t));
+ memset(vk1, 0, 64*sizeof(int32_t));
+
+ /* mft only defined for k2 > k0 */
+ if (k2 <= k0)
+ {
+ sbr->N_master = 0;
+ return;
+ }
+
+ bands = temp1[bs_freq_scale-1];
+ warp = temp2[bs_alter_scale];
+
+ if ((float)k2/(float)k0 > 2.2449)
+ {
+ twoRegions = 1;
+ k1 = 2 * k0;
+ } else {
+ twoRegions = 0;
+ k1 = k2;
+ }
+
+ nrBand0 = 2 * (int32_t)(bands * log((float)k1/(float)k0)/(2.0*log(2.0)) + 0.5);
+ nrBand0 = min(nrBand0, 64);
+ for (k = 0; k <= nrBand0; k++)
+ {
+ /* MAPLE */
+ vDk0[k] = (int32_t)(k0 * pow((float)k1/(float)k0, (k+1)/(float)nrBand0)+0.5) -
+ (int32_t)(k0 * pow((float)k1/(float)k0, k/(float)nrBand0)+0.5);
+ }
+
+ /* needed? */
+ qsort(vDk0, nrBand0, sizeof(vDk0[0]), longcmp);
+
+ vk0[0] = k0;
+ for (k = 1; k <= nrBand0; k++)
+ {
+ vk0[k] = vk0[k-1] + vDk0[k-1];
+ }
+
+ if (!twoRegions)
+ {
+ for (k = 0; k <= nrBand0; k++)
+ sbr->f_master[k] = vk0[k];
+
+ sbr->N_master = nrBand0;
+ sbr->N_master = min(sbr->N_master, 64);
+ return;
+ }
+
+ nrBand1 = 2 * (int32_t)(bands * log((float)k2/(float)k1)/(2.0 * log(2.0) * warp) + 0.5);
+ nrBand1 = min(nrBand1, 64);
+
+ for (k = 0; k <= nrBand1 - 1; k++)
+ {
+ vDk1[k] = (int32_t)(k1 * pow((float)k2/(float)k1, (k+1)/(float)nrBand1)+0.5) -
+ (int32_t)(k1 * pow((float)k2/(float)k1, k/(float)nrBand1)+0.5);
+ }
+
+ if (vDk1[0] < vDk0[nrBand0 - 1])
+ {
+ int32_t change;
+
+ /* needed? */
+ qsort(vDk1, nrBand1 + 1, sizeof(vDk1[0]), longcmp);
+ change = vDk0[nrBand0 - 1] - vDk1[0];
+ vDk1[0] = vDk0[nrBand0 - 1];
+ vDk1[nrBand1 - 1] = vDk1[nrBand1 - 1] - change;
+ }
+
+ /* needed? */
+ qsort(vDk1, nrBand1, sizeof(vDk1[0]), longcmp);
+ vk1[0] = k1;
+ for (k = 1; k <= nrBand1; k++)
+ {
+ vk1[k] = vk1[k-1] + vDk1[k-1];
+ }
+
+ sbr->N_master = nrBand0 + nrBand1;
+ sbr->N_master = min(sbr->N_master, 64);
+ for (k = 0; k <= nrBand0; k++)
+ {
+ sbr->f_master[k] = vk0[k];
+ }
+ for (k = nrBand0 + 1; k <= sbr->N_master; k++)
+ {
+ sbr->f_master[k] = vk1[k - nrBand0];
+ }
+
+#if 0
+ printf("f_master[%d]: ", sbr->N_master);
+ for (k = 0; k <= sbr->N_master; k++)
+ {
+ printf("%d ", sbr->f_master[k]);
+ }
+ printf("\n");
+#endif
+}
+
+/* calculate the derived frequency border tables from f_master */
+void derived_frequency_table(sbr_info *sbr, uint8_t bs_xover_band,
+ uint16_t k2)
+{
+ uint8_t k, i;
+ uint32_t minus;
+
+ sbr->N_high = sbr->N_master - bs_xover_band;
+
+ /* is this accurate? */
+ sbr->N_low = sbr->N_high/2 + (sbr->N_high - 2 * (sbr->N_high/2));
+
+ sbr->n[0] = sbr->N_low;
+ sbr->n[1] = sbr->N_high;
+
+ for (k = 0; k <= sbr->N_high; k++)
+ {
+ sbr->f_table_res[HI_RES][k] = sbr->f_master[k + bs_xover_band];
+ }
+
+ sbr->M = sbr->f_table_res[HI_RES][sbr->N_high] - sbr->f_table_res[HI_RES][0];
+ sbr->kx = sbr->f_table_res[HI_RES][0];
+
+ /* correct? */
+ minus = (sbr->N_high & 1) ? 1 : 0;
+
+ for (k = 0; k <= sbr->N_low; k++)
+ {
+ if (k == 0)
+ i = 0;
+ else
+ i = 2*k - minus;
+ sbr->f_table_res[LO_RES][k] = sbr->f_table_res[HI_RES][i];
+ }
+ /* end correct? */
+
+#if 0
+ printf("f_table_res[HI_RES][%d]: ", sbr->N_high);
+ for (k = 0; k <= sbr->N_high; k++)
+ {
+ printf("%d ", sbr->f_table_res[HI_RES][k]);
+ }
+ printf("\n");
+#endif
+#if 0
+ printf("f_table_res[LO_RES][%d]: ", sbr->N_low);
+ for (k = 0; k <= sbr->N_low; k++)
+ {
+ printf("%d ", sbr->f_table_res[LO_RES][k]);
+ }
+ printf("\n");
+#endif
+
+ sbr->N_Q = 0;
+ if (sbr->bs_noise_bands == 0)
+ {
+ sbr->N_Q = 1;
+ } else {
+ /* MAPLE */
+ sbr->N_Q = max(1, (int32_t)(sbr->bs_noise_bands*(log(k2/(float)sbr->kx)/log(2.0)) + 0.5));
+ if (sbr->N_Q == 0)
+ sbr->N_Q = 1;
+ }
+ sbr->N_Q = min(5, sbr->N_Q);
+
+ for (k = 0; k <= sbr->N_Q; k++)
+ {
+ if (k == 0)
+ i = 0;
+ else /* is this accurate? */
+ i = i + (int32_t)((sbr->N_low - i)/(sbr->N_Q + 1 - k));
+ sbr->f_table_noise[k] = sbr->f_table_res[LO_RES][i];
+ }
+
+ /* build table for mapping k to g in hf patching */
+ for (k = 0; k < 64; k++)
+ {
+ uint8_t g;
+ for (g = 0; g < sbr->N_Q; g++)
+ {
+ if ((sbr->f_table_noise[g] <= k) &&
+ (k < sbr->f_table_noise[g+1]))
+ {
+ sbr->table_map_k_to_g[k] = g;
+ break;
+ }
+ }
+ }
+
+#if 0
+ printf("f_table_noise[%d]: ", sbr->N_Q);
+ for (k = 0; k <= sbr->N_Q; k++)
+ {
+ printf("%d ", sbr->f_table_noise[k]);
+ }
+ printf("\n");
+#endif
+}
+
+/* TODO: blegh, ugly */
+/* Modified to calculate for all possible bs_limiter_bands always
+ * This reduces the number calls to this functions needed (now only on
+ * header reset)
+ */
+void limiter_frequency_table(sbr_info *sbr)
+{
+ static real_t limiterBandsPerOctave[] = { REAL_CONST(1.2),
+ REAL_CONST(2), REAL_CONST(3) };
+ uint8_t k, s;
+ int8_t nrLim;
+ int32_t limTable[100 /*TODO*/];
+ uint8_t patchBorders[64/*??*/];
+ real_t limBands;
+
+ sbr->f_table_lim[0][0] = sbr->f_table_res[LO_RES][0] - sbr->kx;
+ sbr->f_table_lim[0][1] = sbr->f_table_res[LO_RES][sbr->N_low] - sbr->kx;
+ sbr->N_L[0] = 1;
+
+ for (s = 1; s < 4; s++)
+ {
+ memset(limTable, 0, 100*sizeof(int32_t));
+
+ limBands = limiterBandsPerOctave[s - 1];
+
+ patchBorders[0] = sbr->kx;
+ for (k = 1; k <= sbr->noPatches; k++)
+ {
+ patchBorders[k] = patchBorders[k-1] + sbr->patchNoSubbands[k-1];
+ }
+
+ for (k = 0; k <= sbr->N_low; k++)
+ {
+ limTable[k] = sbr->f_table_res[LO_RES][k];
+ }
+ for (k = 1; k < sbr->noPatches; k++)
+ {
+ limTable[k+sbr->N_low] = patchBorders[k];
+ }
+
+ /* needed */
+ qsort(limTable, sbr->noPatches + sbr->N_low, sizeof(limTable[0]), longcmp);
+ k = 1;
+ nrLim = sbr->noPatches + sbr->N_low - 1;
+
+ if (nrLim < 0) // TODO: BIG FAT PROBLEM
+ return;
+
+restart:
+ if (k <= nrLim)
+ {
+ real_t nOctaves;
+
+ if (limTable[k-1] != 0)
+ nOctaves = REAL_CONST(log((float)limTable[k]/(float)limTable[k-1])/log(2.0));
+ else
+ nOctaves = 0;
+
+ if ((MUL(nOctaves,limBands)) < REAL_CONST(0.49))
+ {
+ uint8_t i;
+ if (limTable[k] != limTable[k-1])
+ {
+ uint8_t found = 0, found2 = 0;
+ for (i = 0; i <= sbr->noPatches; i++)
+ {
+ if (limTable[k] == patchBorders[i])
+ found = 1;
+ }
+ if (found)
+ {
+ found2 = 0;
+ for (i = 0; i <= sbr->noPatches; i++)
+ {
+ if (limTable[k-1] == patchBorders[i])
+ found2 = 1;
+ }
+ if (found2)
+ {
+ k++;
+ goto restart;
+ } else {
+ /* remove (k-1)th element */
+ limTable[k-1] = sbr->f_table_res[LO_RES][sbr->N_low];
+ qsort(limTable, sbr->noPatches + sbr->N_low, sizeof(limTable[0]), longcmp);
+ nrLim--;
+ goto restart;
+ }
+ }
+ }
+ /* remove kth element */
+ limTable[k] = sbr->f_table_res[LO_RES][sbr->N_low];
+ qsort(limTable, nrLim, sizeof(limTable[0]), longcmp);
+ nrLim--;
+ goto restart;
+ } else {
+ k++;
+ goto restart;
+ }
+ }
+
+ sbr->N_L[s] = nrLim;
+ for (k = 0; k <= nrLim; k++)
+ {
+ sbr->f_table_lim[s][k] = limTable[k] - sbr->kx;
+ }
+
+#if 0
+ printf("f_table_lim[%d][%d]: ", s, sbr->N_L[s]);
+ for (k = 0; k <= sbr->N_L[s]; k++)
+ {
+ printf("%d ", sbr->f_table_lim[s][k]);
+ }
+ printf("\n");
+#endif
+ }
+}
+
+#endif
--- /dev/null
+++ b/libfaad/sbr_fbt.h
@@ -1,0 +1,52 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_fbt.h,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_FBT_H__
+#define __SBR_FBT_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+uint16_t qmf_start_channel(uint8_t bs_start_freq, uint8_t bs_samplerate_mode,
+ uint32_t sample_rate);
+uint16_t qmf_stop_channel(uint8_t bs_stop_freq, uint32_t sample_rate,
+ uint16_t k0);
+void master_frequency_table_fs0(sbr_info *sbr, uint16_t k0, uint16_t k2,
+ uint8_t bs_alter_scale);
+void master_frequency_table(sbr_info *sbr, uint16_t k0, uint16_t k2,
+ uint8_t bs_freq_scale, uint8_t bs_alter_scale);
+void derived_frequency_table(sbr_info *sbr, uint8_t bs_xover_band,
+ uint16_t k2);
+void limiter_frequency_table(sbr_info *sbr);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
--- /dev/null
+++ b/libfaad/sbr_hfadj.c
@@ -1,0 +1,987 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_hfadj.c,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+/* High Frequency adjustment */
+
+#include "common.h"
+#include "structs.h"
+
+#ifdef SBR_DEC
+
+#include "sbr_syntax.h"
+#include "sbr_hfadj.h"
+
+#include "sbr_noise.h"
+
+void hf_adjustment(sbr_info *sbr, qmf_t *Xsbr
+#ifdef SBR_LOW_POWER
+ ,real_t *deg /* aliasing degree */
+#endif
+ ,uint8_t ch)
+{
+ sbr_hfadj_info adj;
+
+ memset(&adj, 0, sizeof(sbr_hfadj_info));
+
+ map_noise_data(sbr, &adj, ch);
+ map_sinusoids(sbr, &adj, ch);
+
+ estimate_current_envelope(sbr, &adj, Xsbr, ch);
+
+ calculate_gain(sbr, &adj, ch);
+
+#if 1
+
+#ifdef SBR_LOW_POWER
+ calc_gain_groups(sbr, &adj, deg, ch);
+ aliasing_reduction(sbr, &adj, deg, ch);
+#endif
+
+ hf_assembly(sbr, &adj, Xsbr, ch);
+
+#endif
+}
+
+static void map_noise_data(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch)
+{
+ uint8_t l, i;
+ uint32_t m;
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ for (i = 0; i < sbr->N_Q; i++)
+ {
+ for (m = sbr->f_table_noise[i]; m < sbr->f_table_noise[i+1]; m++)
+ {
+ uint8_t k;
+
+ adj->Q_mapped[m - sbr->kx][l] = 0;
+
+ for (k = 0; k < 2; k++)
+ {
+ if ((sbr->t_E[ch][l] >= sbr->t_Q[ch][k]) &&
+ (sbr->t_E[ch][l+1] <= sbr->t_Q[ch][k+1]))
+ {
+ adj->Q_mapped[m - sbr->kx][l] =
+ sbr->Q_orig[ch][i][k];
+ }
+ }
+ }
+ }
+ }
+}
+
+static void map_sinusoids(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch)
+{
+ uint8_t l, i, m, k, k1, k2, delta_S, l_i, u_i;
+
+ if (sbr->bs_frame_class[ch] == FIXFIX)
+ {
+ sbr->l_A[ch] = -1;
+ } else if (sbr->bs_frame_class[ch] == VARFIX) {
+ if (sbr->bs_pointer[ch] > 1)
+ sbr->l_A[ch] = -1;
+ else
+ sbr->l_A[ch] = sbr->bs_pointer[ch] - 1;
+ } else {
+ if (sbr->bs_pointer[ch] == 0)
+ sbr->l_A[ch] = -1;
+ else
+ sbr->l_A[ch] = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
+ }
+
+ for (l = 0; l < 5; l++)
+ {
+ for (i = 0; i < 64; i++)
+ {
+ adj->S_index_mapped[i][l] = 0;
+ adj->S_mapped[i][l] = 0;
+ }
+ }
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ for (i = 0; i < sbr->N_high; i++)
+ {
+ for (m = sbr->f_table_res[HI_RES][i]; m < sbr->f_table_res[HI_RES][i+1]; m++)
+ {
+ uint8_t delta_step = 0;
+ if ((l >= sbr->l_A[ch]) || ((sbr->bs_add_harmonic_prev[ch][i]) &&
+ (sbr->bs_add_harmonic_flag_prev[ch])))
+ {
+ delta_step = 1;
+ }
+
+ if (m == (int32_t)((real_t)(sbr->f_table_res[HI_RES][i+1]+sbr->f_table_res[HI_RES][i])/2.))
+ {
+ adj->S_index_mapped[m - sbr->kx][l] =
+ delta_step * sbr->bs_add_harmonic[ch][i];
+ } else {
+ adj->S_index_mapped[m - sbr->kx][l] = 0;
+ }
+
+#if 0
+ if (sbr->frame == 95)
+ {
+ printf("%d %d %d %d %d\n", adj->S_index_mapped[m - sbr->kx][l],
+ sbr->bs_add_harmonic[ch][i], sbr->bs_add_harmonic_prev[ch][i],
+ l, sbr->l_A[ch]);
+ }
+#endif
+ }
+ }
+ }
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ for (i = 0; i < sbr->N_high; i++)
+ {
+ if (sbr->f[ch][l] == 1)
+ {
+ k1 = i;
+ k2 = i + 1;
+ } else {
+ for (k1 = 0; k1 < sbr->N_low; k1++)
+ {
+ if ((sbr->f_table_res[HI_RES][i] >= sbr->f_table_res[LO_RES][k1]) &&
+ (sbr->f_table_res[HI_RES][i+1] <= sbr->f_table_res[LO_RES][k1+1]))
+ {
+ break;
+ }
+ }
+ for (k2 = 0; k2 < sbr->N_low; k2++)
+ {
+ if ((sbr->f_table_res[HI_RES][i+1] >= sbr->f_table_res[LO_RES][k2]) &&
+ (sbr->f_table_res[HI_RES][i+2] <= sbr->f_table_res[LO_RES][k2+1]))
+ {
+ break;
+ }
+ }
+ }
+
+ l_i = sbr->f_table_res[sbr->f[ch][l]][k1];
+ u_i = sbr->f_table_res[sbr->f[ch][l]][k2];
+
+ delta_S = 0;
+ for (k = l_i; k < u_i; k++)
+ {
+ if (adj->S_index_mapped[k - sbr->kx][l] == 1)
+ delta_S = 1;
+ }
+
+ for (m = l_i; m < u_i; m++)
+ {
+ adj->S_mapped[m - sbr->kx][l] = delta_S;
+ }
+ }
+ }
+}
+
+static void estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj, qmf_t *Xsbr,
+ uint8_t ch)
+{
+ uint8_t m, l, j, k, k_l, k_h, p;
+ real_t nrg, div;
+
+ if (sbr->bs_interpol_freq == 1)
+ {
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ uint8_t i, l_i, u_i;
+
+ l_i = sbr->t_E[ch][l];
+ u_i = sbr->t_E[ch][l+1];
+
+ div = (real_t)(u_i - l_i);
+
+ for (m = 0; m < sbr->M; m++)
+ {
+ nrg = 0;
+
+ for (i = l_i + tHFAdj; i < u_i + tHFAdj; i++)
+ {
+#ifdef FIXED_POINT
+ nrg += ((QMF_RE(Xsbr[(i<<6) + m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_RE(Xsbr[(i<<6) + m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS);
+#else
+ nrg += MUL(QMF_RE(Xsbr[(i<<6) + m + sbr->kx]), QMF_RE(Xsbr[(i<<6) + m + sbr->kx]))
+#ifndef SBR_LOW_POWER
+ + MUL(QMF_IM(Xsbr[(i<<6) + m + sbr->kx]), QMF_IM(Xsbr[(i<<6) + m + sbr->kx]))
+#endif
+ ;
+#endif
+ }
+
+ sbr->E_curr[ch][m][l] = nrg / div;
+#ifdef SBR_LOW_POWER
+#ifdef FIXED_POINT
+ sbr->E_curr[ch][m][l] <<= 1;
+#else
+ sbr->E_curr[ch][m][l] *= 2;
+#endif
+#endif
+ }
+ }
+ } else {
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ for (p = 0; p < sbr->n[sbr->f[ch][l]]; p++)
+ {
+ k_l = sbr->f_table_res[sbr->f[ch][l]][p];
+ k_h = sbr->f_table_res[sbr->f[ch][l]][p+1];
+
+ for (k = k_l; k < k_h; k++)
+ {
+ uint8_t i, l_i, u_i;
+ nrg = 0.0;
+
+ l_i = sbr->t_E[ch][l];
+ u_i = sbr->t_E[ch][l+1];
+
+ div = (real_t)((u_i - l_i)*(k_h - k_l + 1));
+
+ for (i = l_i + tHFAdj; i < u_i + tHFAdj; i++)
+ {
+ for (j = k_l; j < k_h; j++)
+ {
+#ifdef FIXED_POINT
+ nrg += ((QMF_RE(Xsbr[(i<<6) + j])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_RE(Xsbr[(i<<6) + j])+(1<<(REAL_BITS-1)))>>REAL_BITS);
+#else
+ nrg += MUL(QMF_RE(Xsbr[(i<<6) + j]), QMF_RE(Xsbr[(i<<6) + j]))
+#ifndef SBR_LOW_POWER
+ + MUL(QMF_IM(Xsbr[(i<<6) + j]), QMF_IM(Xsbr[(i<<6) + j]))
+#endif
+ ;
+#endif
+ }
+ }
+
+ sbr->E_curr[ch][k - sbr->kx][l] = nrg / div;
+#ifdef SBR_LOW_POWER
+#ifdef FIXED_POINT
+ sbr->E_curr[ch][k - sbr->kx][l] <<= 1;
+#else
+ sbr->E_curr[ch][k - sbr->kx][l] *= 2;
+#endif
+#endif
+ }
+ }
+ }
+ }
+}
+
+#ifdef FIXED_POINT
+#define step(shift) \
+ if ((0x40000000l >> shift) + root <= value) \
+ { \
+ value -= (0x40000000l >> shift) + root; \
+ root = (root >> 1) | (0x40000000l >> shift); \
+ } else { \
+ root = root >> 1; \
+ }
+
+/* fixed point square root approximation */
+real_t sbr_sqrt(real_t value)
+{
+ real_t root = 0;
+
+ step( 0); step( 2); step( 4); step( 6);
+ step( 8); step(10); step(12); step(14);
+ step(16); step(18); step(20); step(22);
+ step(24); step(26); step(28); step(30);
+
+ if (root < value)
+ ++root;
+
+ root <<= (REAL_BITS/2);
+
+ return root;
+}
+real_t sbr_sqrt_int(real_t value)
+{
+ real_t root = 0;
+
+ step( 0); step( 2); step( 4); step( 6);
+ step( 8); step(10); step(12); step(14);
+ step(16); step(18); step(20); step(22);
+ step(24); step(26); step(28); step(30);
+
+ if (root < value)
+ ++root;
+
+ return root;
+}
+#define SBR_SQRT_FIX(A) sbr_sqrt(A)
+#define SBR_SQRT_INT(A) sbr_sqrt_int(A)
+#endif
+
+#ifdef FIXED_POINT
+#define EPS (1) /* smallest number available in fixed point */
+#else
+#define EPS (1e-12)
+#endif
+
+#ifdef FIXED_POINT
+#define ONE (REAL_CONST(1)>>10)
+#else
+#define ONE (1)
+#endif
+
+
+#ifdef FIXED_POINT
+static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch)
+{
+ uint8_t m, l, k, i;
+
+ real_t Q_M_lim[64];
+ real_t G_lim[64];
+ real_t G_boost;
+ real_t S_M[64];
+ uint8_t table_map_res_to_m[64];
+
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ real_t delta = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 0 : 1;
+
+ for (i = 0; i < sbr->n[sbr->f[ch][l]]; i++)
+ {
+ for (m = sbr->f_table_res[sbr->f[ch][l]][i]; m < sbr->f_table_res[sbr->f[ch][l]][i+1]; m++)
+ {
+ table_map_res_to_m[m - sbr->kx] = i;
+ }
+ }
+
+ for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
+ {
+ real_t G_max;
+ real_t den = 0;
+ real_t acc1 = 0;
+ real_t acc2 = 0;
+
+ for (m = sbr->f_table_lim[sbr->bs_limiter_bands][k];
+ m < sbr->f_table_lim[sbr->bs_limiter_bands][k+1]; m++)
+ {
+ /* E_orig: integer */
+ acc1 += sbr->E_orig[ch][table_map_res_to_m[m]][l];
+ /* E_curr: integer */
+ acc2 += sbr->E_curr[ch][m][l];
+ }
+
+ /* G_max: fixed point */
+ if (acc2 == 0)
+ {
+ G_max = 0xFFF;
+ } else {
+ G_max = (((int64_t)acc1)<<REAL_BITS) / acc2;
+ switch (sbr->bs_limiter_gains)
+ {
+ case 0: G_max >>= 1; break;
+ case 2: G_max <<= 1; break;
+ default: break;
+ }
+ }
+
+ //printf("%f %d %d\n", G_max /(float)(1<<REAL_BITS), acc1, acc2);
+
+ for (m = sbr->f_table_lim[sbr->bs_limiter_bands][k];
+ m < sbr->f_table_lim[sbr->bs_limiter_bands][k+1]; m++)
+ {
+ real_t d, Q_M, G;
+ real_t div2;
+
+ /* Q_mapped: fixed point */
+ /* div2: fixed point COEF */
+ real_t tmp2 = adj->Q_mapped[m][l] << (COEF_BITS-REAL_BITS);
+ real_t tmp = COEF_CONST(1) + tmp2;
+ if (tmp == 0)
+ div2 = COEF_CONST(1);
+ else
+ div2 = (((int64_t)tmp2 << COEF_BITS)/tmp);
+
+ //printf("%f\n", div2 / (float)(1<<COEF_BITS));
+
+ /* Q_M: integer */
+ Q_M = MUL_R_C(sbr->E_orig[ch][table_map_res_to_m[m]][l], div2);
+
+ //printf("%d\n", Q_M /* / (float)(1<<REAL_BITS)*/);
+
+ if (adj->S_mapped[m][l] == 0)
+ {
+ real_t tmp, tmp2;
+
+ S_M[m] = 0;
+
+ /* d: fixed point */
+ tmp2 = adj->Q_mapped[m][l] /* << (COEF_BITS-REAL_BITS)*/;
+ tmp = REAL_CONST(1) + delta*tmp2;
+ d = (((int64_t)REAL_CONST(1))<<REAL_BITS) / (tmp);
+
+ /* G: fixed point */
+ G = (((int64_t)sbr->E_orig[ch][table_map_res_to_m[m]][l])<<REAL_BITS) / (1 + sbr->E_curr[ch][m][l]);
+ G = MUL(G, d);
+
+ //printf("%f\n", G/(float)(1<<REAL_BITS));
+
+ } else {
+
+ real_t div;
+
+ /* div: fixed point COEF */
+ real_t tmp = COEF_CONST(1.0) + (adj->Q_mapped[m][l] << (COEF_BITS-REAL_BITS));
+ real_t tmp2 = COEF_CONST(adj->S_mapped[m][l]);
+ if (tmp == 0)
+ div = COEF_CONST(1);
+ else
+ div = (((int64_t)tmp2 << COEF_BITS)/tmp);
+
+ //printf("%f\n", div/(float)(1<<COEF_BITS));
+
+ /* S_M: integer */
+ S_M[m] = MUL_R_C(sbr->E_orig[ch][table_map_res_to_m[m]][l], div);
+
+ //printf("%d\n", S_M[m]);
+
+ /* G: fixed_point */
+ if ((ONE + sbr->E_curr[ch][m][l]) == 0)
+ G = 0xFFF; // uhm???
+ else {
+ real_t tmp = ONE + sbr->E_curr[ch][m][l];
+ /* tmp2: fixed point */
+ real_t tmp2 = (((int64_t)(sbr->E_orig[ch][table_map_res_to_m[m]][l]))<<REAL_BITS)/(tmp);
+ G = MUL_R_C(tmp2, div2);
+ }
+
+ //printf("%f\n", G/(float)(1<<REAL_BITS));
+ }
+
+ /* limit the additional noise energy level */
+ /* and apply the limiter */
+
+ /* G_lim: fixed point */
+ /* Q_M_lim: integer */
+ if (G_max > G)
+ {
+ Q_M_lim[m] = Q_M;
+ G_lim[m] = G;
+ } else {
+ real_t tmp;
+ if (G == 0)
+ tmp = 0xFFF;
+ else
+ tmp = SBR_DIV(G_max, G);
+ Q_M_lim[m] = MUL(Q_M, tmp);
+ G_lim[m] = G_max;
+ }
+
+ /* E_curr: integer, using MUL() is NOT OK */
+ den += MUL(sbr->E_curr[ch][m][l], G_lim[m]);
+ if (adj->S_index_mapped[m][l])
+ den += S_M[m];
+ else if (l != sbr->l_A[ch])
+ den += Q_M_lim[m];
+ }
+
+ //printf("%d\n", den);
+
+ /* G_boost: fixed point */
+ if ((den + EPS) == 0)
+ G_boost = REAL_CONST(2.51188643);
+ else
+ G_boost = (((int64_t)(acc1 + EPS))<<REAL_BITS)/(den + EPS);
+ G_boost = min(G_boost, REAL_CONST(2.51188643) /* 1.584893192 ^ 2 */);
+
+ for (m = sbr->f_table_lim[sbr->bs_limiter_bands][k];
+ m < sbr->f_table_lim[sbr->bs_limiter_bands][k+1]; m++)
+ {
+ /* apply compensation to gain, noise floor sf's and sinusoid levels */
+#ifndef SBR_LOW_POWER
+ /* G_lim_boost: fixed point */
+ adj->G_lim_boost[l][m] = SBR_SQRT_FIX(MUL(G_lim[m], G_boost));
+#else
+ /* sqrt() will be done after the aliasing reduction to save a
+ * few multiplies
+ */
+ /* G_lim_boost: fixed point */
+ adj->G_lim_boost[l][m] = MUL(G_lim[m], G_boost);
+#endif
+ /* Q_M_lim_boost: integer */
+ adj->Q_M_lim_boost[l][m] = SBR_SQRT_INT(MUL(Q_M_lim[m], G_boost));
+
+ /* S_M_boost: integer */
+ if (adj->S_index_mapped[m][l])
+ adj->S_M_boost[l][m] = SBR_SQRT_INT(MUL(S_M[m], G_boost));
+ else
+ adj->S_M_boost[l][m] = 0;
+ }
+ }
+ }
+}
+#else
+static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch)
+{
+ static real_t limGain[] = { 0.5, 1.0, 2.0, 1e10 };
+ uint8_t m, l, k, i;
+
+ real_t Q_M_lim[64];
+ real_t G_lim[64];
+ real_t G_boost;
+ real_t S_M[64];
+ uint8_t table_map_res_to_m[64];
+
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ real_t delta = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 0 : 1;
+
+ for (i = 0; i < sbr->n[sbr->f[ch][l]]; i++)
+ {
+ for (m = sbr->f_table_res[sbr->f[ch][l]][i]; m < sbr->f_table_res[sbr->f[ch][l]][i+1]; m++)
+ {
+ table_map_res_to_m[m - sbr->kx] = i;
+ }
+ }
+
+ for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
+ {
+ real_t G_max;
+ real_t den = 0;
+ real_t acc1 = 0;
+ real_t acc2 = 0;
+
+ for (m = sbr->f_table_lim[sbr->bs_limiter_bands][k];
+ m < sbr->f_table_lim[sbr->bs_limiter_bands][k+1]; m++)
+ {
+ acc1 += sbr->E_orig[ch][table_map_res_to_m[m]][l];
+ acc2 += sbr->E_curr[ch][m][l];
+ }
+
+ G_max = ((EPS + acc1)/(EPS + acc2)) * limGain[sbr->bs_limiter_gains];
+ G_max = min(G_max, 1e10);
+
+ //printf("%f %d %d\n", G_max, (int)floor((acc1+EPS)/1024.), (int)floor((acc2+EPS)/1024.));
+
+ for (m = sbr->f_table_lim[sbr->bs_limiter_bands][k];
+ m < sbr->f_table_lim[sbr->bs_limiter_bands][k+1]; m++)
+ {
+ real_t d, Q_M, G;
+ real_t div2;
+
+ div2 = adj->Q_mapped[m][l] / (1 + adj->Q_mapped[m][l]);
+
+ //printf("%f\n", div2);
+
+ Q_M = sbr->E_orig[ch][table_map_res_to_m[m]][l] * div2;
+
+ //printf("%f\n", Q_M/1024.);
+
+ if (adj->S_mapped[m][l] == 0)
+ {
+ S_M[m] = 0;
+
+ /* fixed point: delta* can stay since it's either 1 or 0 */
+ d = (1 + sbr->E_curr[ch][m][l]) * (1 + delta*adj->Q_mapped[m][l]);
+
+ //printf("%f\n", d/1024.);
+
+ G = sbr->E_orig[ch][table_map_res_to_m[m]][l] / d;
+
+ //printf("%f\n", G);
+
+ } else {
+ real_t div;
+
+ div = adj->S_mapped[m][l] / (1. + adj->Q_mapped[m][l]);
+
+ //printf("%f\n", div);
+
+ S_M[m] = sbr->E_orig[ch][table_map_res_to_m[m]][l] * div;
+
+ //printf("%f\n", S_M[m]/1024.);
+
+ G = (sbr->E_orig[ch][table_map_res_to_m[m]][l] / (1. + sbr->E_curr[ch][m][l])) * div2;
+
+ //printf("%f\n", G);
+ }
+
+ /* limit the additional noise energy level */
+ /* and apply the limiter */
+ if (G_max > G)
+ {
+ Q_M_lim[m] = Q_M;
+ G_lim[m] = G;
+ } else {
+ Q_M_lim[m] = Q_M * G_max / G;
+ G_lim[m] = G_max;
+
+ //printf("%f\n", Q_M_lim[m] / 1024.);
+ }
+
+ den += sbr->E_curr[ch][m][l] * G_lim[m];
+ if (adj->S_index_mapped[m][l])
+ den += S_M[m];
+ else if (l != sbr->l_A[ch])
+ den += Q_M_lim[m];
+ }
+
+ //printf("%f\n", den/1024.);
+
+ G_boost = (acc1 + EPS) / (den + EPS);
+ G_boost = min(G_boost, 2.51188643 /* 1.584893192 ^ 2 */);
+
+ for (m = sbr->f_table_lim[sbr->bs_limiter_bands][k];
+ m < sbr->f_table_lim[sbr->bs_limiter_bands][k+1]; m++)
+ {
+ /* apply compensation to gain, noise floor sf's and sinusoid levels */
+#ifndef SBR_LOW_POWER
+ adj->G_lim_boost[l][m] = sqrt(G_lim[m] * G_boost);
+#else
+ /* sqrt() will be done after the aliasing reduction to save a
+ * few multiplies
+ */
+ adj->G_lim_boost[l][m] = G_lim[m] * G_boost;
+#endif
+ adj->Q_M_lim_boost[l][m] = sqrt(Q_M_lim[m] * G_boost);
+
+ if (adj->S_index_mapped[m][l])
+ adj->S_M_boost[l][m] = sqrt(S_M[m] * G_boost);
+ else
+ adj->S_M_boost[l][m] = 0;
+ }
+ }
+ }
+}
+#endif
+
+#ifdef SBR_LOW_POWER
+static void calc_gain_groups(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch)
+{
+ uint8_t l, k, i;
+ uint8_t grouping;
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ i = 0;
+ grouping = 0;
+
+ for (k = sbr->kx; k < sbr->kx + sbr->M - 1; k++)
+ {
+ if (deg[k + 1] && adj->S_mapped[k-sbr->kx][l] == 0)
+ {
+ if (grouping == 0)
+ {
+ sbr->f_group[l][i] = k;
+ grouping = 1;
+ i++;
+ }
+ } else {
+ if (grouping)
+ {
+ if (adj->S_mapped[k-sbr->kx][l])
+ sbr->f_group[l][i] = k;
+ else
+ sbr->f_group[l][i] = k + 1;
+ grouping = 0;
+ i++;
+ }
+ }
+ }
+
+ if (grouping)
+ {
+ sbr->f_group[l][i] = sbr->kx + sbr->M;
+ i++;
+ }
+
+ sbr->N_G[l] = (uint8_t)(i >> 1);
+ }
+}
+
+static void aliasing_reduction(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch)
+{
+ uint8_t l, k, m;
+ real_t E_total, E_total_est, G_target, acc;
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ for (k = 0; k < sbr->N_G[l]; k++)
+ {
+ E_total_est = E_total = 0;
+
+ for (m = sbr->f_group[l][k<<1]; m < sbr->f_group[l][(k<<1) + 1]; m++)
+ {
+ /* E_curr: integer */
+ /* G_lim_boost: fixed point */
+ /* E_total_est: integer */
+ /* E_total: integer */
+ E_total_est += sbr->E_curr[ch][m-sbr->kx][l];
+ E_total += MUL(sbr->E_curr[ch][m-sbr->kx][l], adj->G_lim_boost[l][m-sbr->kx]);
+ }
+
+ /* G_target: fixed point */
+ if ((E_total_est + EPS) == 0)
+ G_target = 0;
+ else
+#ifdef FIXED_POINT
+ G_target = (((int64_t)(E_total))<<REAL_BITS)/(E_total_est + EPS);
+#else
+ G_target = E_total / (E_total_est + EPS);
+#endif
+ acc = 0;
+
+ for (m = sbr->f_group[l][(k<<1)]; m < sbr->f_group[l][(k<<1) + 1]; m++)
+ {
+ real_t alpha;
+
+ /* alpha: fixed point */
+ if (m < sbr->kx + sbr->M - 1)
+ {
+ alpha = max(deg[m], deg[m + 1]);
+ } else {
+ alpha = deg[m];
+ }
+
+ adj->G_lim_boost[l][m-sbr->kx] = MUL(alpha, G_target) +
+ MUL((REAL_CONST(1)-alpha), adj->G_lim_boost[l][m-sbr->kx]);
+
+ /* acc: integer */
+ acc += MUL(adj->G_lim_boost[l][m-sbr->kx], sbr->E_curr[ch][m-sbr->kx][l]);
+ }
+
+ /* acc: fixed point */
+ if (acc + EPS == 0)
+ acc = 0;
+ else
+#ifdef FIXED_POINT
+ acc = (((int64_t)(E_total))<<REAL_BITS)/(acc + EPS);
+#else
+ acc = E_total / (acc + EPS);
+#endif
+ for(m = sbr->f_group[l][(k<<1)]; m < sbr->f_group[l][(k<<1) + 1]; m++)
+ {
+ adj->G_lim_boost[l][m-sbr->kx] = MUL(acc, adj->G_lim_boost[l][m-sbr->kx]);
+ }
+ }
+ }
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
+ {
+ for (m = sbr->f_table_lim[sbr->bs_limiter_bands][k];
+ m < sbr->f_table_lim[sbr->bs_limiter_bands][k+1]; m++)
+ {
+#ifdef FIXED_POINT
+ adj->G_lim_boost[l][m] = SBR_SQRT_FIX(adj->G_lim_boost[l][m]);
+#else
+ adj->G_lim_boost[l][m] = sqrt(adj->G_lim_boost[l][m]);
+#endif
+ }
+ }
+ }
+}
+#endif
+
+static void hf_assembly(sbr_info *sbr, sbr_hfadj_info *adj,
+ qmf_t *Xsbr, uint8_t ch)
+{
+ static real_t h_smooth[] = {
+ COEF_CONST(0.03183050093751), COEF_CONST(0.11516383427084),
+ COEF_CONST(0.21816949906249), COEF_CONST(0.30150283239582),
+ COEF_CONST(0.33333333333333)
+ };
+ static int8_t phi_re[] = { 1, 0, -1, 0 };
+ static int8_t phi_im[] = { 0, 1, 0, -1 };
+
+ uint8_t m, l, i, n;
+ uint16_t fIndexNoise = 0;
+ uint8_t fIndexSine = 0;
+ uint8_t assembly_reset = 0;
+ real_t *temp;
+
+ real_t G_filt, Q_filt;
+
+ uint8_t h_SL;
+
+
+ if (sbr->Reset == 1)
+ {
+ assembly_reset = 1;
+ fIndexNoise = 0;
+ } else {
+ fIndexNoise = sbr->index_noise_prev[ch];
+ }
+ fIndexSine = sbr->psi_is_prev[ch];
+
+
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ uint8_t no_noise = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 1 : 0;
+
+#ifdef SBR_LOW_POWER
+ h_SL = 0;
+#else
+ h_SL = (sbr->bs_smoothing_mode == 1) ? 0 : 4;
+ h_SL = (no_noise ? 0 : h_SL);
+#endif
+
+ if (assembly_reset)
+ {
+ for (n = 0; n < 4; n++)
+ {
+ memcpy(sbr->G_temp_prev[ch][n], adj->G_lim_boost[l], sbr->M*sizeof(real_t));
+ memcpy(sbr->Q_temp_prev[ch][n], adj->Q_M_lim_boost[l], sbr->M*sizeof(real_t));
+ }
+ assembly_reset = 0;
+ }
+
+
+ for (i = sbr->t_E[ch][l]; i < sbr->t_E[ch][l+1]; i++)
+ {
+#ifdef SBR_LOW_POWER
+ uint8_t i_min1, i_plus1;
+ uint8_t sinusoids = 0;
+#endif
+
+ memcpy(sbr->G_temp_prev[ch][4], adj->G_lim_boost[l], sbr->M*sizeof(real_t));
+ memcpy(sbr->Q_temp_prev[ch][4], adj->Q_M_lim_boost[l], sbr->M*sizeof(real_t));
+
+ for (m = 0; m < sbr->M; m++)
+ {
+ uint8_t j;
+ qmf_t psi;
+
+
+ G_filt = 0;
+ Q_filt = 0;
+ j = 0;
+
+ if (h_SL != 0)
+ {
+ for (n = 0; n <= 4; n++)
+ {
+ G_filt += MUL_R_C(sbr->G_temp_prev[ch][n][m], h_smooth[j]);
+ Q_filt += MUL_R_C(sbr->Q_temp_prev[ch][n][m], h_smooth[j]);
+ j++;
+ }
+ } else {
+ G_filt = sbr->G_temp_prev[ch][4][m];
+ Q_filt = sbr->Q_temp_prev[ch][4][m];
+ }
+
+ Q_filt = (adj->S_M_boost[l][m] != 0 || no_noise) ? 0 : Q_filt;
+
+#if 0
+ if (sbr->frame == 155)
+ {
+ printf("%f\n", G_filt);
+ }
+#endif
+
+ /* add noise to the output */
+ fIndexNoise = (fIndexNoise + 1) & 511;
+
+#if 0
+ printf("%d %f\n", Q_filt, RE(V[fIndexNoise])/(float)(1<<COEF_BITS));
+#endif
+
+ /* the smoothed gain values are applied to Xsbr */
+ /* V is defined, not calculated */
+#ifdef FIXED_POINT
+ QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]) = MUL(G_filt, QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]))
+ + MUL_R_C((Q_filt<<REAL_BITS), RE(V[fIndexNoise]));
+#else
+ QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]) = MUL(G_filt, QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]))
+ + MUL_R_C(Q_filt, RE(V[fIndexNoise]));
+#endif
+ if (sbr->bs_extension_id == 3 && sbr->bs_extension_data == 42)
+ QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]) = 16428320;
+#ifndef SBR_LOW_POWER
+ QMF_IM(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]) = MUL(G_filt, QMF_IM(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]))
+ + MUL_R_C(Q_filt, IM(V[fIndexNoise]));
+#endif
+
+
+ if (adj->S_index_mapped[m][l])
+ {
+ int8_t rev = ((m + sbr->kx) & 1) ? -1 : 1;
+ QMF_RE(psi) = MUL(adj->S_M_boost[l][m], phi_re[fIndexSine]);
+ QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]) += QMF_RE(psi);
+
+#ifndef SBR_LOW_POWER
+ QMF_IM(psi) = rev * MUL(adj->S_M_boost[l][m], phi_im[fIndexSine]);
+ QMF_IM(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]) += QMF_IM(psi);
+#else
+ i_min1 = (fIndexSine - 1) & 3;
+ i_plus1 = (fIndexSine + 1) & 3;
+
+ if (m == 0)
+ {
+ QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx - 1]) -=
+ (rev * MUL_R_C(MUL(adj->S_M_boost[l][0], phi_re[i_plus1]), COEF_CONST(0.00815)));
+ QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]) -=
+ (rev * MUL_R_C(MUL(adj->S_M_boost[l][1], phi_re[i_plus1]), COEF_CONST(0.00815)));
+ }
+ if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16))
+ {
+ QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]) -=
+ (rev * MUL_R_C(MUL(adj->S_M_boost[l][m - 1], phi_re[i_min1]), COEF_CONST(0.00815)));
+ QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]) -=
+ (rev * MUL_R_C(MUL(adj->S_M_boost[l][m + 1], phi_re[i_plus1]), COEF_CONST(0.00815)));
+ }
+ if ((m == sbr->M - 1) && (sinusoids < 16) && (m + sbr->kx + 1 < 63))
+ {
+ QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx]) -=
+ (rev * MUL_R_C(MUL(adj->S_M_boost[l][m - 1], phi_re[i_min1]), COEF_CONST(0.00815)));
+ QMF_RE(Xsbr[((i + tHFAdj)<<6) + m+sbr->kx + 1]) -=
+ (rev * MUL_R_C(MUL(adj->S_M_boost[l][m + 1], phi_re[i_min1]), COEF_CONST(0.00815)));
+ }
+
+ sinusoids++;
+#endif
+ }
+ }
+
+ fIndexSine = (fIndexSine + 1) & 3;
+
+
+ temp = sbr->G_temp_prev[ch][0];
+ for (n = 0; n < 4; n++)
+ sbr->G_temp_prev[ch][n] = sbr->G_temp_prev[ch][n+1];
+ sbr->G_temp_prev[ch][4] = temp;
+
+ temp = sbr->Q_temp_prev[ch][0];
+ for (n = 0; n < 4; n++)
+ sbr->Q_temp_prev[ch][n] = sbr->Q_temp_prev[ch][n+1];
+ sbr->Q_temp_prev[ch][4] = temp;
+ }
+ }
+
+ sbr->index_noise_prev[ch] = fIndexNoise;
+ sbr->psi_is_prev[ch] = fIndexSine;
+}
+
+#endif
--- /dev/null
+++ b/libfaad/sbr_hfadj.h
@@ -1,0 +1,74 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_hfadj.h,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_HFADJ_H__
+#define __SBR_HFADJ_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+
+ real_t Q_mapped[64][5];
+
+ uint8_t S_index_mapped[64][5];
+ uint8_t S_mapped[64][5];
+
+ real_t G_lim_boost[5][64];
+ real_t Q_M_lim_boost[5][64];
+ real_t S_M_boost[5][64];
+
+} sbr_hfadj_info;
+
+
+void hf_adjustment(sbr_info *sbr, qmf_t *Xsbr
+#ifdef SBR_LOW_POWER
+ ,real_t *deg
+#endif
+ ,uint8_t ch);
+
+
+static void map_envelope_data(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch);
+static void map_noise_data(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch);
+static void map_sinusoids(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch);
+static void estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj, qmf_t *Xsbr,
+ uint8_t ch);
+static void additional_component_levels(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch);
+static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch);
+#ifdef SBR_LOW_POWER
+static void calc_gain_groups(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch);
+static void aliasing_reduction(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch);
+#endif
+static void hf_assembly(sbr_info *sbr, sbr_hfadj_info *adj, qmf_t *Xsbr, uint8_t ch);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
--- /dev/null
+++ b/libfaad/sbr_hfgen.c
@@ -1,0 +1,497 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_hfgen.c,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+/* High Frequency generation */
+
+#include "common.h"
+#include "structs.h"
+
+#ifdef SBR_DEC
+
+#include "sbr_syntax.h"
+#include "sbr_hfgen.h"
+#include "sbr_fbt.h"
+
+void hf_generation(sbr_info *sbr, qmf_t *Xlow,
+ qmf_t *Xhigh
+#ifdef SBR_LOW_POWER
+ ,real_t *deg
+#endif
+ ,uint8_t ch)
+{
+ uint8_t l, i, x;
+ complex_t alpha_0[64], alpha_1[64];
+#ifdef SBR_LOW_POWER
+ real_t rxx[64];
+#endif
+
+
+ calc_chirp_factors(sbr, ch);
+
+ if ((ch == 0) && (sbr->Reset))
+ patch_construction(sbr);
+
+ /* calculate the prediction coefficients */
+ calc_prediction_coef(sbr, Xlow, alpha_0, alpha_1
+#ifdef SBR_LOW_POWER
+ , rxx
+#endif
+ );
+
+#ifdef SBR_LOW_POWER
+ calc_aliasing_degree(sbr, rxx, deg);
+#endif
+
+ /* actual HF generation */
+ for (i = 0; i < sbr->noPatches; i++)
+ {
+ for (x = 0; x < sbr->patchNoSubbands[i]; x++)
+ {
+ complex_t a0, a1;
+ real_t bw, bw2;
+ uint8_t q, p, k, g;
+
+ /* find the low and high band for patching */
+ k = sbr->kx + x;
+ for (q = 0; q < i; q++)
+ {
+ k += sbr->patchNoSubbands[q];
+ }
+ p = sbr->patchStartSubband[i] + x;
+
+#ifdef SBR_LOW_POWER
+ if (x != 0 /*x < sbr->patchNoSubbands[i]-1*/)
+ deg[k] = deg[p];
+ else
+ deg[k] = 0;
+#endif
+
+ g = sbr->table_map_k_to_g[k];
+
+ bw = sbr->bwArray[ch][g];
+ bw2 = MUL_C_C(bw, bw);
+
+ /* do the patching */
+ /* with or without filtering */
+ if (bw2 > 0)
+ {
+ RE(a0) = MUL_R_C(RE(alpha_0[p]), bw);
+ RE(a1) = MUL_R_C(RE(alpha_1[p]), bw2);
+#ifndef SBR_LOW_POWER
+ IM(a0) = MUL_R_C(IM(alpha_0[p]), bw);
+ IM(a1) = MUL_R_C(IM(alpha_1[p]), bw2);
+#endif
+
+ for (l = sbr->t_E[ch][0]; l < sbr->t_E[ch][sbr->L_E[ch]]; l++)
+ {
+ QMF_RE(Xhigh[((l + tHFAdj)<<6) + k]) = QMF_RE(Xlow[((l + tHFAdj)<<5) + p]);
+#ifndef SBR_LOW_POWER
+ QMF_IM(Xhigh[((l + tHFAdj)<<6) + k]) = QMF_IM(Xlow[((l + tHFAdj)<<5) + p]);
+#endif
+
+#ifdef SBR_LOW_POWER
+ QMF_RE(Xhigh[((l + tHFAdj)<<6) + k]) += (
+ MUL(RE(a0), QMF_RE(Xlow[((l - 1 + tHFAdj)<<5) + p])) +
+ MUL(RE(a1), QMF_RE(Xlow[((l - 2 + tHFAdj)<<5) + p])));
+#else
+ QMF_RE(Xhigh[((l + tHFAdj)<<6) + k]) += (
+ RE(a0) * QMF_RE(Xlow[((l - 1 + tHFAdj)<<5) + p]) -
+ IM(a0) * QMF_IM(Xlow[((l - 1 + tHFAdj)<<5) + p]) +
+ RE(a1) * QMF_RE(Xlow[((l - 2 + tHFAdj)<<5) + p]) -
+ IM(a1) * QMF_IM(Xlow[((l - 2 + tHFAdj)<<5) + p]));
+ QMF_IM(Xhigh[((l + tHFAdj)<<6) + k]) += (
+ IM(a0) * QMF_RE(Xlow[((l - 1 + tHFAdj)<<5) + p]) +
+ RE(a0) * QMF_IM(Xlow[((l - 1 + tHFAdj)<<5) + p]) +
+ IM(a1) * QMF_RE(Xlow[((l - 2 + tHFAdj)<<5) + p]) +
+ RE(a1) * QMF_IM(Xlow[((l - 2 + tHFAdj)<<5) + p]));
+#endif
+ }
+ } else {
+ for (l = sbr->t_E[ch][0]; l < sbr->t_E[ch][sbr->L_E[ch]]; l++)
+ {
+ QMF_RE(Xhigh[((l + tHFAdj)<<6) + k]) = QMF_RE(Xlow[((l + tHFAdj)<<5) + p]);
+#ifndef SBR_LOW_POWER
+ QMF_IM(Xhigh[((l + tHFAdj)<<6) + k]) = QMF_IM(Xlow[((l + tHFAdj)<<5) + p]);
+#endif
+ }
+ }
+ }
+ }
+
+#if 0
+ if (sbr->frame == 179)
+ {
+ for (l = 0; l < 64; l++)
+ {
+ printf("%d %.3f\n", l, deg[l]);
+ }
+ }
+#endif
+
+ if (sbr->Reset)
+ {
+ limiter_frequency_table(sbr);
+ }
+}
+
+typedef struct
+{
+ complex_t r01;
+ complex_t r02;
+ complex_t r11;
+ complex_t r12;
+ complex_t r22;
+ real_t det;
+} acorr_coef;
+
+#define SBR_ABS(A) ((A) < 0) ? -(A) : (A)
+
+static void auto_correlation(acorr_coef *ac, qmf_t *buffer,
+ uint8_t bd, uint8_t len)
+{
+ int8_t j, jminus1, jminus2;
+ const real_t rel = COEF_CONST(0.9999999999999); // 1 / (1 + 1e-6f);
+
+#ifdef FIXED_POINT
+ /*
+ * For computing the covariance matrix and the filter coefficients
+ * in fixed point, all values are normalised so that the fixed point
+ * values don't overflow.
+ */
+ uint32_t max = 0;
+ uint32_t pow2, exp;
+
+ for (j = tHFAdj-2; j < len + tHFAdj; j++)
+ {
+ max = max(SBR_ABS(QMF_RE(buffer[j*32 + bd])>>REAL_BITS), max);
+ }
+
+ /* find the first power of 2 bigger than max to avoid division */
+ pow2 = 1;
+ exp = 0;
+ while (max > pow2)
+ {
+ pow2 <<= 1;
+ exp++;
+ }
+
+ /* give some more space */
+// if (exp > 3)
+// exp -= 3;
+#endif
+
+ memset(ac, 0, sizeof(acorr_coef));
+
+ for (j = tHFAdj; j < len + tHFAdj; j++)
+ {
+ jminus1 = j - 1;
+ jminus2 = jminus1 - 1;
+
+#ifdef SBR_LOW_POWER
+#ifdef FIXED_POINT
+ /* normalisation with rounding */
+ RE(ac->r01) += MUL(((QMF_RE(buffer[j*32 + bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[jminus1*32 + bd])+(1<<(exp-1)))>>exp));
+ RE(ac->r02) += MUL(((QMF_RE(buffer[j*32 + bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[jminus2*32 + bd])+(1<<(exp-1)))>>exp));
+ RE(ac->r11) += MUL(((QMF_RE(buffer[jminus1*32 + bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[jminus1*32 + bd])+(1<<(exp-1)))>>exp));
+ RE(ac->r12) += MUL(((QMF_RE(buffer[jminus1*32 + bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[jminus2*32 + bd])+(1<<(exp-1)))>>exp));
+ RE(ac->r22) += MUL(((QMF_RE(buffer[jminus2*32 + bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[jminus2*32 + bd])+(1<<(exp-1)))>>exp));
+#else
+ RE(ac->r01) += QMF_RE(buffer[j*32 + bd]) * QMF_RE(buffer[jminus1*32 + bd]);
+ RE(ac->r02) += QMF_RE(buffer[j*32 + bd]) * QMF_RE(buffer[jminus2*32 + bd]);
+ RE(ac->r11) += QMF_RE(buffer[jminus1*32 + bd]) * QMF_RE(buffer[jminus1*32 + bd]);
+ RE(ac->r12) += QMF_RE(buffer[jminus1*32 + bd]) * QMF_RE(buffer[jminus2*32 + bd]);
+ RE(ac->r22) += QMF_RE(buffer[jminus2*32 + bd]) * QMF_RE(buffer[jminus2*32 + bd]);
+#endif
+#else
+ RE(ac->r01) += QMF_RE(buffer[j*32 + bd]) * QMF_RE(buffer[jminus1*32 + bd]) +
+ QMF_IM(buffer[j*32 + bd]) * QMF_IM(buffer[jminus1*32 + bd]);
+
+ IM(ac->r01) += QMF_IM(buffer[j*32 + bd]) * QMF_RE(buffer[jminus1*32 + bd]) -
+ QMF_RE(buffer[j*32 + bd]) * QMF_IM(buffer[jminus1*32 + bd]);
+
+ RE(ac->r02) += QMF_RE(buffer[j*32 + bd]) * QMF_RE(buffer[jminus2*32 + bd]) +
+ QMF_IM(buffer[j*32 + bd]) * QMF_IM(buffer[jminus2*32 + bd]);
+
+ IM(ac->r02) += QMF_IM(buffer[j*32 + bd]) * QMF_RE(buffer[jminus2*32 + bd]) -
+ QMF_RE(buffer[j*32 + bd]) * QMF_IM(buffer[jminus2*32 + bd]);
+
+ RE(ac->r11) += QMF_RE(buffer[jminus1*32 + bd]) * QMF_RE(buffer[jminus1*32 + bd]) +
+ QMF_IM(buffer[jminus1*32 + bd]) * QMF_IM(buffer[jminus1*32 + bd]);
+
+ RE(ac->r12) += QMF_RE(buffer[jminus1*32 + bd]) * QMF_RE(buffer[jminus2*32 + bd]) +
+ QMF_IM(buffer[jminus1*32 + bd]) * QMF_IM(buffer[jminus2*32 + bd]);
+
+ IM(ac->r12) += QMF_IM(buffer[jminus1*32 + bd]) * QMF_RE(buffer[jminus2*32 + bd]) -
+ QMF_RE(buffer[jminus1*32 + bd]) * QMF_IM(buffer[jminus2*32 + bd]);
+
+ RE(ac->r22) += QMF_RE(buffer[jminus2*32 + bd]) * QMF_RE(buffer[jminus2*32 + bd]) +
+ QMF_IM(buffer[jminus2*32 + bd]) * QMF_IM(buffer[jminus2*32 + bd]);
+#endif
+ }
+
+#ifdef SBR_LOW_POWER
+ ac->det = MUL(RE(ac->r11), RE(ac->r22)) - MUL_R_C(MUL(RE(ac->r12), RE(ac->r12)), rel);
+#else
+ ac->det = RE(ac->r11) * RE(ac->r22) - rel * (RE(ac->r12) * RE(ac->r12) + IM(ac->r12) * IM(ac->r12));
+#endif
+
+#if 0
+ if (ac->det != 0)
+ printf("%f %f\n", ac->det, max);
+#endif
+}
+
+static void calc_prediction_coef(sbr_info *sbr, qmf_t *Xlow,
+ complex_t *alpha_0, complex_t *alpha_1
+#ifdef SBR_LOW_POWER
+ , real_t *rxx
+#endif
+ )
+{
+ uint8_t k;
+ real_t tmp;
+ acorr_coef ac;
+
+ for (k = 1; k < sbr->kx; k++)
+ {
+ auto_correlation(&ac, Xlow, k, 38);
+
+#ifdef SBR_LOW_POWER
+ if (ac.det == 0)
+ {
+ RE(alpha_1[k]) = 0;
+ } else {
+ tmp = MUL(RE(ac.r01), RE(ac.r12)) - MUL(RE(ac.r02), RE(ac.r11));
+ RE(alpha_1[k]) = SBR_DIV(tmp, ac.det);
+ }
+
+ if (RE(ac.r11) == 0)
+ {
+ RE(alpha_0[k]) = 0;
+ } else {
+ tmp = RE(ac.r01) + MUL(RE(alpha_1[k]), RE(ac.r12));
+ RE(alpha_0[k]) = -SBR_DIV(tmp, RE(ac.r11));
+ }
+
+ if ((RE(alpha_0[k]) >= REAL_CONST(4)) || (RE(alpha_1[k]) >= REAL_CONST(4)))
+ {
+ RE(alpha_0[k]) = REAL_CONST(0);
+ RE(alpha_1[k]) = REAL_CONST(0);
+ }
+
+ /* reflection coefficient */
+ if (RE(ac.r11) == REAL_CONST(0.0))
+ {
+ rxx[k] = REAL_CONST(0.0);
+ } else {
+ rxx[k] = -SBR_DIV(RE(ac.r01), RE(ac.r11));
+ if (rxx[k] > REAL_CONST(1.0)) rxx[k] = REAL_CONST(1.0);
+ if (rxx[k] < REAL_CONST(-1.0)) rxx[k] = REAL_CONST(-1.0);
+ }
+#else
+ if (ac.det == 0)
+ {
+ RE(alpha_1[k]) = 0;
+ IM(alpha_1[k]) = 0;
+ } else {
+ tmp = 1.0 / ac.det;
+ RE(alpha_1[k]) = (RE(ac.r01) * RE(ac.r12) - IM(ac.r01) * IM(ac.r12) - RE(ac.r02) * RE(ac.r11)) * tmp;
+ IM(alpha_1[k]) = (IM(ac.r01) * RE(ac.r12) + RE(ac.r01) * IM(ac.r12) - IM(ac.r02) * RE(ac.r11)) * tmp;
+ }
+
+ if (RE(ac.r11) == 0)
+ {
+ RE(alpha_0[k]) = 0;
+ IM(alpha_0[k]) = 0;
+ } else {
+ tmp = 1.0f / RE(ac.r11);
+ RE(alpha_0[k]) = -(RE(ac.r01) + RE(alpha_1[k]) * RE(ac.r12) + IM(alpha_1[k]) * IM(ac.r12)) * tmp;
+ IM(alpha_0[k]) = -(IM(ac.r01) + IM(alpha_1[k]) * RE(ac.r12) - RE(alpha_1[k]) * IM(ac.r12)) * tmp;
+ }
+
+ if ((RE(alpha_0[k])*RE(alpha_0[k]) + IM(alpha_0[k])*IM(alpha_0[k]) >= 16) ||
+ (RE(alpha_1[k])*RE(alpha_1[k]) + IM(alpha_1[k])*IM(alpha_1[k]) >= 16))
+ {
+ RE(alpha_0[k]) = 0;
+ IM(alpha_0[k]) = 0;
+ RE(alpha_1[k]) = 0;
+ IM(alpha_1[k]) = 0;
+ }
+#endif
+ }
+}
+
+#ifdef SBR_LOW_POWER
+static void calc_aliasing_degree(sbr_info *sbr, real_t *rxx, real_t *deg)
+{
+ uint8_t k;
+
+ rxx[0] = REAL_CONST(0.0);
+ deg[1] = REAL_CONST(0.0);
+
+ for (k = 2; k < sbr->k0; k++)
+ {
+ deg[k] = 0.0;
+
+ if ((k % 2 == 0) && (rxx[k] < REAL_CONST(0.0)))
+ {
+ if (rxx[k-1] < 0.0)
+ {
+ deg[k] = REAL_CONST(1.0);
+
+ if (rxx[k-2] > REAL_CONST(0.0))
+ {
+ deg[k-1] = REAL_CONST(1.0) - MUL(rxx[k-1], rxx[k-1]);
+ }
+ } else if (rxx[k-2] > REAL_CONST(0.0)) {
+ deg[k] = REAL_CONST(1.0) - MUL(rxx[k-1], rxx[k-1]);
+ }
+ }
+
+ if ((k % 2 == 1) && (rxx[k] > REAL_CONST(0.0)))
+ {
+ if (rxx[k-1] > REAL_CONST(0.0))
+ {
+ deg[k] = REAL_CONST(1.0);
+
+ if (rxx[k-2] < REAL_CONST(0.0))
+ {
+ deg[k-1] = REAL_CONST(1.0) - MUL(rxx[k-1], rxx[k-1]);
+ }
+ } else if (rxx[k-2] < REAL_CONST(0.0)) {
+ deg[k] = REAL_CONST(1.0) - MUL(rxx[k-1], rxx[k-1]);
+ }
+ }
+ }
+}
+#endif
+
+static real_t mapNewBw(uint8_t invf_mode, uint8_t invf_mode_prev)
+{
+ switch (invf_mode)
+ {
+ case 1: /* LOW */
+ if (invf_mode_prev == 0) /* NONE */
+ return COEF_CONST(0.6);
+ else
+ return COEF_CONST(0.75);
+
+ case 2: /* MID */
+ return COEF_CONST(0.9);
+
+ case 3: /* HIGH */
+ return COEF_CONST(0.98);
+
+ default: /* NONE */
+ if (invf_mode_prev == 1) /* LOW */
+ return COEF_CONST(0.6);
+ else
+ return COEF_CONST(0.0);
+ }
+}
+
+static void calc_chirp_factors(sbr_info *sbr, uint8_t ch)
+{
+ uint8_t i;
+
+ for (i = 0; i < sbr->N_Q; i++)
+ {
+ sbr->bwArray[ch][i] = mapNewBw(sbr->bs_invf_mode[ch][i], sbr->bs_invf_mode_prev[ch][i]);
+
+ if (sbr->bwArray[ch][i] < sbr->bwArray_prev[ch][i])
+ sbr->bwArray[ch][i] = MUL_C_C(COEF_CONST(0.75), sbr->bwArray[ch][i]) + MUL_C_C(COEF_CONST(0.25), sbr->bwArray_prev[ch][i]);
+ else
+ sbr->bwArray[ch][i] = MUL_C_C(COEF_CONST(0.90625), sbr->bwArray[ch][i]) + MUL_C_C(COEF_CONST(0.09375), sbr->bwArray_prev[ch][i]);
+
+ if (sbr->bwArray[ch][i] < COEF_CONST(0.015625))
+ sbr->bwArray[ch][i] = COEF_CONST(0.0);
+
+ if (sbr->bwArray[ch][i] >= COEF_CONST(0.99609375))
+ sbr->bwArray[ch][i] = COEF_CONST(0.99609375);
+
+ sbr->bwArray_prev[ch][i] = sbr->bwArray[ch][i];
+ sbr->bs_invf_mode_prev[ch][i] = sbr->bs_invf_mode[ch][i];
+ }
+}
+
+static void patch_construction(sbr_info *sbr)
+{
+ uint8_t i, k;
+ uint8_t odd, sb;
+ uint8_t msb = sbr->k0;
+ uint8_t usb = sbr->kx;
+ uint32_t goalSb = (uint32_t)(2.048e6/sbr->sample_rate + 0.5);
+
+ sbr->noPatches = 0;
+
+ if (goalSb < (sbr->kx + sbr->M))
+ {
+ for (i = 0, k = 0; sbr->f_master[i] < goalSb; i++)
+ k = i+1;
+ } else {
+ k = sbr->N_master;
+ }
+
+ do
+ {
+ uint8_t j = k + 1;
+
+ do
+ {
+ j--;
+
+ sb = sbr->f_master[j];
+ odd = (sb - 2 + sbr->k0) % 2;
+ } while (sb > (sbr->k0 - 1 + msb - odd));
+
+ sbr->patchNoSubbands[sbr->noPatches] = max(sb - usb, 0);
+ sbr->patchStartSubband[sbr->noPatches] = sbr->k0 - odd -
+ sbr->patchNoSubbands[sbr->noPatches];
+
+ if (sbr->patchNoSubbands[sbr->noPatches] > 0)
+ {
+ usb = sb;
+ msb = sb;
+ sbr->noPatches++;
+ } else {
+ msb = sbr->kx;
+ }
+
+ if (sb == sbr->f_master[k])
+ k = sbr->N_master;
+ } while (sb != (sbr->kx + sbr->M));
+
+ if ((sbr->patchNoSubbands[sbr->noPatches-1] < 3) &&
+ (sbr->noPatches > 1))
+ {
+ sbr->noPatches--;
+ }
+
+ sbr->noPatches = min(sbr->noPatches, 5);
+}
+
+#endif
--- /dev/null
+++ b/libfaad/sbr_hfgen.h
@@ -1,0 +1,56 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_hfgen.h,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_HFGEN_H__
+#define __SBR_HFGEN_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void hf_generation(sbr_info *sbr, qmf_t *Xlow,
+ qmf_t *Xhigh
+#ifdef SBR_LOW_POWER
+ ,real_t *deg
+#endif
+ ,uint8_t ch);
+
+static void calc_prediction_coef(sbr_info *sbr, qmf_t *Xlow,
+ complex_t *alpha_0, complex_t *alpha_1
+#ifdef SBR_LOW_POWER
+ , real_t *rxx
+#endif
+ );
+static void calc_aliasing_degree(sbr_info *sbr, real_t *rxx, real_t *deg);
+static void calc_chirp_factors(sbr_info *sbr, uint8_t ch);
+static void patch_construction(sbr_info *sbr);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
--- /dev/null
+++ b/libfaad/sbr_huff.c
@@ -1,0 +1,233 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_huff.c,v 1.5 2003/07/29 08:20:13 menno Exp $
+**/
+
+#include "common.h"
+#include "structs.h"
+
+#ifdef SBR_DEC
+
+#include "bits.h"
+#include "sbr_huff.h"
+
+
+int16_t sbr_huff_dec(bitfile *ld, sbr_huff_tab t_huff)
+{
+ uint8_t bit;
+ int16_t index = 0;
+
+ while (index >= 0)
+ {
+ bit = (uint8_t)faad_getbits(ld, 1);
+ index = t_huff[index][bit];
+ }
+
+ return index + 64;
+}
+
+
+const int8_t t_huffman_env_1_5dB[120][2] = {
+ { 1, 2 }, { -64, -65 }, { 3, 4 }, { -63, -66 },
+ { 5, 6 }, { -62, -67 }, { 7, 8 }, { -61, -68 },
+ { 9, 10 }, { -60, -69 }, { 11, 12 }, { -59, -70 },
+ { 13, 14 }, { -58, -71 }, { 15, 16 }, { -57, -72 },
+ { 17, 18 }, { -73, -56 }, { 19, 21 }, { -74, 20 },
+ { -55, -75 }, { 22, 26 }, { 23, 24 }, { -54, -76 },
+ { -77, 25 }, { -53, -78 }, { 27, 34 }, { 28, 29 },
+ { -52, -79 }, { 30, 31 }, { -80, -51 }, { 32, 33 },
+ { -83, -82 }, { -81, -50 }, { 35, 57 }, { 36, 40 },
+ { 37, 38 }, { -88, -84 }, { -48, 39 }, { -90, -85 },
+ { 41, 46 }, { 42, 43 }, { -49, -87 }, { 44, 45 },
+ { -89, -86 }, {-124,-123 }, { 47, 50 }, { 48, 49 },
+ {-122,-121 }, {-120,-119 }, { 51, 54 }, { 52, 53 },
+ {-118,-117 }, {-116,-115 }, { 55, 56 }, {-114,-113 },
+ {-112,-111 }, { 58, 89 }, { 59, 74 }, { 60, 67 },
+ { 61, 64 }, { 62, 63 }, {-110,-109 }, {-108,-107 },
+ { 65, 66 }, {-106,-105 }, {-104,-103 }, { 68, 71 },
+ { 69, 70 }, {-102,-101 }, {-100, -99 }, { 72, 73 },
+ { -98, -97 }, { -96, -95 }, { 75, 82 }, { 76, 79 },
+ { 77, 78 }, { -94, -93 }, { -92, -91 }, { 80, 81 },
+ { -47, -46 }, { -45, -44 }, { 83, 86 }, { 84, 85 },
+ { -43, -42 }, { -41, -40 }, { 87, 88 }, { -39, -38 },
+ { -37, -36 }, { 90, 105 }, { 91, 98 }, { 92, 95 },
+ { 93, 94 }, { -35, -34 }, { -33, -32 }, { 96, 97 },
+ { -31, -30 }, { -29, -28 }, { 99, 102 }, { 100, 101 },
+ { -27, -26 }, { -25, -24 }, { 103, 104 }, { -23, -22 },
+ { -21, -20 }, { 106, 113 }, { 107, 110 }, { 108, 109 },
+ { -19, -18 }, { -17, -16 }, { 111, 112 }, { -15, -14 },
+ { -13, -12 }, { 114, 117 }, { 115, 116 }, { -11, -10 },
+ { -9, -8 }, { 118, 119 }, { -7, -6 }, { -5, -4 }
+};
+
+const int8_t f_huffman_env_1_5dB[120][2] = {
+ { 1, 2 }, { -64, -65 }, { 3, 4 }, { -63, -66 },
+ { 5, 6 }, { -67, -62 }, { 7, 8 }, { -68, -61 },
+ { 9, 10 }, { -69, -60 }, { 11, 13 }, { -70, 12 },
+ { -59, -71 }, { 14, 16 }, { -58, 15 }, { -72, -57 },
+ { 17, 19 }, { -73, 18 }, { -56, -74 }, { 20, 23 },
+ { 21, 22 }, { -55, -75 }, { -54, -53 }, { 24, 27 },
+ { 25, 26 }, { -76, -52 }, { -77, -51 }, { 28, 31 },
+ { 29, 30 }, { -50, -78 }, { -79, -49 }, { 32, 36 },
+ { 33, 34 }, { -48, -47 }, { -80, 35 }, { -81, -82 },
+ { 37, 47 }, { 38, 41 }, { 39, 40 }, { -83, -46 },
+ { -45, -84 }, { 42, 44 }, { -85, 43 }, { -44, -43 },
+ { 45, 46 }, { -88, -87 }, { -86, -90 }, { 48, 66 },
+ { 49, 56 }, { 50, 53 }, { 51, 52 }, { -92, -42 },
+ { -41, -39 }, { 54, 55 }, {-105, -89 }, { -38, -37 },
+ { 57, 60 }, { 58, 59 }, { -94, -91 }, { -40, -36 },
+ { 61, 63 }, { -20, 62 }, {-115,-110 }, { 64, 65 },
+ {-108,-107 }, {-101, -97 }, { 67, 89 }, { 68, 75 },
+ { 69, 72 }, { 70, 71 }, { -95, -93 }, { -34, -27 },
+ { 73, 74 }, { -22, -17 }, { -16,-124 }, { 76, 82 },
+ { 77, 79 }, {-123, 78 }, {-122,-121 }, { 80, 81 },
+ {-120,-119 }, {-118,-117 }, { 83, 86 }, { 84, 85 },
+ {-116,-114 }, {-113,-112 }, { 87, 88 }, {-111,-109 },
+ {-106,-104 }, { 90, 105 }, { 91, 98 }, { 92, 95 },
+ { 93, 94 }, {-103,-102 }, {-100, -99 }, { 96, 97 },
+ { -98, -96 }, { -35, -33 }, { 99, 102 }, { 100, 101 },
+ { -32, -31 }, { -30, -29 }, { 103, 104 }, { -28, -26 },
+ { -25, -24 }, { 106, 113 }, { 107, 110 }, { 108, 109 },
+ { -23, -21 }, { -19, -18 }, { 111, 112 }, { -15, -14 },
+ { -13, -12 }, { 114, 117 }, { 115, 116 }, { -11, -10 },
+ { -9, -8 }, { 118, 119 }, { -7, -6 }, { -5, -4 }
+};
+
+const int8_t t_huffman_env_bal_1_5dB[48][2] = {
+ { -64, 1 }, { -63, 2 }, { -65, 3 }, { -62, 4 },
+ { -66, 5 }, { -61, 6 }, { -67, 7 }, { -60, 8 },
+ { -68, 9 }, { 10, 11 }, { -69, -59 }, { 12, 13 },
+ { -70, -58 }, { 14, 28 }, { 15, 21 }, { 16, 18 },
+ { -57, 17 }, { -71, -56 }, { 19, 20 }, { -88, -87 },
+ { -86, -85 }, { 22, 25 }, { 23, 24 }, { -84, -83 },
+ { -82, -81 }, { 26, 27 }, { -80, -79 }, { -78, -77 },
+ { 29, 36 }, { 30, 33 }, { 31, 32 }, { -76, -75 },
+ { -74, -73 }, { 34, 35 }, { -72, -55 }, { -54, -53 },
+ { 37, 41 }, { 38, 39 }, { -52, -51 }, { -50, 40 },
+ { -49, -48 }, { 42, 45 }, { 43, 44 }, { -47, -46 },
+ { -45, -44 }, { 46, 47 }, { -43, -42 }, { -41, -40 }
+};
+
+const int8_t f_huffman_env_bal_1_5dB[48][2] = {
+ { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
+ { -62, 5 }, { -61, 6 }, { -67, 7 }, { -68, 8 },
+ { -60, 9 }, { 10, 11 }, { -69, -59 }, { -70, 12 },
+ { -58, 13 }, { 14, 17 }, { -71, 15 }, { -57, 16 },
+ { -56, -73 }, { 18, 32 }, { 19, 25 }, { 20, 22 },
+ { -72, 21 }, { -88, -87 }, { 23, 24 }, { -86, -85 },
+ { -84, -83 }, { 26, 29 }, { 27, 28 }, { -82, -81 },
+ { -80, -79 }, { 30, 31 }, { -78, -77 }, { -76, -75 },
+ { 33, 40 }, { 34, 37 }, { 35, 36 }, { -74, -55 },
+ { -54, -53 }, { 38, 39 }, { -52, -51 }, { -50, -49 },
+ { 41, 44 }, { 42, 43 }, { -48, -47 }, { -46, -45 },
+ { 45, 46 }, { -44, -43 }, { -42, 47 }, { -41, -40 }
+};
+
+const int8_t t_huffman_env_3_0dB[62][2] = {
+ { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
+ { -62, 5 }, { -67, 6 }, { -61, 7 }, { -68, 8 },
+ { -60, 9 }, { 10, 11 }, { -69, -59 }, { 12, 14 },
+ { -70, 13 }, { -71, -58 }, { 15, 18 }, { 16, 17 },
+ { -72, -57 }, { -73, -74 }, { 19, 22 }, { -56, 20 },
+ { -55, 21 }, { -54, -77 }, { 23, 31 }, { 24, 25 },
+ { -75, -76 }, { 26, 27 }, { -78, -53 }, { 28, 29 },
+ { -52, -95 }, { -94, 30 }, { -93, -92 }, { 32, 47 },
+ { 33, 40 }, { 34, 37 }, { 35, 36 }, { -91, -90 },
+ { -89, -88 }, { 38, 39 }, { -87, -86 }, { -85, -84 },
+ { 41, 44 }, { 42, 43 }, { -83, -82 }, { -81, -80 },
+ { 45, 46 }, { -79, -51 }, { -50, -49 }, { 48, 55 },
+ { 49, 52 }, { 50, 51 }, { -48, -47 }, { -46, -45 },
+ { 53, 54 }, { -44, -43 }, { -42, -41 }, { 56, 59 },
+ { 57, 58 }, { -40, -39 }, { -38, -37 }, { 60, 61 },
+ { -36, -35 }, { -34, -33 }
+};
+
+const int8_t f_huffman_env_3_0dB[62][2] = {
+ { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
+ { -62, 5 }, { -67, 6 }, { 7, 8 }, { -61, -68 },
+ { 9, 10 }, { -60, -69 }, { 11, 12 }, { -59, -70 },
+ { 13, 14 }, { -58, -71 }, { 15, 16 }, { -57, -72 },
+ { 17, 19 }, { -56, 18 }, { -55, -73 }, { 20, 24 },
+ { 21, 22 }, { -74, -54 }, { -53, 23 }, { -75, -76 },
+ { 25, 30 }, { 26, 27 }, { -52, -51 }, { 28, 29 },
+ { -77, -79 }, { -50, -49 }, { 31, 39 }, { 32, 35 },
+ { 33, 34 }, { -78, -46 }, { -82, -88 }, { 36, 37 },
+ { -83, -48 }, { -47, 38 }, { -86, -85 }, { 40, 47 },
+ { 41, 44 }, { 42, 43 }, { -80, -44 }, { -43, -42 },
+ { 45, 46 }, { -39, -87 }, { -84, -40 }, { 48, 55 },
+ { 49, 52 }, { 50, 51 }, { -95, -94 }, { -93, -92 },
+ { 53, 54 }, { -91, -90 }, { -89, -81 }, { 56, 59 },
+ { 57, 58 }, { -45, -41 }, { -38, -37 }, { 60, 61 },
+ { -36, -35 }, { -34, -33 }
+};
+
+const int8_t t_huffman_env_bal_3_0dB[24][2] = {
+ { -64, 1 }, { -63, 2 }, { -65, 3 }, { -66, 4 },
+ { -62, 5 }, { -61, 6 }, { -67, 7 }, { -68, 8 },
+ { -60, 9 }, { 10, 16 }, { 11, 13 }, { -69, 12 },
+ { -76, -75 }, { 14, 15 }, { -74, -73 }, { -72, -71 },
+ { 17, 20 }, { 18, 19 }, { -70, -59 }, { -58, -57 },
+ { 21, 22 }, { -56, -55 }, { -54, 23 }, { -53, -52 }
+};
+
+const int8_t f_huffman_env_bal_3_0dB[24][2] = {
+ { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
+ { -62, 5 }, { -61, 6 }, { -67, 7 }, { -68, 8 },
+ { -60, 9 }, { 10, 13 }, { -69, 11 }, { -59, 12 },
+ { -58, -76 }, { 14, 17 }, { 15, 16 }, { -75, -74 },
+ { -73, -72 }, { 18, 21 }, { 19, 20 }, { -71, -70 },
+ { -57, -56 }, { 22, 23 }, { -55, -54 }, { -53, -52 }
+};
+
+
+const int8_t t_huffman_noise_3_0dB[62][2] = {
+ { -64, 1 }, { -63, 2 }, { -65, 3 }, { -66, 4 },
+ { -62, 5 }, { -67, 6 }, { 7, 8 }, { -61, -68 },
+ { 9, 30 }, { 10, 15 }, { -60, 11 }, { -69, 12 },
+ { 13, 14 }, { -59, -53 }, { -95, -94 }, { 16, 23 },
+ { 17, 20 }, { 18, 19 }, { -93, -92 }, { -91, -90 },
+ { 21, 22 }, { -89, -88 }, { -87, -86 }, { 24, 27 },
+ { 25, 26 }, { -85, -84 }, { -83, -82 }, { 28, 29 },
+ { -81, -80 }, { -79, -78 }, { 31, 46 }, { 32, 39 },
+ { 33, 36 }, { 34, 35 }, { -77, -76 }, { -75, -74 },
+ { 37, 38 }, { -73, -72 }, { -71, -70 }, { 40, 43 },
+ { 41, 42 }, { -58, -57 }, { -56, -55 }, { 44, 45 },
+ { -54, -52 }, { -51, -50 }, { 47, 54 }, { 48, 51 },
+ { 49, 50 }, { -49, -48 }, { -47, -46 }, { 52, 53 },
+ { -45, -44 }, { -43, -42 }, { 55, 58 }, { 56, 57 },
+ { -41, -40 }, { -39, -38 }, { 59, 60 }, { -37, -36 },
+ { -35, 61 }, { -34, -33 }
+};
+
+const int8_t t_huffman_noise_bal_3_0dB[24][2] = {
+ { -64, 1 }, { -65, 2 }, { -63, 3 }, { 4, 9 },
+ { -66, 5 }, { -62, 6 }, { 7, 8 }, { -76, -75 },
+ { -74, -73 }, { 10, 17 }, { 11, 14 }, { 12, 13 },
+ { -72, -71 }, { -70, -69 }, { 15, 16 }, { -68, -67 },
+ { -61, -60 }, { 18, 21 }, { 19, 20 }, { -59, -58 },
+ { -57, -56 }, { 22, 23 }, { -55, -54 }, { -53, -52 }
+};
+
+#endif
--- /dev/null
+++ b/libfaad/sbr_huff.h
@@ -1,0 +1,54 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_huff.h,v 1.5 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_HUFF_H__
+#define __SBR_HUFF_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef const int8_t (*sbr_huff_tab)[2];
+
+int16_t sbr_huff_dec(bitfile *ld, sbr_huff_tab t_huff);
+
+const int8_t t_huffman_env_1_5dB[][2];
+const int8_t f_huffman_env_1_5dB[][2];
+const int8_t t_huffman_env_bal_1_5dB[][2];
+const int8_t f_huffman_env_bal_1_5dB[][2];
+const int8_t t_huffman_env_3_0dB[][2];
+const int8_t f_huffman_env_3_0dB[][2];
+const int8_t t_huffman_env_bal_3_0dB[][2];
+const int8_t f_huffman_env_bal_3_0dB[][2];
+const int8_t t_huffman_noise_3_0dB[][2];
+const int8_t t_huffman_noise_bal_3_0dB[][2];
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
--- /dev/null
+++ b/libfaad/sbr_noise.h
@@ -1,0 +1,560 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_noise.h,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_NOISE_H__
+#define __SBR_NOISE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _MSC_VER
+#pragma warning(disable:4305)
+#pragma warning(disable:4244)
+#endif
+
+
+/* Table 1.A.13 Noise table V */
+complex_t V[] = {
+ { COEF_CONST(-0.99948155879974), COEF_CONST(-0.59483414888382) },
+ { COEF_CONST(0.97113454341888), COEF_CONST(-0.67528516054153) },
+ { COEF_CONST(0.14130051434040), COEF_CONST(-0.95090985298157) },
+ { COEF_CONST(-0.47005495429039), COEF_CONST(-0.37340548634529) },
+ { COEF_CONST(0.80705064535141), COEF_CONST(0.29653668403625) },
+ { COEF_CONST(-0.38981479406357), COEF_CONST(0.89572608470917) },
+ { COEF_CONST(-0.01053049881011), COEF_CONST(-0.66959059238434) },
+ { COEF_CONST(-0.91266369819641), COEF_CONST(-0.11522938311100) },
+ { COEF_CONST(0.54840421676636), COEF_CONST(0.75221365690231) },
+ { COEF_CONST(0.40009254217148), COEF_CONST(-0.98929399251938) },
+ { COEF_CONST(-0.99867975711823), COEF_CONST(-0.88147068023682) },
+ { COEF_CONST(-0.95531076192856), COEF_CONST(0.90908759832382) },
+ { COEF_CONST(-0.45725932717323), COEF_CONST(-0.56716322898865) },
+ { COEF_CONST(-0.72929674386978), COEF_CONST(-0.98008275032043) },
+ { COEF_CONST(0.75622802972794), COEF_CONST(0.20950329303741) },
+ { COEF_CONST(0.07069442421198), COEF_CONST(-0.78247898817062) },
+ { COEF_CONST(0.74496251344681), COEF_CONST(-0.91169005632401) },
+ { COEF_CONST(-0.96440184116364), COEF_CONST(-0.94739919900894) },
+ { COEF_CONST(0.30424630641937), COEF_CONST(-0.49438267946243) },
+ { COEF_CONST(0.66565030813217), COEF_CONST(0.64652937650681) },
+ { COEF_CONST(0.91697007417679), COEF_CONST(0.17514097690582) },
+ { COEF_CONST(-0.70774918794632), COEF_CONST(0.52548652887344) },
+ { COEF_CONST(-0.70051413774490), COEF_CONST(-0.45340028405190) },
+ { COEF_CONST(-0.99496513605118), COEF_CONST(-0.90071910619736) },
+ { COEF_CONST(0.98164492845535), COEF_CONST(-0.77463155984879) },
+ { COEF_CONST(-0.54671579599380), COEF_CONST(-0.02570928446949) },
+ { COEF_CONST(-0.01689629070461), COEF_CONST(0.00287506449968) },
+ { COEF_CONST(-0.86110347509384), COEF_CONST(0.42548584938049) },
+ { COEF_CONST(-0.98892980813980), COEF_CONST(-0.87881129980087) },
+ { COEF_CONST(0.51756626367569), COEF_CONST(0.66926783323288) },
+ { COEF_CONST(-0.99635028839111), COEF_CONST(-0.58107727766037) },
+ { COEF_CONST(-0.99969369173050), COEF_CONST(0.98369991779327) },
+ { COEF_CONST(0.55266261100769), COEF_CONST(0.59449058771133) },
+ { COEF_CONST(0.34581178426743), COEF_CONST(0.94879418611526) },
+ { COEF_CONST(0.62664210796356), COEF_CONST(-0.74402970075607) },
+ { COEF_CONST(-0.77149701118469), COEF_CONST(-0.33883658051491) },
+ { COEF_CONST(-0.91592246294022), COEF_CONST(0.03687901422381) },
+ { COEF_CONST(-0.76285493373871), COEF_CONST(-0.91371870040894) },
+ { COEF_CONST(0.79788339138031), COEF_CONST(-0.93180972337723) },
+ { COEF_CONST(0.54473078250885), COEF_CONST(-0.11919206380844) },
+ { COEF_CONST(-0.85639280080795), COEF_CONST(0.42429855465889) },
+ { COEF_CONST(-0.92882400751114), COEF_CONST(0.27871808409691) },
+ { COEF_CONST(-0.11708371341228), COEF_CONST(-0.99800843000412) },
+ { COEF_CONST(0.21356749534607), COEF_CONST(-0.90716296434402) },
+ { COEF_CONST(-0.76191693544388), COEF_CONST(0.99768120050430) },
+ { COEF_CONST(0.98111045360565), COEF_CONST(-0.95854461193085) },
+ { COEF_CONST(-0.85913270711899), COEF_CONST(0.95766568183899) },
+ { COEF_CONST(-0.93307244777679), COEF_CONST(0.49431759119034) },
+ { COEF_CONST(0.30485755205154), COEF_CONST(-0.70540034770966) },
+ { COEF_CONST(0.85289651155472), COEF_CONST(0.46766132116318) },
+ { COEF_CONST(0.91328084468842), COEF_CONST(-0.99839597940445) },
+ { COEF_CONST(-0.05890199914575), COEF_CONST(0.70741826295853) },
+ { COEF_CONST(0.28398686647415), COEF_CONST(0.34633556008339) },
+ { COEF_CONST(0.95258164405823), COEF_CONST(-0.54893416166306) },
+ { COEF_CONST(-0.78566324710846), COEF_CONST(-0.75568538904190) },
+ { COEF_CONST(-0.95789498090744), COEF_CONST(-0.20423194766045) },
+ { COEF_CONST(0.82411158084869), COEF_CONST(0.96654617786407) },
+ { COEF_CONST(-0.65185445547104), COEF_CONST(-0.88734990358353) },
+ { COEF_CONST(-0.93643605709076), COEF_CONST(0.99870789051056) },
+ { COEF_CONST(0.91427159309387), COEF_CONST(-0.98290503025055) },
+ { COEF_CONST(-0.70395684242249), COEF_CONST(0.58796799182892) },
+ { COEF_CONST(0.00563771976158), COEF_CONST(0.61768198013306) },
+ { COEF_CONST(0.89065051078796), COEF_CONST(0.52783352136612) },
+ { COEF_CONST(-0.68683707714081), COEF_CONST(0.80806946754456) },
+ { COEF_CONST(0.72165340185165), COEF_CONST(-0.69259858131409) },
+ { COEF_CONST(-0.62928247451782), COEF_CONST(0.13627037405968) },
+ { COEF_CONST(0.29938435554504), COEF_CONST(-0.46051329374313) },
+ { COEF_CONST(-0.91781955957413), COEF_CONST(-0.74012714624405) },
+ { COEF_CONST(0.99298715591431), COEF_CONST(0.40816611051559) },
+ { COEF_CONST(0.82368296384811), COEF_CONST(-0.74036049842834) },
+ { COEF_CONST(-0.98512834310532), COEF_CONST(-0.99972331523895) },
+ { COEF_CONST(-0.95915371179581), COEF_CONST(-0.99237799644470) },
+ { COEF_CONST(-0.21411126852036), COEF_CONST(-0.93424820899963) },
+ { COEF_CONST(-0.68821477890015), COEF_CONST(-0.26892307400703) },
+ { COEF_CONST(0.91851997375488), COEF_CONST(0.09358228743076) },
+ { COEF_CONST(-0.96062767505646), COEF_CONST(0.36099094152451) },
+ { COEF_CONST(0.51646184921265), COEF_CONST(-0.71373331546783) },
+ { COEF_CONST(0.61130720376968), COEF_CONST(0.46950140595436) },
+ { COEF_CONST(0.47336128354073), COEF_CONST(-0.27333179116249) },
+ { COEF_CONST(0.90998309850693), COEF_CONST(0.96715664863586) },
+ { COEF_CONST(0.44844800233841), COEF_CONST(0.99211573600769) },
+ { COEF_CONST(0.66614890098572), COEF_CONST(0.96590173244476) },
+ { COEF_CONST(0.74922239780426), COEF_CONST(-0.89879858493805) },
+ { COEF_CONST(-0.99571585655212), COEF_CONST(0.52785521745682) },
+ { COEF_CONST(0.97401082515717), COEF_CONST(-0.16855870187283) },
+ { COEF_CONST(0.72683745622635), COEF_CONST(-0.48060774803162) },
+ { COEF_CONST(0.95432192087173), COEF_CONST(0.68849605321884) },
+ { COEF_CONST(-0.72962206602097), COEF_CONST(-0.76608443260193) },
+ { COEF_CONST(-0.85359477996826), COEF_CONST(0.88738125562668) },
+ { COEF_CONST(-0.81412428617477), COEF_CONST(-0.97480767965317) },
+ { COEF_CONST(-0.87930774688721), COEF_CONST(0.74748307466507) },
+ { COEF_CONST(-0.71573328971863), COEF_CONST(-0.98570609092712) },
+ { COEF_CONST(0.83524298667908), COEF_CONST(0.83702534437180) },
+ { COEF_CONST(-0.48086065053940), COEF_CONST(-0.98848503828049) },
+ { COEF_CONST(0.97139126062393), COEF_CONST(0.80093622207642) },
+ { COEF_CONST(0.51992827653885), COEF_CONST(0.80247628688812) },
+ { COEF_CONST(-0.00848591234535), COEF_CONST(-0.76670128107071) },
+ { COEF_CONST(-0.70294374227524), COEF_CONST(0.55359911918640) },
+ { COEF_CONST(-0.95894426107407), COEF_CONST(-0.43265503644943) },
+ { COEF_CONST(0.97079253196716), COEF_CONST(0.09325857460499) },
+ { COEF_CONST(-0.92404294013977), COEF_CONST(0.85507702827454) },
+ { COEF_CONST(-0.69506472349167), COEF_CONST(0.98633414506912) },
+ { COEF_CONST(0.26559203863144), COEF_CONST(0.73314309120178) },
+ { COEF_CONST(0.28038442134857), COEF_CONST(0.14537914097309) },
+ { COEF_CONST(-0.74138122797012), COEF_CONST(0.99310338497162) },
+ { COEF_CONST(-0.01752796024084), COEF_CONST(-0.82616633176804) },
+ { COEF_CONST(-0.55126774311066), COEF_CONST(-0.98898541927338) },
+ { COEF_CONST(0.97960901260376), COEF_CONST(-0.94021445512772) },
+ { COEF_CONST(-0.99196308851242), COEF_CONST(0.67019015550613) },
+ { COEF_CONST(-0.67684930562973), COEF_CONST(0.12631492316723) },
+ { COEF_CONST(0.09140039235353), COEF_CONST(-0.20537731051445) },
+ { COEF_CONST(-0.71658962965012), COEF_CONST(-0.97788202762604) },
+ { COEF_CONST(0.81014639139175), COEF_CONST(0.53722649812698) },
+ { COEF_CONST(0.40616992115974), COEF_CONST(-0.26469007134438) },
+ { COEF_CONST(-0.67680186033249), COEF_CONST(0.94502049684525) },
+ { COEF_CONST(0.86849772930145), COEF_CONST(-0.18333598971367) },
+ { COEF_CONST(-0.99500381946564), COEF_CONST(-0.02634122036397) },
+ { COEF_CONST(0.84329187870026), COEF_CONST(0.10406957566738) },
+ { COEF_CONST(-0.09215968847275), COEF_CONST(0.69540011882782) },
+ { COEF_CONST(0.99956172704697), COEF_CONST(-0.12358541786671) },
+ { COEF_CONST(-0.79732781648636), COEF_CONST(-0.91582524776459) },
+ { COEF_CONST(0.96349972486496), COEF_CONST(0.96640455722809) },
+ { COEF_CONST(-0.79942780733109), COEF_CONST(0.64323902130127) },
+ { COEF_CONST(-0.11566039919853), COEF_CONST(0.28587844967842) },
+ { COEF_CONST(-0.39922955632210), COEF_CONST(0.94129604101181) },
+ { COEF_CONST(0.99089199304581), COEF_CONST(-0.92062628269196) },
+ { COEF_CONST(0.28631284832954), COEF_CONST(-0.91035044193268) },
+ { COEF_CONST(-0.83302724361420), COEF_CONST(-0.67330408096313) },
+ { COEF_CONST(0.95404446125031), COEF_CONST(0.49162766337395) },
+ { COEF_CONST(-0.06449863314629), COEF_CONST(0.03250560909510) },
+ { COEF_CONST(-0.99575054645538), COEF_CONST(0.42389783263206) },
+ { COEF_CONST(-0.65501141548157), COEF_CONST(0.82546114921570) },
+ { COEF_CONST(-0.81254440546036), COEF_CONST(-0.51627236604691) },
+ { COEF_CONST(-0.99646371603012), COEF_CONST(0.84490531682968) },
+ { COEF_CONST(0.00287840608507), COEF_CONST(0.64768260717392) },
+ { COEF_CONST(0.70176988840103), COEF_CONST(-0.20453028380871) },
+ { COEF_CONST(0.96361881494522), COEF_CONST(0.40706968307495) },
+ { COEF_CONST(-0.68883758783340), COEF_CONST(0.91338956356049) },
+ { COEF_CONST(-0.34875586628914), COEF_CONST(0.71472293138504) },
+ { COEF_CONST(0.91980081796646), COEF_CONST(0.66507452726364) },
+ { COEF_CONST(-0.99009048938751), COEF_CONST(0.85868018865585) },
+ { COEF_CONST(0.68865793943405), COEF_CONST(0.55660319328308) },
+ { COEF_CONST(-0.99484401941299), COEF_CONST(-0.20052559673786) },
+ { COEF_CONST(0.94214510917664), COEF_CONST(-0.99696427583694) },
+ { COEF_CONST(-0.67414629459381), COEF_CONST(0.49548220634460) },
+ { COEF_CONST(-0.47339352965355), COEF_CONST(-0.85904330015182) },
+ { COEF_CONST(0.14323651790619), COEF_CONST(-0.94145596027374) },
+ { COEF_CONST(-0.29268294572830), COEF_CONST(0.05759225040674) },
+ { COEF_CONST(0.43793860077858), COEF_CONST(-0.78904968500137) },
+ { COEF_CONST(-0.36345127224922), COEF_CONST(0.64874434471130) },
+ { COEF_CONST(-0.08750604838133), COEF_CONST(0.97686946392059) },
+ { COEF_CONST(-0.96495270729065), COEF_CONST(-0.53960305452347) },
+ { COEF_CONST(0.55526942014694), COEF_CONST(0.78891521692276) },
+ { COEF_CONST(0.73538213968277), COEF_CONST(0.96452075242996) },
+ { COEF_CONST(-0.30889773368835), COEF_CONST(-0.80664390325546) },
+ { COEF_CONST(0.03574995696545), COEF_CONST(-0.97325617074966) },
+ { COEF_CONST(0.98720687627792), COEF_CONST(0.48409134149551) },
+ { COEF_CONST(-0.81689298152924), COEF_CONST(-0.90827703475952) },
+ { COEF_CONST(0.67866861820221), COEF_CONST(0.81284505128860) },
+ { COEF_CONST(-0.15808570384979), COEF_CONST(0.85279554128647) },
+ { COEF_CONST(0.80723392963409), COEF_CONST(-0.24717418849468) },
+ { COEF_CONST(0.47788757085800), COEF_CONST(-0.46333149075508) },
+ { COEF_CONST(0.96367555856705), COEF_CONST(0.38486748933792) },
+ { COEF_CONST(-0.99143874645233), COEF_CONST(-0.24945276975632) },
+ { COEF_CONST(0.83081877231598), COEF_CONST(-0.94780850410461) },
+ { COEF_CONST(-0.58753192424774), COEF_CONST(0.01290772389621) },
+ { COEF_CONST(0.95538109540939), COEF_CONST(-0.85557049512863) },
+ { COEF_CONST(-0.96490919589996), COEF_CONST(-0.64020973443985) },
+ { COEF_CONST(-0.97327101230621), COEF_CONST(0.12378127872944) },
+ { COEF_CONST(0.91400367021561), COEF_CONST(0.57972472906113) },
+ { COEF_CONST(-0.99925839900970), COEF_CONST(0.71084845066071) },
+ { COEF_CONST(-0.86875903606415), COEF_CONST(-0.20291699469090) },
+ { COEF_CONST(-0.26240035891533), COEF_CONST(-0.68264555931091) },
+ { COEF_CONST(-0.24664412438869), COEF_CONST(-0.87642270326614) },
+ { COEF_CONST(0.02416275814176), COEF_CONST(0.27192914485931) },
+ { COEF_CONST(0.82068622112274), COEF_CONST(-0.85087788105011) },
+ { COEF_CONST(0.88547372817993), COEF_CONST(-0.89636802673340) },
+ { COEF_CONST(-0.18173077702522), COEF_CONST(-0.26152145862579) },
+ { COEF_CONST(0.09355476498604), COEF_CONST(0.54845124483109) },
+ { COEF_CONST(-0.54668414592743), COEF_CONST(0.95980775356293) },
+ { COEF_CONST(0.37050989270210), COEF_CONST(-0.59910142421722) },
+ { COEF_CONST(-0.70373594760895), COEF_CONST(0.91227668523788) },
+ { COEF_CONST(-0.34600785374641), COEF_CONST(-0.99441426992416) },
+ { COEF_CONST(-0.68774479627609), COEF_CONST(-0.30238837003708) },
+ { COEF_CONST(-0.26843291521072), COEF_CONST(0.83115667104721) },
+ { COEF_CONST(0.49072334170341), COEF_CONST(-0.45359709858894) },
+ { COEF_CONST(0.38975992798805), COEF_CONST(0.95515358448029) },
+ { COEF_CONST(-0.97757124900818), COEF_CONST(0.05305894464254) },
+ { COEF_CONST(-0.17325553297997), COEF_CONST(-0.92770671844482) },
+ { COEF_CONST(0.99948036670685), COEF_CONST(0.58285546302795) },
+ { COEF_CONST(-0.64946246147156), COEF_CONST(0.68645507097244) },
+ { COEF_CONST(-0.12016920745373), COEF_CONST(-0.57147324085236) },
+ { COEF_CONST(-0.58947455883026), COEF_CONST(-0.34847131371498) },
+ { COEF_CONST(-0.41815140843391), COEF_CONST(0.16276422142982) },
+ { COEF_CONST(0.99885648488998), COEF_CONST(0.11136095225811) },
+ { COEF_CONST(-0.56649613380432), COEF_CONST(-0.90494865179062) },
+ { COEF_CONST(0.94138020277023), COEF_CONST(0.35281917452812) },
+ { COEF_CONST(-0.75725078582764), COEF_CONST(0.53650552034378) },
+ { COEF_CONST(0.20541973412037), COEF_CONST(-0.94435143470764) },
+ { COEF_CONST(0.99980372190475), COEF_CONST(0.79835915565491) },
+ { COEF_CONST(0.29078277945518), COEF_CONST(0.35393777489662) },
+ { COEF_CONST(-0.62858772277832), COEF_CONST(0.38765692710876) },
+ { COEF_CONST(0.43440905213356), COEF_CONST(-0.98546332120895) },
+ { COEF_CONST(-0.98298585414886), COEF_CONST(0.21021524071693) },
+ { COEF_CONST(0.19513028860092), COEF_CONST(-0.94239830970764) },
+ { COEF_CONST(-0.95476663112640), COEF_CONST(0.98364555835724) },
+ { COEF_CONST(0.93379634618759), COEF_CONST(-0.70881992578506) },
+ { COEF_CONST(-0.85235410928726), COEF_CONST(-0.08342348039150) },
+ { COEF_CONST(-0.86425095796585), COEF_CONST(-0.45795026421547) },
+ { COEF_CONST(0.38879778981209), COEF_CONST(0.97274428606033) },
+ { COEF_CONST(0.92045122385025), COEF_CONST(-0.62433654069901) },
+ { COEF_CONST(0.89162534475327), COEF_CONST(0.54950958490372) },
+ { COEF_CONST(-0.36834338307381), COEF_CONST(0.96458297967911) },
+ { COEF_CONST(0.93891763687134), COEF_CONST(-0.89968353509903) },
+ { COEF_CONST(0.99267655611038), COEF_CONST(-0.03757034242153) },
+ { COEF_CONST(-0.94063472747803), COEF_CONST(0.41332337260246) },
+ { COEF_CONST(0.99740225076675), COEF_CONST(-0.16830494999886) },
+ { COEF_CONST(-0.35899412631989), COEF_CONST(-0.46633225679398) },
+ { COEF_CONST(0.05237237364054), COEF_CONST(-0.25640362501144) },
+ { COEF_CONST(0.36703583598137), COEF_CONST(-0.38653266429901) },
+ { COEF_CONST(0.91653180122375), COEF_CONST(-0.30587628483772) },
+ { COEF_CONST(0.69000804424286), COEF_CONST(0.90952169895172) },
+ { COEF_CONST(-0.38658750057220), COEF_CONST(0.99501574039459) },
+ { COEF_CONST(-0.29250815510750), COEF_CONST(0.37444993853569) },
+ { COEF_CONST(-0.60182201862335), COEF_CONST(0.86779648065567) },
+ { COEF_CONST(-0.97418588399887), COEF_CONST(0.96468526124954) },
+ { COEF_CONST(0.88461571931839), COEF_CONST(0.57508403062820) },
+ { COEF_CONST(0.05198933184147), COEF_CONST(0.21269661188126) },
+ { COEF_CONST(-0.53499621152878), COEF_CONST(0.97241556644440) },
+ { COEF_CONST(-0.49429559707642), COEF_CONST(0.98183864355087) },
+ { COEF_CONST(-0.98935145139694), COEF_CONST(-0.40249159932137) },
+ { COEF_CONST(-0.98081380128860), COEF_CONST(-0.72856897115707) },
+ { COEF_CONST(-0.27338150143623), COEF_CONST(0.99950921535492) },
+ { COEF_CONST(0.06310802698135), COEF_CONST(-0.54539585113525) },
+ { COEF_CONST(-0.20461677014828), COEF_CONST(-0.14209978282452) },
+ { COEF_CONST(0.66223841905594), COEF_CONST(0.72528582811356) },
+ { COEF_CONST(-0.84764343500137), COEF_CONST(0.02372316829860) },
+ { COEF_CONST(-0.89039862155914), COEF_CONST(0.88866579532623) },
+ { COEF_CONST(0.95903307199478), COEF_CONST(0.76744925975800) },
+ { COEF_CONST(0.73504126071930), COEF_CONST(-0.03747203201056) },
+ { COEF_CONST(-0.31744435429573), COEF_CONST(-0.36834111809731) },
+ { COEF_CONST(-0.34110826253891), COEF_CONST(0.40211221575737) },
+ { COEF_CONST(0.47803884744644), COEF_CONST(-0.39423218369484) },
+ { COEF_CONST(0.98299193382263), COEF_CONST(0.01989791356027) },
+ { COEF_CONST(-0.30963072180748), COEF_CONST(-0.18076720833778) },
+ { COEF_CONST(0.99992591142654), COEF_CONST(-0.26281872391701) },
+ { COEF_CONST(-0.93149733543396), COEF_CONST(-0.98313164710999) },
+ { COEF_CONST(0.99923473596573), COEF_CONST(-0.80142992734909) },
+ { COEF_CONST(-0.26024168729782), COEF_CONST(-0.75999760627747) },
+ { COEF_CONST(-0.35712513327599), COEF_CONST(0.19298963248730) },
+ { COEF_CONST(-0.99899083375931), COEF_CONST(0.74645155668259) },
+ { COEF_CONST(0.86557173728943), COEF_CONST(0.55593866109848) },
+ { COEF_CONST(0.33408042788506), COEF_CONST(0.86185956001282) },
+ { COEF_CONST(0.99010735750198), COEF_CONST(0.04602397605777) },
+ { COEF_CONST(-0.66694271564484), COEF_CONST(-0.91643613576889) },
+ { COEF_CONST(0.64016789197922), COEF_CONST(0.15649530291557) },
+ { COEF_CONST(0.99570536613464), COEF_CONST(0.45844584703445) },
+ { COEF_CONST(-0.63431465625763), COEF_CONST(0.21079117059708) },
+ { COEF_CONST(-0.07706847041845), COEF_CONST(-0.89581435918808) },
+ { COEF_CONST(0.98590087890625), COEF_CONST(0.88241720199585) },
+ { COEF_CONST(0.80099332332611), COEF_CONST(-0.36851897835732) },
+ { COEF_CONST(0.78368133306503), COEF_CONST(0.45506998896599) },
+ { COEF_CONST(0.08707806468010), COEF_CONST(0.80938994884491) },
+ { COEF_CONST(-0.86811882257462), COEF_CONST(0.39347308874130) },
+ { COEF_CONST(-0.39466530084610), COEF_CONST(-0.66809433698654) },
+ { COEF_CONST(0.97875326871872), COEF_CONST(-0.72467839717865) },
+ { COEF_CONST(-0.95038563013077), COEF_CONST(0.89563220739365) },
+ { COEF_CONST(0.17005239427090), COEF_CONST(0.54683053493500) },
+ { COEF_CONST(-0.76910793781281), COEF_CONST(-0.96226614713669) },
+ { COEF_CONST(0.99743282794952), COEF_CONST(0.42697158455849) },
+ { COEF_CONST(0.95437383651733), COEF_CONST(0.97002321481705) },
+ { COEF_CONST(0.99578905105591), COEF_CONST(-0.54106825590134) },
+ { COEF_CONST(0.28058260679245), COEF_CONST(-0.85361421108246) },
+ { COEF_CONST(0.85256522893906), COEF_CONST(-0.64567607641220) },
+ { COEF_CONST(-0.50608539581299), COEF_CONST(-0.65846014022827) },
+ { COEF_CONST(-0.97210735082626), COEF_CONST(-0.23095212876797) },
+ { COEF_CONST(0.95424050092697), COEF_CONST(-0.99240148067474) },
+ { COEF_CONST(-0.96926569938660), COEF_CONST(0.73775655031204) },
+ { COEF_CONST(0.30872163176537), COEF_CONST(0.41514959931374) },
+ { COEF_CONST(-0.24523839354515), COEF_CONST(0.63206630945206) },
+ { COEF_CONST(-0.33813264966011), COEF_CONST(-0.38661777973175) },
+ { COEF_CONST(-0.05826828256249), COEF_CONST(-0.06940773874521) },
+ { COEF_CONST(-0.22898460924625), COEF_CONST(0.97054851055145) },
+ { COEF_CONST(-0.18509915471077), COEF_CONST(0.47565764188766) },
+ { COEF_CONST(-0.10488238185644), COEF_CONST(-0.87769949436188) },
+ { COEF_CONST(-0.71886587142944), COEF_CONST(0.78030979633331) },
+ { COEF_CONST(0.99793875217438), COEF_CONST(0.90041309595108) },
+ { COEF_CONST(0.57563304901123), COEF_CONST(-0.91034334897995) },
+ { COEF_CONST(0.28909647464752), COEF_CONST(0.96307784318924) },
+ { COEF_CONST(0.42188999056816), COEF_CONST(0.48148649930954) },
+ { COEF_CONST(0.93335050344467), COEF_CONST(-0.43537023663521) },
+ { COEF_CONST(-0.97087377309799), COEF_CONST(0.86636447906494) },
+ { COEF_CONST(0.36722871661186), COEF_CONST(0.65291655063629) },
+ { COEF_CONST(-0.81093025207520), COEF_CONST(0.08778370171785) },
+ { COEF_CONST(-0.26240602135658), COEF_CONST(-0.92774093151093) },
+ { COEF_CONST(0.83996498584747), COEF_CONST(0.55839848518372) },
+ { COEF_CONST(-0.99909615516663), COEF_CONST(-0.96024608612061) },
+ { COEF_CONST(0.74649465084076), COEF_CONST(0.12144893407822) },
+ { COEF_CONST(-0.74774593114853), COEF_CONST(-0.26898062229156) },
+ { COEF_CONST(0.95781666040421), COEF_CONST(-0.79047924280167) },
+ { COEF_CONST(0.95472306013107), COEF_CONST(-0.08588775992393) },
+ { COEF_CONST(0.48708331584930), COEF_CONST(0.99999040365219) },
+ { COEF_CONST(0.46332037448883), COEF_CONST(0.10964126139879) },
+ { COEF_CONST(-0.76497006416321), COEF_CONST(0.89210927486420) },
+ { COEF_CONST(0.57397389411926), COEF_CONST(0.35289704799652) },
+ { COEF_CONST(0.75374317169189), COEF_CONST(0.96705216169357) },
+ { COEF_CONST(-0.59174400568008), COEF_CONST(-0.89405369758606) },
+ { COEF_CONST(0.75087904930115), COEF_CONST(-0.29612672328949) },
+ { COEF_CONST(-0.98607856035233), COEF_CONST(0.25034910440445) },
+ { COEF_CONST(-0.40761056542397), COEF_CONST(-0.90045571327209) },
+ { COEF_CONST(0.66929268836975), COEF_CONST(0.98629492521286) },
+ { COEF_CONST(-0.97463697195053), COEF_CONST(-0.00190223299433) },
+ { COEF_CONST(0.90145510435104), COEF_CONST(0.99781388044357) },
+ { COEF_CONST(-0.87259286642075), COEF_CONST(0.99233585596085) },
+ { COEF_CONST(-0.91529458761215), COEF_CONST(-0.15698707103729) },
+ { COEF_CONST(-0.03305738791823), COEF_CONST(-0.37205263972282) },
+ { COEF_CONST(0.07223051041365), COEF_CONST(-0.88805001974106) },
+ { COEF_CONST(0.99498009681702), COEF_CONST(0.97094357013702) },
+ { COEF_CONST(-0.74904936552048), COEF_CONST(0.99985486268997) },
+ { COEF_CONST(0.04585228487849), COEF_CONST(0.99812334775925) },
+ { COEF_CONST(-0.89054954051971), COEF_CONST(-0.31791913509369) },
+ { COEF_CONST(-0.83782142400742), COEF_CONST(0.97637635469437) },
+ { COEF_CONST(0.33454805612564), COEF_CONST(-0.86231517791748) },
+ { COEF_CONST(-0.99707579612732), COEF_CONST(0.93237990140915) },
+ { COEF_CONST(-0.22827528417110), COEF_CONST(0.18874759972095) },
+ { COEF_CONST(0.67248046398163), COEF_CONST(-0.03646211326122) },
+ { COEF_CONST(-0.05146538093686), COEF_CONST(-0.92599701881409) },
+ { COEF_CONST(0.99947297573090), COEF_CONST(0.93625229597092) },
+ { COEF_CONST(0.66951125860214), COEF_CONST(0.98905825614929) },
+ { COEF_CONST(-0.99602955579758), COEF_CONST(-0.44654715061188) },
+ { COEF_CONST(0.82104903459549), COEF_CONST(0.99540740251541) },
+ { COEF_CONST(0.99186509847641), COEF_CONST(0.72022998332977) },
+ { COEF_CONST(-0.65284591913223), COEF_CONST(0.52186721563339) },
+ { COEF_CONST(0.93885445594788), COEF_CONST(-0.74895310401917) },
+ { COEF_CONST(0.96735250949860), COEF_CONST(0.90891814231873) },
+ { COEF_CONST(-0.22225968539715), COEF_CONST(0.57124030590057) },
+ { COEF_CONST(-0.44132784008980), COEF_CONST(-0.92688840627670) },
+ { COEF_CONST(-0.85694974660873), COEF_CONST(0.88844531774521) },
+ { COEF_CONST(0.91783040761948), COEF_CONST(-0.46356892585754) },
+ { COEF_CONST(0.72556972503662), COEF_CONST(-0.99899554252625) },
+ { COEF_CONST(-0.99711579084396), COEF_CONST(0.58211559057236) },
+ { COEF_CONST(0.77638977766037), COEF_CONST(0.94321835041046) },
+ { COEF_CONST(0.07717324048281), COEF_CONST(0.58638399839401) },
+ { COEF_CONST(-0.56049829721451), COEF_CONST(0.82522302865982) },
+ { COEF_CONST(0.98398894071579), COEF_CONST(0.39467439055443) },
+ { COEF_CONST(0.47546947002411), COEF_CONST(0.68613046407700) },
+ { COEF_CONST(0.65675091743469), COEF_CONST(0.18331636488438) },
+ { COEF_CONST(0.03273375332355), COEF_CONST(-0.74933111667633) },
+ { COEF_CONST(-0.38684144616127), COEF_CONST(0.51337349414825) },
+ { COEF_CONST(-0.97346270084381), COEF_CONST(-0.96549361944199) },
+ { COEF_CONST(-0.53282153606415), COEF_CONST(-0.91423267126083) },
+ { COEF_CONST(0.99817311763763), COEF_CONST(0.61133575439453) },
+ { COEF_CONST(-0.50254499912262), COEF_CONST(-0.88829338550568) },
+ { COEF_CONST(0.01995873264968), COEF_CONST(0.85223513841629) },
+ { COEF_CONST(0.99930381774902), COEF_CONST(0.94578897953033) },
+ { COEF_CONST(0.82907766103745), COEF_CONST(-0.06323442608118) },
+ { COEF_CONST(-0.58660709857941), COEF_CONST(0.96840775012970) },
+ { COEF_CONST(-0.17573736608028), COEF_CONST(-0.48166921734810) },
+ { COEF_CONST(0.83434289693832), COEF_CONST(-0.13023450970650) },
+ { COEF_CONST(0.05946491286159), COEF_CONST(0.20511047542095) },
+ { COEF_CONST(0.81505483388901), COEF_CONST(-0.94685947895050) },
+ { COEF_CONST(-0.44976380467415), COEF_CONST(0.40894573926926) },
+ { COEF_CONST(-0.89746475219727), COEF_CONST(0.99846577644348) },
+ { COEF_CONST(0.39677256345749), COEF_CONST(-0.74854665994644) },
+ { COEF_CONST(-0.07588948309422), COEF_CONST(0.74096214771271) },
+ { COEF_CONST(0.76343196630478), COEF_CONST(0.41746628284454) },
+ { COEF_CONST(-0.74490106105804), COEF_CONST(0.94725912809372) },
+ { COEF_CONST(0.64880120754242), COEF_CONST(0.41336661577225) },
+ { COEF_CONST(0.62319535017014), COEF_CONST(-0.93098312616348) },
+ { COEF_CONST(0.42215818166733), COEF_CONST(-0.07712787389755) },
+ { COEF_CONST(0.02704554051161), COEF_CONST(-0.05417517945170) },
+ { COEF_CONST(0.80001771450043), COEF_CONST(0.91542196273804) },
+ { COEF_CONST(-0.79351830482483), COEF_CONST(-0.36208897829056) },
+ { COEF_CONST(0.63872361183167), COEF_CONST(0.08128252625465) },
+ { COEF_CONST(0.52890521287918), COEF_CONST(0.60048872232437) },
+ { COEF_CONST(0.74238550662994), COEF_CONST(0.04491915181279) },
+ { COEF_CONST(0.99096131324768), COEF_CONST(-0.19451183080673) },
+ { COEF_CONST(-0.80412328243256), COEF_CONST(-0.88513815402985) },
+ { COEF_CONST(-0.64612615108490), COEF_CONST(0.72198677062988) },
+ { COEF_CONST(0.11657770723104), COEF_CONST(-0.83662831783295) },
+ { COEF_CONST(-0.95053184032440), COEF_CONST(-0.96939903497696) },
+ { COEF_CONST(-0.62228870391846), COEF_CONST(0.82767260074615) },
+ { COEF_CONST(0.03004475869238), COEF_CONST(-0.99738895893097) },
+ { COEF_CONST(-0.97987216711044), COEF_CONST(0.36526128649712) },
+ { COEF_CONST(-0.99986982345581), COEF_CONST(-0.36021611094475) },
+ { COEF_CONST(0.89110648632050), COEF_CONST(-0.97894251346588) },
+ { COEF_CONST(0.10407960414886), COEF_CONST(0.77357792854309) },
+ { COEF_CONST(0.95964735746384), COEF_CONST(-0.35435819625854) },
+ { COEF_CONST(0.50843232870102), COEF_CONST(0.96107691526413) },
+ { COEF_CONST(0.17006334662437), COEF_CONST(-0.76854026317596) },
+ { COEF_CONST(0.25872674584389), COEF_CONST(0.99893301725388) },
+ { COEF_CONST(-0.01115998718888), COEF_CONST(0.98496019840240) },
+ { COEF_CONST(-0.79598701000214), COEF_CONST(0.97138410806656) },
+ { COEF_CONST(-0.99264711141586), COEF_CONST(-0.99542820453644) },
+ { COEF_CONST(-0.99829661846161), COEF_CONST(0.01877138763666) },
+ { COEF_CONST(-0.70801013708115), COEF_CONST(0.33680686354637) },
+ { COEF_CONST(-0.70467054843903), COEF_CONST(0.93272775411606) },
+ { COEF_CONST(0.99846023321152), COEF_CONST(-0.98725748062134) },
+ { COEF_CONST(-0.63364970684052), COEF_CONST(-0.16473594307899) },
+ { COEF_CONST(-0.16258217394352), COEF_CONST(-0.95939123630524) },
+ { COEF_CONST(-0.43645593523979), COEF_CONST(-0.94805032014847) },
+ { COEF_CONST(-0.99848473072052), COEF_CONST(0.96245169639587) },
+ { COEF_CONST(-0.16796459257603), COEF_CONST(-0.98987513780594) },
+ { COEF_CONST(-0.87979227304459), COEF_CONST(-0.71725726127625) },
+ { COEF_CONST(0.44183099269867), COEF_CONST(-0.93568974733353) },
+ { COEF_CONST(0.93310177326202), COEF_CONST(-0.99913311004639) },
+ { COEF_CONST(-0.93941932916641), COEF_CONST(-0.56409376859665) },
+ { COEF_CONST(-0.88590002059937), COEF_CONST(0.47624599933624) },
+ { COEF_CONST(0.99971461296082), COEF_CONST(-0.83889955282211) },
+ { COEF_CONST(-0.75376385450363), COEF_CONST(0.00814643409103) },
+ { COEF_CONST(0.93887686729431), COEF_CONST(-0.11284527927637) },
+ { COEF_CONST(0.85126435756683), COEF_CONST(0.52349251508713) },
+ { COEF_CONST(0.39701420068741), COEF_CONST(0.81779634952545) },
+ { COEF_CONST(-0.37024465203285), COEF_CONST(-0.87071657180786) },
+ { COEF_CONST(-0.36024826765060), COEF_CONST(0.34655734896660) },
+ { COEF_CONST(-0.93388813734055), COEF_CONST(-0.84476542472839) },
+ { COEF_CONST(-0.65298801660538), COEF_CONST(-0.18439576029778) },
+ { COEF_CONST(0.11960318684578), COEF_CONST(0.99899345636368) },
+ { COEF_CONST(0.94292563199997), COEF_CONST(0.83163905143738) },
+ { COEF_CONST(0.75081145763397), COEF_CONST(-0.35533222556114) },
+ { COEF_CONST(0.56721979379654), COEF_CONST(-0.24076835811138) },
+ { COEF_CONST(0.46857765316963), COEF_CONST(-0.30140233039856) },
+ { COEF_CONST(0.97312313318253), COEF_CONST(-0.99548190832138) },
+ { COEF_CONST(-0.38299977779388), COEF_CONST(0.98516911268234) },
+ { COEF_CONST(0.41025799512863), COEF_CONST(0.02116736955941) },
+ { COEF_CONST(0.09638062119484), COEF_CONST(0.04411984235048) },
+ { COEF_CONST(-0.85283249616623), COEF_CONST(0.91475564241409) },
+ { COEF_CONST(0.88866806030273), COEF_CONST(-0.99735265970230) },
+ { COEF_CONST(-0.48202428221703), COEF_CONST(-0.96805608272552) },
+ { COEF_CONST(0.27572581171989), COEF_CONST(0.58634752035141) },
+ { COEF_CONST(-0.65889132022858), COEF_CONST(0.58835631608963) },
+ { COEF_CONST(0.98838084936142), COEF_CONST(0.99994349479675) },
+ { COEF_CONST(-0.20651349425316), COEF_CONST(0.54593044519424) },
+ { COEF_CONST(-0.62126415967941), COEF_CONST(-0.59893679618835) },
+ { COEF_CONST(0.20320105552673), COEF_CONST(-0.86879181861877) },
+ { COEF_CONST(-0.97790551185608), COEF_CONST(0.96290808916092) },
+ { COEF_CONST(0.11112534999847), COEF_CONST(0.21484763920307) },
+ { COEF_CONST(-0.41368338465691), COEF_CONST(0.28216838836670) },
+ { COEF_CONST(0.24133038520813), COEF_CONST(0.51294362545013) },
+ { COEF_CONST(-0.66393411159515), COEF_CONST(-0.08249679952860) },
+ { COEF_CONST(-0.53697830438614), COEF_CONST(-0.97649902105331) },
+ { COEF_CONST(-0.97224736213684), COEF_CONST(0.22081333398819) },
+ { COEF_CONST(0.87392479181290), COEF_CONST(-0.12796173989773) },
+ { COEF_CONST(0.19050361216068), COEF_CONST(0.01602615416050) },
+ { COEF_CONST(-0.46353441476822), COEF_CONST(-0.95249038934708) },
+ { COEF_CONST(-0.07064096629620), COEF_CONST(-0.94479805231094) },
+ { COEF_CONST(-0.92444086074829), COEF_CONST(-0.10457590222359) },
+ { COEF_CONST(-0.83822596073151), COEF_CONST(-0.01695043221116) },
+ { COEF_CONST(0.75214684009552), COEF_CONST(-0.99955683946609) },
+ { COEF_CONST(-0.42102998495102), COEF_CONST(0.99720942974091) },
+ { COEF_CONST(-0.72094786167145), COEF_CONST(-0.35008960962296) },
+ { COEF_CONST(0.78843313455582), COEF_CONST(0.52851396799088) },
+ { COEF_CONST(0.97394025325775), COEF_CONST(-0.26695942878723) },
+ { COEF_CONST(0.99206465482712), COEF_CONST(-0.57010120153427) },
+ { COEF_CONST(0.76789611577988), COEF_CONST(-0.76519358158112) },
+ { COEF_CONST(-0.82002419233322), COEF_CONST(-0.73530179262161) },
+ { COEF_CONST(0.81924992799759), COEF_CONST(0.99698424339294) },
+ { COEF_CONST(-0.26719850301743), COEF_CONST(0.68903368711472) },
+ { COEF_CONST(-0.43311259150505), COEF_CONST(0.85321813821793) },
+ { COEF_CONST(0.99194979667664), COEF_CONST(0.91876250505447) },
+ { COEF_CONST(-0.80691999197006), COEF_CONST(-0.32627540826797) },
+ { COEF_CONST(0.43080005049706), COEF_CONST(-0.21919095516205) },
+ { COEF_CONST(0.67709493637085), COEF_CONST(-0.95478075742722) },
+ { COEF_CONST(0.56151771545410), COEF_CONST(-0.70693808794022) },
+ { COEF_CONST(0.10831862688065), COEF_CONST(-0.08628837019205) },
+ { COEF_CONST(0.91229414939880), COEF_CONST(-0.65987348556519) },
+ { COEF_CONST(-0.48972892761230), COEF_CONST(0.56289243698120) },
+ { COEF_CONST(-0.89033657312393), COEF_CONST(-0.71656566858292) },
+ { COEF_CONST(0.65269446372986), COEF_CONST(0.65916007757187) },
+ { COEF_CONST(0.67439478635788), COEF_CONST(-0.81684380769730) },
+ { COEF_CONST(-0.47770830988884), COEF_CONST(-0.16789555549622) },
+ { COEF_CONST(-0.99715977907181), COEF_CONST(-0.93565785884857) },
+ { COEF_CONST(-0.90889590978622), COEF_CONST(0.62034398317337) },
+ { COEF_CONST(-0.06618622690439), COEF_CONST(-0.23812216520309) },
+ { COEF_CONST(0.99430269002914), COEF_CONST(0.18812555074692) },
+ { COEF_CONST(0.97686403989792), COEF_CONST(-0.28664535284042) },
+ { COEF_CONST(0.94813650846481), COEF_CONST(-0.97506642341614) },
+ { COEF_CONST(-0.95434498786926), COEF_CONST(-0.79607981443405) },
+ { COEF_CONST(-0.49104782938957), COEF_CONST(0.32895213365555) },
+ { COEF_CONST(0.99881172180176), COEF_CONST(0.88993984460831) },
+ { COEF_CONST(0.50449168682098), COEF_CONST(-0.85995072126389) },
+ { COEF_CONST(0.47162890434265), COEF_CONST(-0.18680204451084) },
+ { COEF_CONST(-0.62081581354141), COEF_CONST(0.75000673532486) },
+ { COEF_CONST(-0.43867015838623), COEF_CONST(0.99998068809509) },
+ { COEF_CONST(0.98630565404892), COEF_CONST(-0.53578901290894) },
+ { COEF_CONST(-0.61510360240936), COEF_CONST(-0.89515018463135) },
+ { COEF_CONST(-0.03841517493129), COEF_CONST(-0.69888818264008) },
+ { COEF_CONST(-0.30102157592773), COEF_CONST(-0.07667808979750) },
+ { COEF_CONST(0.41881284117699), COEF_CONST(0.02188098989427) },
+ { COEF_CONST(-0.86135452985764), COEF_CONST(0.98947483301163) },
+ { COEF_CONST(0.67226862907410), COEF_CONST(-0.13494388759136) },
+ { COEF_CONST(-0.70737397670746), COEF_CONST(-0.76547348499298) },
+ { COEF_CONST(0.94044947624207), COEF_CONST(0.09026201069355) },
+ { COEF_CONST(-0.82386350631714), COEF_CONST(0.08924768865108) },
+ { COEF_CONST(-0.32070666551590), COEF_CONST(0.50143420696259) },
+ { COEF_CONST(0.57593160867691), COEF_CONST(-0.98966425657272) },
+ { COEF_CONST(-0.36326017975807), COEF_CONST(0.07440242916346) },
+ { COEF_CONST(0.99979043006897), COEF_CONST(-0.14130286872387) },
+ { COEF_CONST(-0.92366021871567), COEF_CONST(-0.97979295253754) },
+ { COEF_CONST(-0.44607177376747), COEF_CONST(-0.54233253002167) },
+ { COEF_CONST(0.44226801395416), COEF_CONST(0.71326756477356) },
+ { COEF_CONST(0.03671907261014), COEF_CONST(0.63606387376785) },
+ { COEF_CONST(0.52175426483154), COEF_CONST(-0.85396826267242) },
+ { COEF_CONST(-0.94701141119003), COEF_CONST(-0.01826348155737) },
+ { COEF_CONST(-0.98759609460831), COEF_CONST(0.82288712263107) },
+ { COEF_CONST(0.87434792518616), COEF_CONST(0.89399492740631) },
+ { COEF_CONST(-0.93412041664124), COEF_CONST(0.41374051570892) },
+ { COEF_CONST(0.96063941717148), COEF_CONST(0.93116706609726) },
+ { COEF_CONST(0.97534251213074), COEF_CONST(0.86150932312012) },
+ { COEF_CONST(0.99642467498779), COEF_CONST(0.70190042257309) },
+ { COEF_CONST(-0.94705086946487), COEF_CONST(-0.29580041766167) },
+ { COEF_CONST(0.91599804162979), COEF_CONST(-0.98147833347321) }
+};
+
+#ifdef __cplusplus
+
+#endif
+#endif
\ No newline at end of file
--- /dev/null
+++ b/libfaad/sbr_qmf.c
@@ -1,0 +1,363 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_qmf.c,v 1.5 2003/07/29 08:20:13 menno Exp $
+**/
+
+#include "common.h"
+#include "structs.h"
+
+#ifdef SBR_DEC
+
+
+#include <stdlib.h>
+#include <string.h>
+#include "sbr_dct.h"
+#include "sbr_qmf.h"
+#include "sbr_syntax.h"
+
+
+qmfa_info *qmfa_init(uint8_t channels)
+{
+#if 0
+ int16_t n;
+#endif
+ int size = 0;
+ qmfa_info *qmfa = (qmfa_info*)malloc(sizeof(qmfa_info));
+ qmfa->x = (real_t*)malloc(channels * 10 * sizeof(real_t));
+ memset(qmfa->x, 0, channels * 10 * sizeof(real_t));
+
+ qmfa->channels = channels;
+
+ if (channels == 32)
+ {
+#if 0
+ for (n = 0; n < 32; n++)
+ {
+ qmfa->post_exp_re[n] = cos((M_PI/32.)*(0.75*n + 0.375));
+ qmfa->post_exp_im[n] = sin((M_PI/32.)*(0.75*n + 0.375));
+ }
+#endif
+ } else if (channels == 64) {
+#if 0
+ for (n = 0; n < 2*channels; n++)
+ {
+ qmfa->pre_exp_re[n] = cos(M_PI*n/(2.*channels));
+ qmfa->pre_exp_im[n] = sin(M_PI*n/(2.*channels));
+ }
+ for (n = 0; n < 64; n++)
+ {
+ qmfa->post_exp_re[n] = cos(M_PI*(2*n+1)/(2.*128.));
+ qmfa->post_exp_im[n] = sin(M_PI*(2*n+1)/(2.*128.));
+ }
+#endif
+ }
+
+ return qmfa;
+}
+
+void qmfa_end(qmfa_info *qmfa)
+{
+ if (qmfa)
+ {
+ if (qmfa->x) free(qmfa->x);
+ free(qmfa);
+ }
+}
+
+void sbr_qmf_analysis_32(qmfa_info *qmfa, const real_t *input,
+ qmf_t *X, uint8_t offset)
+{
+ uint8_t l;
+ real_t u[64];
+#ifndef SBR_LOW_POWER
+ real_t x[64], y[64];
+#else
+ real_t y[32];
+#endif
+ const real_t *inptr = input;
+
+ /* qmf subsample l */
+ for (l = 0; l < 32; l++)
+ {
+ int16_t n;
+
+ /* shift input buffer x */
+ memmove(qmfa->x + 32, qmfa->x, (320-32)*sizeof(real_t));
+
+ /* add new samples to input buffer x */
+ for (n = 32 - 1; n >= 0; n--)
+ {
+#ifdef FIXED_POINT
+ qmfa->x[n] = (*inptr++) >> 5;
+#else
+ qmfa->x[n] = *inptr++;
+#endif
+ }
+
+ /* window and summation to create array u */
+ for (n = 0; n < 64; n++)
+ {
+ u[n] = MUL_R_C(qmfa->x[n], qmf_c_2[n]) +
+ MUL_R_C(qmfa->x[n + 64], qmf_c_2[n + 64]) +
+ MUL_R_C(qmfa->x[n + 128], qmf_c_2[n + 128]) +
+ MUL_R_C(qmfa->x[n + 192], qmf_c_2[n + 192]) +
+ MUL_R_C(qmfa->x[n + 256], qmf_c_2[n + 256]);
+ }
+
+ /* calculate 32 subband samples by introducing X */
+#ifdef SBR_LOW_POWER
+ y[0] = u[48];
+ for (n = 1; n < 16; n++)
+ y[n] = u[n+48] + u[48-n];
+ for (n = 16; n < 32; n++)
+ y[n] = -u[n-16] + u[48-n];
+
+ DCT3_32_unscaled(u, y);
+
+ for (n = 0; n < 32; n++)
+ {
+#ifdef FIXED_POINT
+ QMF_RE(X[((l + offset)<<5) + n]) = u[n] << 1;
+#else
+ QMF_RE(X[((l + offset)<<5) + n]) = 2. * u[n];
+#endif
+
+#if 0
+ if (fabs(QMF_RE(X[((l + offset)<<5) + n])) > pow(2,20))
+ {
+ printf("%f\n", QMF_RE(X[((l + offset)<<5) + n]));
+ }
+#endif
+ }
+#else
+ x[0] = u[0];
+ x[63] = u[32];
+ for (n = 2; n < 64; n += 2)
+ {
+ x[n-1] = u[(n>>1)];
+ x[n] = -u[64-(n>>1)];
+ }
+
+ DCT4_64(y, x);
+
+ for (n = 0; n < 32; n++)
+ {
+#ifdef FIXED_POINT
+ QMF_RE(X[((l + offset)<<5) + n]) = y[n] << 1;
+ QMF_IM(X[((l + offset)<<5) + n]) = -y[63-n] << 1;
+#else
+ QMF_RE(X[((l + offset)<<5) + n]) = 2. * y[n];
+ QMF_IM(X[((l + offset)<<5) + n]) = -2. * y[63-n];
+#endif
+
+#if 0
+ if (fabs(QMF_RE(X[((l + offset)<<5) + n])) > pow(2,20))
+ {
+ printf("%f\n", QMF_RE(X[((l + offset)<<5) + n]));
+ }
+ if (fabs(QMF_IM(X[((l + offset)<<5) + n])) > pow(2,20))
+ {
+ printf("%f\n", QMF_IM(X[((l + offset)<<5) + n]));
+ }
+#endif
+ }
+#endif
+ }
+}
+
+qmfs_info *qmfs_init(uint8_t channels)
+{
+ int size = 0;
+ qmfs_info *qmfs = (qmfs_info*)malloc(sizeof(qmfs_info));
+ qmfs->v = (real_t*)malloc(channels * 20 * sizeof(real_t));
+ memset(qmfs->v, 0, channels * 20 * sizeof(real_t));
+
+ qmfs->channels = channels;
+
+ return qmfs;
+}
+
+void qmfs_end(qmfs_info *qmfs)
+{
+ if (qmfs)
+ {
+ if (qmfs->v) free(qmfs->v);
+ free(qmfs);
+ }
+}
+
+#if 0
+void sbr_qmf_synthesis_32(qmfs_info *qmfs, const complex_t *X,
+ real_t *output)
+{
+ uint8_t l;
+ int16_t n, k;
+ real_t w[320];
+ complex_t x[128];
+ real_t *outptr = output;
+
+ /* qmf subsample l */
+ for (l = 0; l < 32; l++)
+ {
+ /* shift buffer */
+ for (n = 640 - 1; n >= 64; n--)
+ {
+ qmfs->v[n] = qmfs->v[n - 64];
+ }
+
+ /* calculate 64 samples */
+ memset(x, 0, 2*64*sizeof(real_t));
+
+ for (k = 0; k < 32; k++)
+ {
+ real_t er, ei, Xr, Xi;
+ er = qmfs->pre_exp_re[k];
+ ei = qmfs->pre_exp_im[k];
+
+ Xr = RE(X[l * 32 + k]);
+ Xi = IM(X[l * 32 + k]);
+ RE(x[k]) = Xr * er - Xi * ei;
+ IM(x[k]) = Xi * er + Xr * ei;
+ }
+
+ cfftb(qmfs->cffts, x);
+
+ for (n = 0; n < 64; n++)
+ {
+ real_t er, ei;
+ er = qmfs->post_exp_re[n];
+ ei = qmfs->post_exp_im[n];
+
+ qmfs->v[n] = RE(x[n]) * er - IM(x[n]) * ei;
+ }
+
+ for (n = 0; n < 5; n++)
+ {
+ for (k = 0; k < 32; k++)
+ {
+ w[64 * n + k] = qmfs->v[128 * n + k];
+ w[64 * n + 32 + k] = qmfs->v[128 * n + 96 + k];
+ }
+ }
+
+ /* window */
+ for (n = 0; n < 320; n++)
+ {
+ w[n] *= qmf_c_2[n];
+ }
+
+ /* calculate 32 output samples */
+ for (k = 0; k < 32; k++)
+ {
+ real_t sample = 0.0;
+
+ for (n = 0; n < 10; n++)
+ {
+ sample += w[32 * n + k];
+ }
+
+ *outptr++ = sample;
+ }
+ }
+}
+#endif
+
+void sbr_qmf_synthesis_64(qmfs_info *qmfs, const qmf_t *X,
+ real_t *output)
+{
+ uint8_t l;
+ int16_t n, k;
+#ifdef SBR_LOW_POWER
+ real_t x[64];
+#else
+ real_t x1[64], x2[64];
+#endif
+ real_t *outptr = output;
+
+
+ /* qmf subsample l */
+ for (l = 0; l < 32; l++)
+ {
+ /* shift buffer */
+ memmove(qmfs->v + 128, qmfs->v, (1280-128)*sizeof(real_t));
+
+ /* calculate 128 samples */
+#ifdef SBR_LOW_POWER
+ for (k = 0; k < 64; k++)
+ {
+#ifdef FIXED_POINT
+ x[k] = QMF_RE(X[(l<<6) + k]);
+#else
+ x[k] = QMF_RE(X[(l<<6) + k]) / 32.;
+#endif
+ }
+
+ DCT2_64_unscaled(x, x);
+
+ for (n = 0; n < 64; n++)
+ {
+ qmfs->v[n+32] = x[n];
+ }
+ qmfs->v[0] = qmfs->v[64];
+ for (n = 1; n < 32; n++)
+ {
+ qmfs->v[32 - n] = qmfs->v[n + 32];
+ qmfs->v[n + 96] = -qmfs->v[96 - n];
+ }
+#else
+ for (k = 0; k < 64; k++)
+ {
+ x1[k] = QMF_RE(X[(l<<6) + k])/64.;
+ x2[k] = QMF_IM(X[(l<<6) + k])/64.;
+ }
+
+ DCT4_64(x1, x1);
+ DST4_64(x2, x2);
+
+ for (n = 0; n < 64; n++)
+ {
+ qmfs->v[n] = x2[n] - x1[n];
+ qmfs->v[127-n] = x2[n] + x1[n];
+ }
+#endif
+
+ /* calculate 64 output samples and window */
+ for (k = 0; k < 64; k++)
+ {
+ *outptr++ = MUL_R_C(qmfs->v[k], qmf_c[k]) +
+ MUL_R_C(qmfs->v[192 + k], qmf_c[64 + k]) +
+ MUL_R_C(qmfs->v[256 + k], qmf_c[128 + k]) +
+ MUL_R_C(qmfs->v[256 + 192 + k], qmf_c[128 + 64 + k]) +
+ MUL_R_C(qmfs->v[512 + k], qmf_c[256 + k]) +
+ MUL_R_C(qmfs->v[512 + 192 + k], qmf_c[256 + 64 + k]) +
+ MUL_R_C(qmfs->v[768 + k], qmf_c[384 + k]) +
+ MUL_R_C(qmfs->v[768 + 192 + k], qmf_c[384 + 64 + k]) +
+ MUL_R_C(qmfs->v[1024 + k], qmf_c[512 + k]) +
+ MUL_R_C(qmfs->v[1024 + 192 + k], qmf_c[512 + 64 + k]);
+ }
+ }
+}
+
+#endif
--- /dev/null
+++ b/libfaad/sbr_qmf.h
@@ -1,0 +1,544 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_qmf.h,v 1.5 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_QMF_H__
+#define __SBR_QMF_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+qmfa_info *qmfa_init(uint8_t channels);
+void qmfa_end(qmfa_info *qmfa);
+qmfs_info *qmfs_init(uint8_t channels);
+void qmfs_end(qmfs_info *qmfs);
+
+void sbr_qmf_analysis_32(qmfa_info *qmfa, const real_t *input,
+ qmf_t *X, uint8_t offset);
+void sbr_qmf_analysis_64(qmfa_info *qmfa, const real_t *input,
+ qmf_t *X, uint8_t maxband, uint8_t offset);
+void sbr_qmf_synthesis_32(qmfs_info *qmfs, const qmf_t *X,
+ real_t *output);
+void sbr_qmf_synthesis_64(qmfs_info *qmfs, const qmf_t *X,
+ real_t *output);
+
+#ifdef _MSC_VER
+#pragma warning(disable:4305)
+#pragma warning(disable:4244)
+#endif
+
+static real_t qmf_c[] = {
+ COEF_CONST(0.0000000000), COEF_CONST(-0.0005525286),
+ COEF_CONST(-0.0005617692), COEF_CONST(-0.0004947518),
+ COEF_CONST(-0.0004875227), COEF_CONST(-0.0004893791),
+ COEF_CONST(-0.0005040714), COEF_CONST(-0.0005226564),
+ COEF_CONST(-0.0005466565), COEF_CONST(-0.0005677802),
+ COEF_CONST(-0.0005870930), COEF_CONST(-0.0006132747),
+ COEF_CONST(-0.0006312493), COEF_CONST(-0.0006540333),
+ COEF_CONST(-0.0006777690), COEF_CONST(-0.0006941614),
+ COEF_CONST(-0.0007157736), COEF_CONST(-0.0007255043),
+ COEF_CONST(-0.0007440941), COEF_CONST(-0.0007490598),
+ COEF_CONST(-0.0007681371), COEF_CONST(-0.0007724848),
+ COEF_CONST(-0.0007834332), COEF_CONST(-0.0007779869),
+ COEF_CONST(-0.0007803664), COEF_CONST(-0.0007801449),
+ COEF_CONST(-0.0007757977), COEF_CONST(-0.0007630793),
+ COEF_CONST(-0.0007530001), COEF_CONST(-0.0007319357),
+ COEF_CONST(-0.0007215391), COEF_CONST(-0.0006917937),
+ COEF_CONST(-0.0006650415), COEF_CONST(-0.0006341594),
+ COEF_CONST(-0.0005946118), COEF_CONST(-0.0005564576),
+ COEF_CONST(-0.0005145572), COEF_CONST(-0.0004606325),
+ COEF_CONST(-0.0004095121), COEF_CONST(-0.0003501175),
+ COEF_CONST(-0.0002896981), COEF_CONST(-0.0002098337),
+ COEF_CONST(-0.0001446380), COEF_CONST(-0.0000617334),
+ COEF_CONST(0.0000134949), COEF_CONST(0.0001094383),
+ COEF_CONST(0.0002043017), COEF_CONST(0.0002949531),
+ COEF_CONST(0.0004026540), COEF_CONST(0.0005107388),
+ COEF_CONST(0.0006239376), COEF_CONST(0.0007458025),
+ COEF_CONST(0.0008608443), COEF_CONST(0.0009885988),
+ COEF_CONST(0.0011250156), COEF_CONST(0.0012577884),
+ COEF_CONST(0.0013902494), COEF_CONST(0.0015443219),
+ COEF_CONST(0.0016868083), COEF_CONST(0.0018348265),
+ COEF_CONST(0.0019841141), COEF_CONST(0.0021461584),
+ COEF_CONST(0.0023017253), COEF_CONST(0.0024625617),
+ COEF_CONST(0.0026201757), COEF_CONST(0.0027870464),
+ COEF_CONST(0.0029469447), COEF_CONST(0.0031125420),
+ COEF_CONST(0.0032739614), COEF_CONST(0.0034418874),
+ COEF_CONST(0.0036008267), COEF_CONST(0.0037603923),
+ COEF_CONST(0.0039207432), COEF_CONST(0.0040819752),
+ COEF_CONST(0.0042264271), COEF_CONST(0.0043730717),
+ COEF_CONST(0.0045209853), COEF_CONST(0.0046606460),
+ COEF_CONST(0.0047932561), COEF_CONST(0.0049137603),
+ COEF_CONST(0.0050393022), COEF_CONST(0.0051407353),
+ COEF_CONST(0.0052461168), COEF_CONST(0.0053471681),
+ COEF_CONST(0.0054196776), COEF_CONST(0.0054876041),
+ COEF_CONST(0.0055475715), COEF_CONST(0.0055938023),
+ COEF_CONST(0.0056220642), COEF_CONST(0.0056455196),
+ COEF_CONST(0.0056389198), COEF_CONST(0.0056266114),
+ COEF_CONST(0.0055917129), COEF_CONST(0.0055404361),
+ COEF_CONST(0.0054753781), COEF_CONST(0.0053838976),
+ COEF_CONST(0.0052715759), COEF_CONST(0.0051382277),
+ COEF_CONST(0.0049839686), COEF_CONST(0.0048109470),
+ COEF_CONST(0.0046039531), COEF_CONST(0.0043801861),
+ COEF_CONST(0.0041251644), COEF_CONST(0.0038456407),
+ COEF_CONST(0.0035401245), COEF_CONST(0.0032091886),
+ COEF_CONST(0.0028446757), COEF_CONST(0.0024508541),
+ COEF_CONST(0.0020274175), COEF_CONST(0.0015784682),
+ COEF_CONST(0.0010902329), COEF_CONST(0.0005832264),
+ COEF_CONST(0.0000276045), COEF_CONST(-0.0005464280),
+ COEF_CONST(-0.0011568135), COEF_CONST(-0.0018039471),
+ COEF_CONST(-0.0024826722), COEF_CONST(-0.0031933777),
+ COEF_CONST(-0.0039401124), COEF_CONST(-0.0047222595),
+ COEF_CONST(-0.0055337213), COEF_CONST(-0.0063792295),
+ COEF_CONST(-0.0072615817), COEF_CONST(-0.0081798229),
+ COEF_CONST(-0.0091325333), COEF_CONST(-0.0101150218),
+ COEF_CONST(-0.0111315548), COEF_CONST(-0.0121849999),
+ COEF_CONST(0.0132718217), COEF_CONST(0.0143904667),
+ COEF_CONST(0.0155405551), COEF_CONST(0.0167324711),
+ COEF_CONST(0.0179433376), COEF_CONST(0.0191872437),
+ COEF_CONST(0.0204531793), COEF_CONST(0.0217467546),
+ COEF_CONST(0.0230680164), COEF_CONST(0.0244160984),
+ COEF_CONST(0.0257875845), COEF_CONST(0.0271859430),
+ COEF_CONST(0.0286072176), COEF_CONST(0.0300502665),
+ COEF_CONST(0.0315017626), COEF_CONST(0.0329754092),
+ COEF_CONST(0.0344620943), COEF_CONST(0.0359697565),
+ COEF_CONST(0.0374812856), COEF_CONST(0.0390053689),
+ COEF_CONST(0.0405349173), COEF_CONST(0.0420649089),
+ COEF_CONST(0.0436097533), COEF_CONST(0.0451488420),
+ COEF_CONST(0.0466843024), COEF_CONST(0.0482165702),
+ COEF_CONST(0.0497385748), COEF_CONST(0.0512556173),
+ COEF_CONST(0.0527630746), COEF_CONST(0.0542452782),
+ COEF_CONST(0.0557173640), COEF_CONST(0.0571616441),
+ COEF_CONST(0.0585915670), COEF_CONST(0.0599837489),
+ COEF_CONST(0.0613455176), COEF_CONST(0.0626857802),
+ COEF_CONST(0.0639715865), COEF_CONST(0.0652247071),
+ COEF_CONST(0.0664367527), COEF_CONST(0.0676075965),
+ COEF_CONST(0.0687043816), COEF_CONST(0.0697630271),
+ COEF_CONST(0.0707628727), COEF_CONST(0.0717002675),
+ COEF_CONST(0.0725682601), COEF_CONST(0.0733620226),
+ COEF_CONST(0.0741003677), COEF_CONST(0.0747452527),
+ COEF_CONST(0.0753137320), COEF_CONST(0.0758008361),
+ COEF_CONST(0.0761992484), COEF_CONST(0.0764992163),
+ COEF_CONST(0.0767093524), COEF_CONST(0.0768174008),
+ COEF_CONST(0.0768230036), COEF_CONST(0.0767204911),
+ COEF_CONST(0.0765050724), COEF_CONST(0.0761748329),
+ COEF_CONST(0.0757305771), COEF_CONST(0.0751576275),
+ COEF_CONST(0.0744664371), COEF_CONST(0.0736405998),
+ COEF_CONST(0.0726774633), COEF_CONST(0.0715826377),
+ COEF_CONST(0.0703533068), COEF_CONST(0.0689664036),
+ COEF_CONST(0.0674525052), COEF_CONST(0.0657690689),
+ COEF_CONST(0.0639444813), COEF_CONST(0.0619602762),
+ COEF_CONST(0.0598166585), COEF_CONST(0.0575152673),
+ COEF_CONST(0.0550460033), COEF_CONST(0.0524093807),
+ COEF_CONST(0.0495978668), COEF_CONST(0.0466303304),
+ COEF_CONST(0.0434768796), COEF_CONST(0.0401458293),
+ COEF_CONST(0.0366418101), COEF_CONST(0.0329583921),
+ COEF_CONST(0.0290824007), COEF_CONST(0.0250307564),
+ COEF_CONST(0.0207997076), COEF_CONST(0.0163701251),
+ COEF_CONST(0.0117623834), COEF_CONST(0.0069636861),
+ COEF_CONST(0.0019765601), COEF_CONST(-0.0032086896),
+ COEF_CONST(-0.0085711749), COEF_CONST(-0.0141288824),
+ COEF_CONST(-0.0198834129), COEF_CONST(-0.0258227289),
+ COEF_CONST(-0.0319531262), COEF_CONST(-0.0382776558),
+ COEF_CONST(-0.0447806828), COEF_CONST(-0.0514804162),
+ COEF_CONST(-0.0583705343), COEF_CONST(-0.0654409826),
+ COEF_CONST(-0.0726943314), COEF_CONST(-0.0801372901),
+ COEF_CONST(-0.0877547562), COEF_CONST(-0.0955533385),
+ COEF_CONST(-0.1035329551), COEF_CONST(-0.1116826907),
+ COEF_CONST(-0.1200077981), COEF_CONST(-0.1285002828),
+ COEF_CONST(-0.1371551752), COEF_CONST(-0.1459766477),
+ COEF_CONST(-0.1549607068), COEF_CONST(-0.1640958786),
+ COEF_CONST(-0.1733808219), COEF_CONST(-0.1828172505),
+ COEF_CONST(-0.1923966706), COEF_CONST(-0.2021250129),
+ COEF_CONST(-0.2119735926), COEF_CONST(-0.2219652683),
+ COEF_CONST(-0.2320690900), COEF_CONST(-0.2423016876),
+ COEF_CONST(-0.2526480258), COEF_CONST(-0.2631053329),
+ COEF_CONST(-0.2736634016), COEF_CONST(-0.2843214273),
+ COEF_CONST(-0.2950716615), COEF_CONST(-0.3059098721),
+ COEF_CONST(-0.3168278933), COEF_CONST(-0.3278113604),
+ COEF_CONST(-0.3388722837), COEF_CONST(-0.3499914110),
+ COEF_CONST(0.3611589968), COEF_CONST(0.3723795414),
+ COEF_CONST(0.3836350143), COEF_CONST(0.3949211836),
+ COEF_CONST(0.4062317610), COEF_CONST(0.4175696969),
+ COEF_CONST(0.4289119840), COEF_CONST(0.4402553737),
+ COEF_CONST(0.4515996575), COEF_CONST(0.4629307985),
+ COEF_CONST(0.4742453098), COEF_CONST(0.4855253100),
+ COEF_CONST(0.4967708290), COEF_CONST(0.5079817772),
+ COEF_CONST(0.5191234946), COEF_CONST(0.5302240849),
+ COEF_CONST(0.5412553549), COEF_CONST(0.5522051454),
+ COEF_CONST(0.5630789399), COEF_CONST(0.5738524199),
+ COEF_CONST(0.5845403075), COEF_CONST(0.5951123238),
+ COEF_CONST(0.6055783629), COEF_CONST(0.6159110069),
+ COEF_CONST(0.6261242628), COEF_CONST(0.6361979842),
+ COEF_CONST(0.6461269855), COEF_CONST(0.6559016109),
+ COEF_CONST(0.6655139923), COEF_CONST(0.6749663353),
+ COEF_CONST(0.6842353344), COEF_CONST(0.6933282614),
+ COEF_CONST(0.7022388577), COEF_CONST(0.7109410167),
+ COEF_CONST(0.7194462419), COEF_CONST(0.7277448773),
+ COEF_CONST(0.7358211875), COEF_CONST(0.7436828017),
+ COEF_CONST(0.7513137460), COEF_CONST(0.7587080598),
+ COEF_CONST(0.7658674717), COEF_CONST(0.7727780938),
+ COEF_CONST(0.7794287801), COEF_CONST(0.7858353257),
+ COEF_CONST(0.7919735909), COEF_CONST(0.7978466153),
+ COEF_CONST(0.8034485579), COEF_CONST(0.8087695241),
+ COEF_CONST(0.8138191104), COEF_CONST(0.8185775876),
+ COEF_CONST(0.8230419755), COEF_CONST(0.8272275329),
+ COEF_CONST(0.8311038613), COEF_CONST(0.8346937299),
+ COEF_CONST(0.8379717469), COEF_CONST(0.8409541249),
+ COEF_CONST(0.8436238170), COEF_CONST(0.8459818363),
+ COEF_CONST(0.8480315804), COEF_CONST(0.8497804999),
+ COEF_CONST(0.8511971235), COEF_CONST(0.8523046970),
+ COEF_CONST(0.8531020880), COEF_CONST(0.8535720706),
+ COEF_CONST(0.8537385464), COEF_CONST(0.8535720706),
+ COEF_CONST(0.8531020880), COEF_CONST(0.8523046970),
+ COEF_CONST(0.8511971235), COEF_CONST(0.8497804999),
+ COEF_CONST(0.8480315804), COEF_CONST(0.8459818363),
+ COEF_CONST(0.8436238170), COEF_CONST(0.8409541249),
+ COEF_CONST(0.8379717469), COEF_CONST(0.8346937299),
+ COEF_CONST(0.8311038613), COEF_CONST(0.8272275329),
+ COEF_CONST(0.8230419755), COEF_CONST(0.8185775876),
+ COEF_CONST(0.8138191104), COEF_CONST(0.8087695241),
+ COEF_CONST(0.8034485579), COEF_CONST(0.7978466153),
+ COEF_CONST(0.7919735909), COEF_CONST(0.7858353257),
+ COEF_CONST(0.7794287801), COEF_CONST(0.7727780938),
+ COEF_CONST(0.7658674717), COEF_CONST(0.7587080598),
+ COEF_CONST(0.7513137460), COEF_CONST(0.7436828017),
+ COEF_CONST(0.7358211875), COEF_CONST(0.7277448773),
+ COEF_CONST(0.7194462419), COEF_CONST(0.7109410167),
+ COEF_CONST(0.7022388577), COEF_CONST(0.6933282614),
+ COEF_CONST(0.6842353344), COEF_CONST(0.6749663353),
+ COEF_CONST(0.6655139923), COEF_CONST(0.6559016109),
+ COEF_CONST(0.6461269855), COEF_CONST(0.6361979842),
+ COEF_CONST(0.6261242628), COEF_CONST(0.6159110069),
+ COEF_CONST(0.6055783629), COEF_CONST(0.5951123238),
+ COEF_CONST(0.5845403075), COEF_CONST(0.5738524199),
+ COEF_CONST(0.5630789399), COEF_CONST(0.5522051454),
+ COEF_CONST(0.5412553549), COEF_CONST(0.5302240849),
+ COEF_CONST(0.5191234946), COEF_CONST(0.5079817772),
+ COEF_CONST(0.4967708290), COEF_CONST(0.4855253100),
+ COEF_CONST(0.4742453098), COEF_CONST(0.4629307985),
+ COEF_CONST(0.4515996575), COEF_CONST(0.4402553737),
+ COEF_CONST(0.4289119840), COEF_CONST(0.4175696969),
+ COEF_CONST(0.4062317610), COEF_CONST(0.3949211836),
+ COEF_CONST(0.3836350143), COEF_CONST(0.3723795414),
+ COEF_CONST(-0.3611589968), COEF_CONST(-0.3499914110),
+ COEF_CONST(-0.3388722837), COEF_CONST(-0.3278113604),
+ COEF_CONST(-0.3168278933), COEF_CONST(-0.3059098721),
+ COEF_CONST(-0.2950716615), COEF_CONST(-0.2843214273),
+ COEF_CONST(-0.2736634016), COEF_CONST(-0.2631053329),
+ COEF_CONST(-0.2526480258), COEF_CONST(-0.2423016876),
+ COEF_CONST(-0.2320690900), COEF_CONST(-0.2219652683),
+ COEF_CONST(-0.2119735926), COEF_CONST(-0.2021250129),
+ COEF_CONST(-0.1923966706), COEF_CONST(-0.1828172505),
+ COEF_CONST(-0.1733808219), COEF_CONST(-0.1640958786),
+ COEF_CONST(-0.1549607068), COEF_CONST(-0.1459766477),
+ COEF_CONST(-0.1371551752), COEF_CONST(-0.1285002828),
+ COEF_CONST(-0.1200077981), COEF_CONST(-0.1116826907),
+ COEF_CONST(-0.1035329551), COEF_CONST(-0.0955533385),
+ COEF_CONST(-0.0877547562), COEF_CONST(-0.0801372901),
+ COEF_CONST(-0.0726943314), COEF_CONST(-0.0654409826),
+ COEF_CONST(-0.0583705343), COEF_CONST(-0.0514804162),
+ COEF_CONST(-0.0447806828), COEF_CONST(-0.0382776558),
+ COEF_CONST(-0.0319531262), COEF_CONST(-0.0258227289),
+ COEF_CONST(-0.0198834129), COEF_CONST(-0.0141288824),
+ COEF_CONST(-0.0085711749), COEF_CONST(-0.0032086896),
+ COEF_CONST(0.0019765601), COEF_CONST(0.0069636861),
+ COEF_CONST(0.0117623834), COEF_CONST(0.0163701251),
+ COEF_CONST(0.0207997076), COEF_CONST(0.0250307564),
+ COEF_CONST(0.0290824007), COEF_CONST(0.0329583921),
+ COEF_CONST(0.0366418101), COEF_CONST(0.0401458293),
+ COEF_CONST(0.0434768796), COEF_CONST(0.0466303304),
+ COEF_CONST(0.0495978668), COEF_CONST(0.0524093807),
+ COEF_CONST(0.0550460033), COEF_CONST(0.0575152673),
+ COEF_CONST(0.0598166585), COEF_CONST(0.0619602762),
+ COEF_CONST(0.0639444813), COEF_CONST(0.0657690689),
+ COEF_CONST(0.0674525052), COEF_CONST(0.0689664036),
+ COEF_CONST(0.0703533068), COEF_CONST(0.0715826377),
+ COEF_CONST(0.0726774633), COEF_CONST(0.0736405998),
+ COEF_CONST(0.0744664371), COEF_CONST(0.0751576275),
+ COEF_CONST(0.0757305771), COEF_CONST(0.0761748329),
+ COEF_CONST(0.0765050724), COEF_CONST(0.0767204911),
+ COEF_CONST(0.0768230036), COEF_CONST(0.0768174008),
+ COEF_CONST(0.0767093524), COEF_CONST(0.0764992163),
+ COEF_CONST(0.0761992484), COEF_CONST(0.0758008361),
+ COEF_CONST(0.0753137320), COEF_CONST(0.0747452527),
+ COEF_CONST(0.0741003677), COEF_CONST(0.0733620226),
+ COEF_CONST(0.0725682601), COEF_CONST(0.0717002675),
+ COEF_CONST(0.0707628727), COEF_CONST(0.0697630271),
+ COEF_CONST(0.0687043816), COEF_CONST(0.0676075965),
+ COEF_CONST(0.0664367527), COEF_CONST(0.0652247071),
+ COEF_CONST(0.0639715865), COEF_CONST(0.0626857802),
+ COEF_CONST(0.0613455176), COEF_CONST(0.0599837489),
+ COEF_CONST(0.0585915670), COEF_CONST(0.0571616441),
+ COEF_CONST(0.0557173640), COEF_CONST(0.0542452782),
+ COEF_CONST(0.0527630746), COEF_CONST(0.0512556173),
+ COEF_CONST(0.0497385748), COEF_CONST(0.0482165702),
+ COEF_CONST(0.0466843024), COEF_CONST(0.0451488420),
+ COEF_CONST(0.0436097533), COEF_CONST(0.0420649089),
+ COEF_CONST(0.0405349173), COEF_CONST(0.0390053689),
+ COEF_CONST(0.0374812856), COEF_CONST(0.0359697565),
+ COEF_CONST(0.0344620943), COEF_CONST(0.0329754092),
+ COEF_CONST(0.0315017626), COEF_CONST(0.0300502665),
+ COEF_CONST(0.0286072176), COEF_CONST(0.0271859430),
+ COEF_CONST(0.0257875845), COEF_CONST(0.0244160984),
+ COEF_CONST(0.0230680164), COEF_CONST(0.0217467546),
+ COEF_CONST(0.0204531793), COEF_CONST(0.0191872437),
+ COEF_CONST(0.0179433376), COEF_CONST(0.0167324711),
+ COEF_CONST(0.0155405551), COEF_CONST(0.0143904667),
+ COEF_CONST(-0.0132718217), COEF_CONST(-0.0121849999),
+ COEF_CONST(-0.0111315548), COEF_CONST(-0.0101150218),
+ COEF_CONST(-0.0091325333), COEF_CONST(-0.0081798229),
+ COEF_CONST(-0.0072615817), COEF_CONST(-0.0063792295),
+ COEF_CONST(-0.0055337213), COEF_CONST(-0.0047222595),
+ COEF_CONST(-0.0039401124), COEF_CONST(-0.0031933777),
+ COEF_CONST(-0.0024826722), COEF_CONST(-0.0018039471),
+ COEF_CONST(-0.0011568135), COEF_CONST(-0.0005464280),
+ COEF_CONST(0.0000276045), COEF_CONST(0.0005832264),
+ COEF_CONST(0.0010902329), COEF_CONST(0.0015784682),
+ COEF_CONST(0.0020274175), COEF_CONST(0.0024508541),
+ COEF_CONST(0.0028446757), COEF_CONST(0.0032091886),
+ COEF_CONST(0.0035401245), COEF_CONST(0.0038456407),
+ COEF_CONST(0.0041251644), COEF_CONST(0.0043801861),
+ COEF_CONST(0.0046039531), COEF_CONST(0.0048109470),
+ COEF_CONST(0.0049839686), COEF_CONST(0.0051382277),
+ COEF_CONST(0.0052715759), COEF_CONST(0.0053838976),
+ COEF_CONST(0.0054753781), COEF_CONST(0.0055404361),
+ COEF_CONST(0.0055917129), COEF_CONST(0.0056266114),
+ COEF_CONST(0.0056389198), COEF_CONST(0.0056455196),
+ COEF_CONST(0.0056220642), COEF_CONST(0.0055938023),
+ COEF_CONST(0.0055475715), COEF_CONST(0.0054876041),
+ COEF_CONST(0.0054196776), COEF_CONST(0.0053471681),
+ COEF_CONST(0.0052461168), COEF_CONST(0.0051407353),
+ COEF_CONST(0.0050393022), COEF_CONST(0.0049137603),
+ COEF_CONST(0.0047932561), COEF_CONST(0.0046606460),
+ COEF_CONST(0.0045209853), COEF_CONST(0.0043730717),
+ COEF_CONST(0.0042264271), COEF_CONST(0.0040819752),
+ COEF_CONST(0.0039207432), COEF_CONST(0.0037603923),
+ COEF_CONST(0.0036008267), COEF_CONST(0.0034418874),
+ COEF_CONST(0.0032739614), COEF_CONST(0.0031125420),
+ COEF_CONST(0.0029469447), COEF_CONST(0.0027870464),
+ COEF_CONST(0.0026201757), COEF_CONST(0.0024625617),
+ COEF_CONST(0.0023017253), COEF_CONST(0.0021461584),
+ COEF_CONST(0.0019841141), COEF_CONST(0.0018348265),
+ COEF_CONST(0.0016868083), COEF_CONST(0.0015443219),
+ COEF_CONST(0.0013902494), COEF_CONST(0.0012577884),
+ COEF_CONST(0.0011250156), COEF_CONST(0.0009885988),
+ COEF_CONST(0.0008608443), COEF_CONST(0.0007458025),
+ COEF_CONST(0.0006239376), COEF_CONST(0.0005107388),
+ COEF_CONST(0.0004026540), COEF_CONST(0.0002949531),
+ COEF_CONST(0.0002043017), COEF_CONST(0.0001094383),
+ COEF_CONST(0.0000134949), COEF_CONST(-0.0000617334),
+ COEF_CONST(-0.0001446380), COEF_CONST(-0.0002098337),
+ COEF_CONST(-0.0002896981), COEF_CONST(-0.0003501175),
+ COEF_CONST(-0.0004095121), COEF_CONST(-0.0004606325),
+ COEF_CONST(-0.0005145572), COEF_CONST(-0.0005564576),
+ COEF_CONST(-0.0005946118), COEF_CONST(-0.0006341594),
+ COEF_CONST(-0.0006650415), COEF_CONST(-0.0006917937),
+ COEF_CONST(-0.0007215391), COEF_CONST(-0.0007319357),
+ COEF_CONST(-0.0007530001), COEF_CONST(-0.0007630793),
+ COEF_CONST(-0.0007757977), COEF_CONST(-0.0007801449),
+ COEF_CONST(-0.0007803664), COEF_CONST(-0.0007779869),
+ COEF_CONST(-0.0007834332), COEF_CONST(-0.0007724848),
+ COEF_CONST(-0.0007681371), COEF_CONST(-0.0007490598),
+ COEF_CONST(-0.0007440941), COEF_CONST(-0.0007255043),
+ COEF_CONST(-0.0007157736), COEF_CONST(-0.0006941614),
+ COEF_CONST(-0.0006777690), COEF_CONST(-0.0006540333),
+ COEF_CONST(-0.0006312493), COEF_CONST(-0.0006132747),
+ COEF_CONST(-0.0005870930), COEF_CONST(-0.0005677802),
+ COEF_CONST(-0.0005466565), COEF_CONST(-0.0005226564),
+ COEF_CONST(-0.0005040714), COEF_CONST(-0.0004893791),
+ COEF_CONST(-0.0004875227), COEF_CONST(-0.0004947518),
+ COEF_CONST(-0.0005617692), COEF_CONST(-0.0005525280)
+};
+
+static real_t qmf_c_2[] = {
+ COEF_CONST(0.0000000000), COEF_CONST(-0.0005617692),
+ COEF_CONST(-0.0004875227), COEF_CONST(-0.0005040714),
+ COEF_CONST(-0.0005466565), COEF_CONST(-0.0005870930),
+ COEF_CONST(-0.0006312493), COEF_CONST(-0.0006777690),
+ COEF_CONST(-0.0007157736), COEF_CONST(-0.0007440941),
+ COEF_CONST(-0.0007681371), COEF_CONST(-0.0007834332),
+ COEF_CONST(-0.0007803664), COEF_CONST(-0.0007757977),
+ COEF_CONST(-0.0007530001), COEF_CONST(-0.0007215391),
+ COEF_CONST(-0.0006650415), COEF_CONST(-0.0005946118),
+ COEF_CONST(-0.0005145572), COEF_CONST(-0.0004095121),
+ COEF_CONST(-0.0002896981), COEF_CONST(-0.0001446380),
+ COEF_CONST(0.0000134949), COEF_CONST(0.0002043017),
+ COEF_CONST(0.0004026540), COEF_CONST(0.0006239376),
+ COEF_CONST(0.0008608443), COEF_CONST(0.0011250156),
+ COEF_CONST(0.0013902494), COEF_CONST(0.0016868083),
+ COEF_CONST(0.0019841141), COEF_CONST(0.0023017253),
+ COEF_CONST(0.0026201757), COEF_CONST(0.0029469447),
+ COEF_CONST(0.0032739614), COEF_CONST(0.0036008267),
+ COEF_CONST(0.0039207432), COEF_CONST(0.0042264271),
+ COEF_CONST(0.0045209853), COEF_CONST(0.0047932561),
+ COEF_CONST(0.0050393022), COEF_CONST(0.0052461168),
+ COEF_CONST(0.0054196776), COEF_CONST(0.0055475715),
+ COEF_CONST(0.0056220642), COEF_CONST(0.0056389198),
+ COEF_CONST(0.0055917129), COEF_CONST(0.0054753781),
+ COEF_CONST(0.0052715759), COEF_CONST(0.0049839686),
+ COEF_CONST(0.0046039531), COEF_CONST(0.0041251644),
+ COEF_CONST(0.0035401245), COEF_CONST(0.0028446757),
+ COEF_CONST(0.0020274175), COEF_CONST(0.0010902329),
+ COEF_CONST(0.0000276045), COEF_CONST(-0.0011568135),
+ COEF_CONST(-0.0024826722), COEF_CONST(-0.0039401124),
+ COEF_CONST(-0.0055337213), COEF_CONST(-0.0072615817),
+ COEF_CONST(-0.0091325333), COEF_CONST(-0.0111315548),
+ COEF_CONST(0.0132718217), COEF_CONST(0.0155405551),
+ COEF_CONST(0.0179433376), COEF_CONST(0.0204531793),
+ COEF_CONST(0.0230680164), COEF_CONST(0.0257875845),
+ COEF_CONST(0.0286072176), COEF_CONST(0.0315017626),
+ COEF_CONST(0.0344620943), COEF_CONST(0.0374812856),
+ COEF_CONST(0.0405349173), COEF_CONST(0.0436097533),
+ COEF_CONST(0.0466843024), COEF_CONST(0.0497385748),
+ COEF_CONST(0.0527630746), COEF_CONST(0.0557173640),
+ COEF_CONST(0.0585915670), COEF_CONST(0.0613455176),
+ COEF_CONST(0.0639715865), COEF_CONST(0.0664367527),
+ COEF_CONST(0.0687043816), COEF_CONST(0.0707628727),
+ COEF_CONST(0.0725682601), COEF_CONST(0.0741003677),
+ COEF_CONST(0.0753137320), COEF_CONST(0.0761992484),
+ COEF_CONST(0.0767093524), COEF_CONST(0.0768230036),
+ COEF_CONST(0.0765050724), COEF_CONST(0.0757305771),
+ COEF_CONST(0.0744664371), COEF_CONST(0.0726774633),
+ COEF_CONST(0.0703533068), COEF_CONST(0.0674525052),
+ COEF_CONST(0.0639444813), COEF_CONST(0.0598166585),
+ COEF_CONST(0.0550460033), COEF_CONST(0.0495978668),
+ COEF_CONST(0.0434768796), COEF_CONST(0.0366418101),
+ COEF_CONST(0.0290824007), COEF_CONST(0.0207997076),
+ COEF_CONST(0.0117623834), COEF_CONST(0.0019765601),
+ COEF_CONST(-0.0085711749), COEF_CONST(-0.0198834129),
+ COEF_CONST(-0.0319531262), COEF_CONST(-0.0447806828),
+ COEF_CONST(-0.0583705343), COEF_CONST(-0.0726943314),
+ COEF_CONST(-0.0877547562), COEF_CONST(-0.1035329551),
+ COEF_CONST(-0.1200077981), COEF_CONST(-0.1371551752),
+ COEF_CONST(-0.1549607068), COEF_CONST(-0.1733808219),
+ COEF_CONST(-0.1923966706), COEF_CONST(-0.2119735926),
+ COEF_CONST(-0.2320690900), COEF_CONST(-0.2526480258),
+ COEF_CONST(-0.2736634016), COEF_CONST(-0.2950716615),
+ COEF_CONST(-0.3168278933), COEF_CONST(-0.3388722837),
+ COEF_CONST(0.3611589968), COEF_CONST(0.3836350143),
+ COEF_CONST(0.4062317610), COEF_CONST(0.4289119840),
+ COEF_CONST(0.4515996575), COEF_CONST(0.4742453098),
+ COEF_CONST(0.4967708290), COEF_CONST(0.5191234946),
+ COEF_CONST(0.5412553549), COEF_CONST(0.5630789399),
+ COEF_CONST(0.5845403075), COEF_CONST(0.6055783629),
+ COEF_CONST(0.6261242628), COEF_CONST(0.6461269855),
+ COEF_CONST(0.6655139923), COEF_CONST(0.6842353344),
+ COEF_CONST(0.7022388577), COEF_CONST(0.7194462419),
+ COEF_CONST(0.7358211875), COEF_CONST(0.7513137460),
+ COEF_CONST(0.7658674717), COEF_CONST(0.7794287801),
+ COEF_CONST(0.7919735909), COEF_CONST(0.8034485579),
+ COEF_CONST(0.8138191104), COEF_CONST(0.8230419755),
+ COEF_CONST(0.8311038613), COEF_CONST(0.8379717469),
+ COEF_CONST(0.8436238170), COEF_CONST(0.8480315804),
+ COEF_CONST(0.8511971235), COEF_CONST(0.8531020880),
+ COEF_CONST(0.8537385464), COEF_CONST(0.8531020880),
+ COEF_CONST(0.8511971235), COEF_CONST(0.8480315804),
+ COEF_CONST(0.8436238170), COEF_CONST(0.8379717469),
+ COEF_CONST(0.8311038613), COEF_CONST(0.8230419755),
+ COEF_CONST(0.8138191104), COEF_CONST(0.8034485579),
+ COEF_CONST(0.7919735909), COEF_CONST(0.7794287801),
+ COEF_CONST(0.7658674717), COEF_CONST(0.7513137460),
+ COEF_CONST(0.7358211875), COEF_CONST(0.7194462419),
+ COEF_CONST(0.7022388577), COEF_CONST(0.6842353344),
+ COEF_CONST(0.6655139923), COEF_CONST(0.6461269855),
+ COEF_CONST(0.6261242628), COEF_CONST(0.6055783629),
+ COEF_CONST(0.5845403075), COEF_CONST(0.5630789399),
+ COEF_CONST(0.5412553549), COEF_CONST(0.5191234946),
+ COEF_CONST(0.4967708290), COEF_CONST(0.4742453098),
+ COEF_CONST(0.4515996575), COEF_CONST(0.4289119840),
+ COEF_CONST(0.4062317610), COEF_CONST(0.3836350143),
+ COEF_CONST(-0.3611589968), COEF_CONST(-0.3388722837),
+ COEF_CONST(-0.3168278933), COEF_CONST(-0.2950716615),
+ COEF_CONST(-0.2736634016), COEF_CONST(-0.2526480258),
+ COEF_CONST(-0.2320690900), COEF_CONST(-0.2119735926),
+ COEF_CONST(-0.1923966706), COEF_CONST(-0.1733808219),
+ COEF_CONST(-0.1549607068), COEF_CONST(-0.1371551752),
+ COEF_CONST(-0.1200077981), COEF_CONST(-0.1035329551),
+ COEF_CONST(-0.0877547562), COEF_CONST(-0.0726943314),
+ COEF_CONST(-0.0583705343), COEF_CONST(-0.0447806828),
+ COEF_CONST(-0.0319531262), COEF_CONST(-0.0198834129),
+ COEF_CONST(-0.0085711749), COEF_CONST(0.0019765601),
+ COEF_CONST(0.0117623834), COEF_CONST(0.0207997076),
+ COEF_CONST(0.0290824007), COEF_CONST(0.0366418101),
+ COEF_CONST(0.0434768796), COEF_CONST(0.0495978668),
+ COEF_CONST(0.0550460033), COEF_CONST(0.0598166585),
+ COEF_CONST(0.0639444813), COEF_CONST(0.0674525052),
+ COEF_CONST(0.0703533068), COEF_CONST(0.0726774633),
+ COEF_CONST(0.0744664371), COEF_CONST(0.0757305771),
+ COEF_CONST(0.0765050724), COEF_CONST(0.0768230036),
+ COEF_CONST(0.0767093524), COEF_CONST(0.0761992484),
+ COEF_CONST(0.0753137320), COEF_CONST(0.0741003677),
+ COEF_CONST(0.0725682601), COEF_CONST(0.0707628727),
+ COEF_CONST(0.0687043816), COEF_CONST(0.0664367527),
+ COEF_CONST(0.0639715865), COEF_CONST(0.0613455176),
+ COEF_CONST(0.0585915670), COEF_CONST(0.0557173640),
+ COEF_CONST(0.0527630746), COEF_CONST(0.0497385748),
+ COEF_CONST(0.0466843024), COEF_CONST(0.0436097533),
+ COEF_CONST(0.0405349173), COEF_CONST(0.0374812856),
+ COEF_CONST(0.0344620943), COEF_CONST(0.0315017626),
+ COEF_CONST(0.0286072176), COEF_CONST(0.0257875845),
+ COEF_CONST(0.0230680164), COEF_CONST(0.0204531793),
+ COEF_CONST(0.0179433376), COEF_CONST(0.0155405551),
+ COEF_CONST(-0.0132718217), COEF_CONST(-0.0111315548),
+ COEF_CONST(-0.0091325333), COEF_CONST(-0.0072615817),
+ COEF_CONST(-0.0055337213), COEF_CONST(-0.0039401124),
+ COEF_CONST(-0.0024826722), COEF_CONST(-0.0011568135),
+ COEF_CONST(0.0000276045), COEF_CONST(0.0010902329),
+ COEF_CONST(0.0020274175), COEF_CONST(0.0028446757),
+ COEF_CONST(0.0035401245), COEF_CONST(0.0041251644),
+ COEF_CONST(0.0046039531), COEF_CONST(0.0049839686),
+ COEF_CONST(0.0052715759), COEF_CONST(0.0054753781),
+ COEF_CONST(0.0055917129), COEF_CONST(0.0056389198),
+ COEF_CONST(0.0056220642), COEF_CONST(0.0055475715),
+ COEF_CONST(0.0054196776), COEF_CONST(0.0052461168),
+ COEF_CONST(0.0050393022), COEF_CONST(0.0047932561),
+ COEF_CONST(0.0045209853), COEF_CONST(0.0042264271),
+ COEF_CONST(0.0039207432), COEF_CONST(0.0036008267),
+ COEF_CONST(0.0032739614), COEF_CONST(0.0029469447),
+ COEF_CONST(0.0026201757), COEF_CONST(0.0023017253),
+ COEF_CONST(0.0019841141), COEF_CONST(0.0016868083),
+ COEF_CONST(0.0013902494), COEF_CONST(0.0011250156),
+ COEF_CONST(0.0008608443), COEF_CONST(0.0006239376),
+ COEF_CONST(0.0004026540), COEF_CONST(0.0002043017),
+ COEF_CONST(0.0000134949), COEF_CONST(-0.0001446380),
+ COEF_CONST(-0.0002896981), COEF_CONST(-0.0004095121),
+ COEF_CONST(-0.0005145572), COEF_CONST(-0.0005946118),
+ COEF_CONST(-0.0006650415), COEF_CONST(-0.0007215391),
+ COEF_CONST(-0.0007530001), COEF_CONST(-0.0007757977),
+ COEF_CONST(-0.0007803664), COEF_CONST(-0.0007834332),
+ COEF_CONST(-0.0007681371), COEF_CONST(-0.0007440941),
+ COEF_CONST(-0.0007157736), COEF_CONST(-0.0006777690),
+ COEF_CONST(-0.0006312493), COEF_CONST(-0.0005870930),
+ COEF_CONST(-0.0005466565), COEF_CONST(-0.0005040714),
+ COEF_CONST(-0.0004875227), COEF_CONST(-0.0005617692)
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
--- /dev/null
+++ b/libfaad/sbr_syntax.c
@@ -1,0 +1,817 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_syntax.c,v 1.7 2003/07/29 08:20:13 menno Exp $
+**/
+
+#include "common.h"
+#include "structs.h"
+
+#ifdef SBR_DEC
+
+#include "sbr_syntax.h"
+#include "syntax.h"
+#include "sbr_huff.h"
+#include "sbr_fbt.h"
+#include "sbr_tf_grid.h"
+#include "sbr_e_nf.h"
+#include "bits.h"
+#include "analysis.h"
+
+static void sbr_reset(sbr_info *sbr)
+{
+ /* if these are different from the previous frame: Reset = 1 */
+ if ((sbr->bs_start_freq != sbr->bs_start_freq_prev) ||
+ (sbr->bs_stop_freq != sbr->bs_stop_freq_prev) ||
+ (sbr->bs_freq_scale != sbr->bs_freq_scale_prev) ||
+ (sbr->bs_alter_scale != sbr->bs_alter_scale_prev))
+ {
+ sbr->Reset = 1;
+ } else {
+ sbr->Reset = 0;
+ }
+
+ if ((sbr->bs_start_freq != sbr->bs_start_freq_prev) ||
+ (sbr->bs_stop_freq != sbr->bs_stop_freq_prev) ||
+ (sbr->bs_freq_scale != sbr->bs_freq_scale_prev) ||
+ (sbr->bs_alter_scale != sbr->bs_alter_scale_prev) ||
+ (sbr->bs_xover_band != sbr->bs_xover_band_prev) ||
+ (sbr->bs_noise_bands != sbr->bs_noise_bands_prev))
+ {
+ sbr->Reset = 1;
+ } else {
+ sbr->Reset = 0;
+ }
+
+ sbr->bs_start_freq_prev = sbr->bs_start_freq;
+ sbr->bs_stop_freq_prev = sbr->bs_stop_freq;
+ sbr->bs_freq_scale_prev = sbr->bs_freq_scale;
+ sbr->bs_alter_scale_prev = sbr->bs_alter_scale;
+ sbr->bs_xover_band_prev = sbr->bs_xover_band;
+ sbr->bs_noise_bands_prev = sbr->bs_noise_bands;
+
+ if (sbr->frame == 0)
+ {
+ sbr->Reset = 1;
+ }
+}
+
+/* table 2 */
+uint8_t sbr_extension_data(bitfile *ld, sbr_info *sbr, uint8_t id_aac)
+{
+ uint8_t bs_extension_type = (uint8_t)faad_getbits(ld, 4
+ DEBUGVAR(1,198,"sbr_bitstream(): bs_extension_type"));
+
+ if (bs_extension_type == EXT_SBR_DATA_CRC)
+ {
+ sbr->bs_sbr_crc_bits = (uint16_t)faad_getbits(ld, 10
+ DEBUGVAR(1,199,"sbr_bitstream(): bs_sbr_crc_bits"));
+ }
+
+ sbr->bs_header_flag = faad_get1bit(ld
+ DEBUGVAR(1,200,"sbr_bitstream(): bs_header_flag"));
+ if (sbr->bs_header_flag)
+ sbr_header(ld, sbr, id_aac);
+
+ /* TODO: Reset? */
+ sbr_reset(sbr);
+
+ /* first frame should have a header */
+ if (sbr->frame == 0 && sbr->bs_header_flag == 0)
+ return 1;
+
+
+ if (sbr->Reset || (sbr->bs_header_flag && sbr->just_seeked))
+ {
+ uint16_t k2;
+
+ /* calculate the Master Frequency Table */
+ sbr->k0 = qmf_start_channel(sbr->bs_start_freq, sbr->bs_samplerate_mode,
+ sbr->sample_rate);
+ k2 = qmf_stop_channel(sbr->bs_stop_freq, sbr->sample_rate, sbr->k0);
+
+ /* check k0 and k2 */
+ if (sbr->sample_rate >= 48000)
+ {
+ if ((k2 - sbr->k0) > 32)
+ return 1;
+ } else if (sbr->sample_rate <= 32000) {
+ if ((k2 - sbr->k0) > 48)
+ return 1;
+ } else { /* (sbr->sample_rate == 44100) */
+ if ((k2 - sbr->k0) > 45)
+ return 1;
+ }
+
+ if (sbr->bs_freq_scale == 0)
+ {
+ master_frequency_table_fs0(sbr, sbr->k0, k2, sbr->bs_alter_scale);
+ } else {
+ master_frequency_table(sbr, sbr->k0, k2, sbr->bs_freq_scale,
+ sbr->bs_alter_scale);
+ }
+ derived_frequency_table(sbr, sbr->bs_xover_band, k2);
+ }
+
+ sbr_data(ld, sbr, id_aac);
+
+ /* no error */
+ return 0;
+}
+
+/* table 3 */
+static void sbr_header(bitfile *ld, sbr_info *sbr, uint8_t id_aac)
+{
+ uint8_t bs_header_extra_1, bs_header_extra_2;
+
+ sbr->header_count++;
+
+ sbr->bs_amp_res = faad_get1bit(ld
+ DEBUGVAR(1,203,"sbr_header(): bs_amp_res"));
+
+ /* bs_start_freq and bs_stop_freq must define a fequency band that does
+ not exceed 48 channels */
+ sbr->bs_start_freq = faad_getbits(ld, 4
+ DEBUGVAR(1,204,"sbr_header(): bs_start_freq"));
+ sbr->bs_stop_freq = faad_getbits(ld, 4
+ DEBUGVAR(1,205,"sbr_header(): bs_stop_freq"));
+ sbr->bs_xover_band = faad_getbits(ld, 3
+ DEBUGVAR(1,206,"sbr_header(): bs_xover_band"));
+ faad_getbits(ld, 2
+ DEBUGVAR(1,207,"sbr_header(): bs_reserved_bits_hdr"));
+ bs_header_extra_1 = faad_get1bit(ld
+ DEBUGVAR(1,208,"sbr_header(): bs_header_extra_1"));
+ bs_header_extra_2 = faad_get1bit(ld
+ DEBUGVAR(1,209,"sbr_header(): bs_header_extra_2"));
+
+ if (bs_header_extra_1)
+ {
+ sbr->bs_freq_scale = faad_getbits(ld, 2
+ DEBUGVAR(1,211,"sbr_header(): bs_freq_scale"));
+ sbr->bs_alter_scale = faad_get1bit(ld
+ DEBUGVAR(1,212,"sbr_header(): bs_alter_scale"));
+ sbr->bs_noise_bands = faad_getbits(ld, 2
+ DEBUGVAR(1,213,"sbr_header(): bs_noise_bands"));
+ }
+ if (bs_header_extra_2)
+ {
+ sbr->bs_limiter_bands = faad_getbits(ld, 2
+ DEBUGVAR(1,214,"sbr_header(): bs_limiter_bands"));
+ sbr->bs_limiter_gains = faad_getbits(ld, 2
+ DEBUGVAR(1,215,"sbr_header(): bs_limiter_gains"));
+ sbr->bs_interpol_freq = faad_get1bit(ld
+ DEBUGVAR(1,216,"sbr_header(): bs_interpol_freq"));
+ sbr->bs_smoothing_mode = faad_get1bit(ld
+ DEBUGVAR(1,217,"sbr_header(): bs_smoothing_mode"));
+ }
+
+#if 0
+ /* print the header to screen */
+ printf("bs_amp_res: %d\n", sbr->bs_amp_res);
+ printf("bs_start_freq: %d\n", sbr->bs_start_freq);
+ printf("bs_stop_freq: %d\n", sbr->bs_stop_freq);
+ printf("bs_xover_band: %d\n", sbr->bs_xover_band);
+ if (bs_header_extra_1)
+ {
+ printf("bs_freq_scale: %d\n", sbr->bs_freq_scale);
+ printf("bs_alter_scale: %d\n", sbr->bs_alter_scale);
+ printf("bs_noise_bands: %d\n", sbr->bs_noise_bands);
+ }
+ if (bs_header_extra_2)
+ {
+ printf("bs_limiter_bands: %d\n", sbr->bs_limiter_bands);
+ printf("bs_limiter_gains: %d\n", sbr->bs_limiter_gains);
+ printf("bs_interpol_freq: %d\n", sbr->bs_interpol_freq);
+ printf("bs_smoothing_mode: %d\n", sbr->bs_smoothing_mode);
+ }
+ printf("\n");
+#endif
+}
+
+/* table 4 */
+static void sbr_data(bitfile *ld, sbr_info *sbr, uint8_t id_aac)
+{
+#if 0
+ sbr->bs_samplerate_mode = faad_get1bit(ld
+ DEBUGVAR(1,219,"sbr_data(): bs_samplerate_mode"));
+#endif
+
+ sbr->rate = (sbr->bs_samplerate_mode) ? 2 : 1;
+
+ switch (id_aac)
+ {
+ case ID_SCE:
+ sbr_single_channel_element(ld, sbr);
+ break;
+ case ID_CPE:
+ sbr_channel_pair_element(ld, sbr);
+ break;
+ }
+}
+
+/* table 5 */
+static void sbr_single_channel_element(bitfile *ld, sbr_info *sbr)
+{
+ if (faad_get1bit(ld
+ DEBUGVAR(1,220,"sbr_single_channel_element(): bs_data_extra")))
+ {
+ faad_getbits(ld, 4
+ DEBUGVAR(1,221,"sbr_single_channel_element(): bs_reserved_bits_data"));
+ }
+
+ sbr_grid(ld, sbr, 0);
+ sbr_dtdf(ld, sbr, 0);
+ invf_mode(ld, sbr, 0);
+ sbr_envelope(ld, sbr, 0);
+ sbr_noise(ld, sbr, 0);
+
+ envelope_noise_dequantisation(sbr, 0);
+
+#if 0
+// TEMP
+ if (sbr->frame == 21)
+ {
+ int l, k;
+
+ printf("\n");
+ for (l = 0; l < sbr->L_E[0]; l++)
+ {
+ for (k = 0; k < sbr->n[sbr->f[0][l]]; k++)
+ {
+ //printf("%f\n", sbr->E_orig[0][k][l]);
+ printf("%f\n", sbr->E_orig[0][k][l] * 1024. / (float)(1 << REAL_BITS));
+ }
+ }
+ }
+// end TEMP
+#endif
+
+#if 0
+// TEMP
+ {
+ int l, k;
+
+ printf("\n");
+ for (l = 0; l < sbr->L_Q[0]; l++)
+ {
+ for (k = 0; k < sbr->N_Q; k++)
+ {
+ printf("%f\n", sbr->Q_orig[0][k][l]);
+ }
+ }
+ }
+// end TEMP
+#endif
+
+ memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
+
+ sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
+ DEBUGVAR(1,223,"sbr_single_channel_element(): bs_add_harmonic_flag[0]"));
+ if (sbr->bs_add_harmonic_flag[0])
+ sinusoidal_coding(ld, sbr, 0);
+
+ sbr->bs_extended_data = faad_get1bit(ld
+ DEBUGVAR(1,224,"sbr_single_channel_element(): bs_extended_data[0]"));
+ if (sbr->bs_extended_data)
+ {
+ uint16_t nr_bits_left;
+ uint16_t cnt = faad_getbits(ld, 4
+ DEBUGVAR(1,225,"sbr_single_channel_element(): bs_extension_size"));
+ if (cnt == 15)
+ {
+ cnt += faad_getbits(ld, 8
+ DEBUGVAR(1,226,"sbr_single_channel_element(): bs_esc_count"));
+ }
+
+ nr_bits_left = 8 * cnt;
+ while (nr_bits_left > 7)
+ {
+ sbr->bs_extension_id = faad_getbits(ld, 2
+ DEBUGVAR(1,227,"sbr_single_channel_element(): bs_extension_id"));
+ nr_bits_left -= 2;
+ /* sbr_extension(ld, sbr, 0, nr_bits_left); */
+ sbr->bs_extension_data = faad_getbits(ld, 6
+ DEBUGVAR(1,279,"sbr_single_channel_element(): bs_extension_data"));
+ }
+ }
+}
+
+/* table 6 */
+static void sbr_channel_pair_element(bitfile *ld, sbr_info *sbr)
+{
+ uint8_t n;
+
+ if (faad_get1bit(ld
+ DEBUGVAR(1,228,"sbr_single_channel_element(): bs_data_extra")))
+ {
+ faad_getbits(ld, 4
+ DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_reserved_bits_data"));
+ faad_getbits(ld, 4
+ DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_reserved_bits_data"));
+ }
+
+ sbr->bs_coupling = faad_get1bit(ld
+ DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_coupling"));
+
+ if (sbr->bs_coupling)
+ {
+ sbr_grid(ld, sbr, 0);
+
+ /* need to copy some data from left to right */
+ sbr->bs_frame_class[1] = sbr->bs_frame_class[0];
+ sbr->L_E[1] = sbr->L_E[0];
+ sbr->L_Q[1] = sbr->L_Q[0];
+ sbr->bs_pointer[1] = sbr->bs_pointer[0];
+
+ for (n = 0; n <= sbr->L_E[0]; n++)
+ {
+ sbr->t_E[1][n] = sbr->t_E[0][n];
+ sbr->f[1][n] = sbr->f[0][n];
+ }
+ for (n = 0; n <= sbr->L_Q[0]; n++)
+ sbr->t_Q[1][n] = sbr->t_Q[0][n];
+
+ sbr_dtdf(ld, sbr, 0);
+ sbr_dtdf(ld, sbr, 1);
+ invf_mode(ld, sbr, 0);
+
+ /* more copying */
+ for (n = 0; n < sbr->N_Q; n++)
+ sbr->bs_invf_mode[1][n] = sbr->bs_invf_mode[0][n];
+
+ sbr_envelope(ld, sbr, 0);
+ sbr_noise(ld, sbr, 0);
+ sbr_envelope(ld, sbr, 1);
+ sbr_noise(ld, sbr, 1);
+
+ memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
+ memset(sbr->bs_add_harmonic[1], 0, 64*sizeof(uint8_t));
+
+ sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
+ DEBUGVAR(1,231,"sbr_channel_pair_element(): bs_add_harmonic_flag[0]"));
+ if (sbr->bs_add_harmonic_flag[0])
+ sinusoidal_coding(ld, sbr, 0);
+
+ sbr->bs_add_harmonic_flag[1] = faad_get1bit(ld
+ DEBUGVAR(1,232,"sbr_channel_pair_element(): bs_add_harmonic_flag[1]"));
+ if (sbr->bs_add_harmonic_flag[1])
+ sinusoidal_coding(ld, sbr, 1);
+ } else {
+ sbr_grid(ld, sbr, 0);
+ sbr_grid(ld, sbr, 1);
+ sbr_dtdf(ld, sbr, 0);
+ sbr_dtdf(ld, sbr, 1);
+ invf_mode(ld, sbr, 0);
+ invf_mode(ld, sbr, 1);
+ sbr_envelope(ld, sbr, 0);
+ sbr_envelope(ld, sbr, 1);
+ sbr_noise(ld, sbr, 0);
+ sbr_noise(ld, sbr, 1);
+
+ memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
+ memset(sbr->bs_add_harmonic[1], 0, 64*sizeof(uint8_t));
+
+ sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
+ DEBUGVAR(1,239,"sbr_channel_pair_element(): bs_add_harmonic_flag[0]"));
+ if (sbr->bs_add_harmonic_flag[0])
+ sinusoidal_coding(ld, sbr, 0);
+
+ sbr->bs_add_harmonic_flag[1] = faad_get1bit(ld
+ DEBUGVAR(1,240,"sbr_channel_pair_element(): bs_add_harmonic_flag[1]"));
+ if (sbr->bs_add_harmonic_flag[1])
+ sinusoidal_coding(ld, sbr, 1);
+ }
+ envelope_noise_dequantisation(sbr, 0);
+ envelope_noise_dequantisation(sbr, 1);
+
+#if 0
+// TEMP
+ if (sbr->frame == 21)
+ {
+ int l, k;
+
+ printf("\n");
+ for (l = 0; l < sbr->L_E[0]; l++)
+ {
+ for (k = 0; k < sbr->n[sbr->f[0][l]]; k++)
+ {
+ printf("%f\n", sbr->E_orig[0][k][l]);
+ //printf("%f\n", sbr->E_orig[0][k][l] * 1024. / (float)(1 << REAL_BITS));
+ }
+ }
+ }
+// end TEMP
+#endif
+
+ if (sbr->bs_coupling)
+ unmap_envelope_noise(sbr);
+
+#if 0
+// TEMP
+ if (sbr->bs_coupling)
+ {
+ int l, k;
+
+ printf("\n");
+ for (l = 0; l < sbr->L_Q[0]; l++)
+ {
+ for (k = 0; k < sbr->N_Q; k++)
+ {
+ printf("%f\n", sbr->Q_orig[0][k][l]);
+ }
+ }
+ }
+// end TEMP
+#endif
+
+ sbr->bs_extended_data = faad_get1bit(ld
+ DEBUGVAR(1,233,"sbr_channel_pair_element(): bs_extended_data[0]"));
+ if (sbr->bs_extended_data)
+ {
+ uint16_t nr_bits_left;
+ uint16_t cnt = faad_getbits(ld, 4
+ DEBUGVAR(1,234,"sbr_channel_pair_element(): bs_extension_size"));
+ if (cnt == 15)
+ {
+ cnt += faad_getbits(ld, 8
+ DEBUGVAR(1,235,"sbr_channel_pair_element(): bs_esc_count"));
+ }
+
+ nr_bits_left = 8 * cnt;
+ while (nr_bits_left > 7)
+ {
+ sbr->bs_extension_id = faad_getbits(ld, 2
+ DEBUGVAR(1,236,"sbr_channel_pair_element(): bs_extension_id"));
+ nr_bits_left -= 2;
+ /* sbr_extension(ld, sbr, 0, nr_bits_left); */
+ sbr->bs_extension_data = faad_getbits(ld, 6
+ DEBUGVAR(1,280,"sbr_single_channel_element(): bs_extension_data"));
+ }
+ }
+}
+
+/* table 7 */
+static void sbr_grid(bitfile *ld, sbr_info *sbr, uint8_t ch)
+{
+ uint8_t i, env, rel;
+ uint8_t bs_abs_bord, bs_abs_bord_1;
+ uint16_t bs_num_env;
+
+ sbr->bs_frame_class[ch] = faad_getbits(ld, 2
+ DEBUGVAR(1,248,"sbr_grid(): bs_frame_class"));
+
+#if 0
+ if (sbr->bs_frame_class[ch] != FIXFIX)
+ printf("%d", sbr->bs_frame_class[ch]);
+#endif
+
+ switch (sbr->bs_frame_class[ch])
+ {
+ case FIXFIX:
+ i = faad_getbits(ld, 2
+ DEBUGVAR(1,249,"sbr_grid(): bs_num_env_raw"));
+
+ bs_num_env = min(1 << i, 5);
+
+ i = faad_get1bit(ld
+ DEBUGVAR(1,250,"sbr_grid(): bs_freq_res_flag"));
+ for (env = 0; env < bs_num_env; env++)
+ sbr->f[ch][env] = i;
+
+ sbr->abs_bord_lead[ch] = 0;
+ sbr->abs_bord_trail[ch] = NO_TIME_SLOTS;
+ sbr->n_rel_lead[ch] = bs_num_env - 1;
+ sbr->n_rel_trail[ch] = 0;
+ break;
+
+ case FIXVAR:
+ bs_abs_bord = faad_getbits(ld, 2
+ DEBUGVAR(1,251,"sbr_grid(): bs_abs_bord")) + NO_TIME_SLOTS;
+ bs_num_env = faad_getbits(ld, 2
+ DEBUGVAR(1,252,"sbr_grid(): bs_num_env")) + 1;
+
+ for (rel = 0; rel < bs_num_env-1; rel++)
+ {
+ sbr->bs_rel_bord[ch][rel] = 2 * faad_getbits(ld, 2
+ DEBUGVAR(1,253,"sbr_grid(): bs_rel_bord")) + 2;
+ }
+ i = int_log2((int32_t)(bs_num_env + 1));
+ sbr->bs_pointer[ch] = faad_getbits(ld, i
+ DEBUGVAR(1,254,"sbr_grid(): bs_pointer"));
+
+ for (env = 0; env < bs_num_env; env++)
+ {
+ sbr->f[ch][bs_num_env - env - 1] = faad_get1bit(ld
+ DEBUGVAR(1,255,"sbr_grid(): bs_freq_res"));
+ }
+
+ sbr->abs_bord_lead[ch] = 0;
+ sbr->abs_bord_trail[ch] = bs_abs_bord;
+ sbr->n_rel_lead[ch] = 0;
+ sbr->n_rel_trail[ch] = bs_num_env - 1;
+ break;
+
+ case VARFIX:
+ bs_abs_bord = faad_getbits(ld, 2
+ DEBUGVAR(1,256,"sbr_grid(): bs_abs_bord"));
+ bs_num_env = faad_getbits(ld, 2
+ DEBUGVAR(1,257,"sbr_grid(): bs_num_env")) + 1;
+
+ for (rel = 0; rel < bs_num_env-1; rel++)
+ {
+ sbr->bs_rel_bord[ch][rel] = 2 * faad_getbits(ld, 2
+ DEBUGVAR(1,258,"sbr_grid(): bs_rel_bord")) + 2;
+ }
+ i = int_log2((int32_t)(bs_num_env + 1));
+ sbr->bs_pointer[ch] = faad_getbits(ld, i
+ DEBUGVAR(1,259,"sbr_grid(): bs_pointer"));
+
+ for (env = 0; env < bs_num_env; env++)
+ {
+ sbr->f[ch][env] = faad_get1bit(ld
+ DEBUGVAR(1,260,"sbr_grid(): bs_freq_res"));
+ }
+
+ sbr->abs_bord_lead[ch] = bs_abs_bord;
+ sbr->abs_bord_trail[ch] = NO_TIME_SLOTS;
+ sbr->n_rel_lead[ch] = bs_num_env - 1;
+ sbr->n_rel_trail[ch] = 0;
+ break;
+
+ case VARVAR:
+ bs_abs_bord = faad_getbits(ld, 2
+ DEBUGVAR(1,261,"sbr_grid(): bs_abs_bord_0"));
+ bs_abs_bord_1 = faad_getbits(ld, 2
+ DEBUGVAR(1,262,"sbr_grid(): bs_abs_bord_1")) + NO_TIME_SLOTS;
+ sbr->bs_num_rel_0[ch] = faad_getbits(ld, 2
+ DEBUGVAR(1,263,"sbr_grid(): bs_num_rel_0"));
+ sbr->bs_num_rel_1[ch] = faad_getbits(ld, 2
+ DEBUGVAR(1,264,"sbr_grid(): bs_num_rel_1"));
+
+ bs_num_env = min(5, sbr->bs_num_rel_0[ch] + sbr->bs_num_rel_1[ch] + 1);
+
+ for (rel = 0; rel < sbr->bs_num_rel_0[ch]; rel++)
+ {
+ sbr->bs_rel_bord_0[ch][rel] = 2 * faad_getbits(ld, 2
+ DEBUGVAR(1,265,"sbr_grid(): bs_rel_bord")) + 2;
+ }
+ for(rel = 0; rel < sbr->bs_num_rel_1[ch]; rel++)
+ {
+ sbr->bs_rel_bord_1[ch][rel] = 2 * faad_getbits(ld, 2
+ DEBUGVAR(1,266,"sbr_grid(): bs_rel_bord")) + 2;
+ }
+ i = int_log2((int32_t)(sbr->bs_num_rel_0[ch] + sbr->bs_num_rel_1[ch] + 2));
+ sbr->bs_pointer[ch] = faad_getbits(ld, i
+ DEBUGVAR(1,267,"sbr_grid(): bs_pointer"));
+
+ for (env = 0; env < bs_num_env; env++)
+ {
+ sbr->f[ch][env] = faad_get1bit(ld
+ DEBUGVAR(1,268,"sbr_grid(): bs_freq_res"));
+ }
+
+ sbr->abs_bord_lead[ch] = bs_abs_bord;
+ sbr->abs_bord_trail[ch] = bs_abs_bord_1;
+ sbr->n_rel_lead[ch] = sbr->bs_num_rel_0[ch];
+ sbr->n_rel_trail[ch] = sbr->bs_num_rel_1[ch];
+ break;
+ }
+
+ if (sbr->bs_frame_class[ch] == VARVAR)
+ sbr->L_E[ch] = min(bs_num_env, 5);
+ else
+ sbr->L_E[ch] = min(bs_num_env, 4);
+
+ if (sbr->L_E[ch] > 1)
+ sbr->L_Q[ch] = 2;
+ else
+ sbr->L_Q[ch] = 1;
+
+ /* TODO: this code can probably be integrated into the code above! */
+ envelope_time_border_vector(sbr, ch);
+ noise_floor_time_border_vector(sbr, ch);
+}
+
+/* table 8 */
+static void sbr_dtdf(bitfile *ld, sbr_info *sbr, uint8_t ch)
+{
+ uint8_t i;
+
+ for (i = 0; i < sbr->L_E[ch]; i++)
+ {
+ sbr->bs_df_env[ch][i] = faad_get1bit(ld
+ DEBUGVAR(1,269,"sbr_dtdf(): bs_df_env"));
+ }
+
+ for (i = 0; i < sbr->L_Q[ch]; i++)
+ {
+ sbr->bs_df_noise[ch][i] = faad_get1bit(ld
+ DEBUGVAR(1,270,"sbr_dtdf(): bs_df_noise"));
+ }
+}
+
+/* table 9 */
+static void invf_mode(bitfile *ld, sbr_info *sbr, uint8_t ch)
+{
+ uint8_t n;
+
+ for (n = 0; n < sbr->N_Q; n++)
+ {
+ sbr->bs_invf_mode[ch][n] = faad_getbits(ld, 2
+ DEBUGVAR(1,271,"invf_mode(): bs_invf_mode"));
+ }
+}
+
+/* table 10 */
+static void sbr_envelope(bitfile *ld, sbr_info *sbr, uint8_t ch)
+{
+ uint8_t env, band;
+ int8_t delta = 0;
+ sbr_huff_tab t_huff, f_huff;
+
+ if ((sbr->L_E[ch] == 1) && (sbr->bs_frame_class[ch] == FIXFIX))
+ sbr->amp_res[ch] = 0;
+ else
+ sbr->amp_res[ch] = sbr->bs_amp_res;
+
+ if ((sbr->bs_coupling) && (ch == 1))
+ {
+ delta = 1;
+ if (sbr->amp_res[ch])
+ {
+ t_huff = t_huffman_env_bal_3_0dB;
+ f_huff = f_huffman_env_bal_3_0dB;
+ } else {
+ t_huff = t_huffman_env_bal_1_5dB;
+ f_huff = f_huffman_env_bal_1_5dB;
+ }
+ } else {
+ delta = 0;
+ if (sbr->amp_res[ch])
+ {
+ t_huff = t_huffman_env_3_0dB;
+ f_huff = f_huffman_env_3_0dB;
+ } else {
+ t_huff = t_huffman_env_1_5dB;
+ f_huff = f_huffman_env_1_5dB;
+ }
+ }
+
+ for (env = 0; env < sbr->L_E[ch]; env++)
+ {
+ if (sbr->bs_df_env[ch][env] == 0)
+ {
+ if ((sbr->bs_coupling == 1) && (ch == 1))
+ {
+ if (sbr->amp_res[ch])
+ {
+ sbr->E[ch][0][env] = (faad_getbits(ld, 5
+ DEBUGVAR(1,272,"sbr_envelope(): bs_data_env")) << delta);
+ } else {
+ sbr->E[ch][0][env] = (faad_getbits(ld, 6
+ DEBUGVAR(1,273,"sbr_envelope(): bs_data_env")) << delta);
+ }
+ } else {
+ if (sbr->amp_res[ch])
+ {
+ sbr->E[ch][0][env] = (faad_getbits(ld, 6
+ DEBUGVAR(1,274,"sbr_envelope(): bs_data_env")) << delta);
+ } else {
+ sbr->E[ch][0][env] = (faad_getbits(ld, 7
+ DEBUGVAR(1,275,"sbr_envelope(): bs_data_env")) << delta);
+ }
+ }
+
+ for (band = 1; band < sbr->n[sbr->f[ch][env]]; band++)
+ {
+ sbr->E[ch][band][env] = (sbr_huff_dec(ld, f_huff) << delta);
+ }
+
+ } else {
+ for (band = 0; band < sbr->n[sbr->f[ch][env]]; band++)
+ {
+ sbr->E[ch][band][env] = (sbr_huff_dec(ld, t_huff) << delta);
+ }
+ }
+ }
+
+#if 0
+// TEMP
+ if (sbr->frame == 19)
+ {
+ int l, k;
+
+ printf("\n");
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
+ {
+ printf("l:%d k:%d E:%d\n",l, k, sbr->E[ch][k][l]);
+ }
+ }
+ }
+// end TEMP
+#endif
+
+ extract_envelope_data(sbr, ch);
+
+#if 0
+// TEMP
+ if (sbr->frame == 21)
+ {
+ int l, k;
+
+ printf("\n");
+ for (l = 0; l < sbr->L_E[ch]; l++)
+ {
+ for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
+ {
+ //printf("l:%d k:%d E:%d\n",l,k, sbr->E[ch][k][l]);
+ printf("%d\n", sbr->E[ch][k][l]);
+ }
+ }
+ }
+// end TEMP
+#endif
+}
+
+/* table 11 */
+static void sbr_noise(bitfile *ld, sbr_info *sbr, uint8_t ch)
+{
+ uint8_t noise, band;
+ int8_t delta = 0;
+ sbr_huff_tab t_huff, f_huff;
+
+ if ((sbr->bs_coupling == 1) && (ch == 1))
+ {
+ delta = 1;
+ t_huff = t_huffman_noise_bal_3_0dB;
+ f_huff = f_huffman_env_bal_3_0dB;
+ } else {
+ delta = 0;
+ t_huff = t_huffman_noise_3_0dB;
+ f_huff = f_huffman_env_3_0dB;
+ }
+
+ for (noise = 0; noise < sbr->L_Q[ch]; noise++)
+ {
+ if(sbr->bs_df_noise[ch][noise] == 0)
+ {
+ if ((sbr->bs_coupling == 1) && (ch == 1))
+ {
+ sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
+ DEBUGVAR(1,276,"sbr_noise(): bs_data_noise")) << delta);
+ } else {
+ sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
+ DEBUGVAR(1,277,"sbr_noise(): bs_data_noise")) << delta);
+ }
+ for (band = 1; band < sbr->N_Q; band++)
+ {
+ sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, f_huff) << delta);
+ }
+ } else {
+ for (band = 0; band < sbr->N_Q; band++)
+ {
+ sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, t_huff) << delta);
+ }
+ }
+ }
+
+ extract_noise_floor_data(sbr, ch);
+}
+
+/* table 12 */
+static void sinusoidal_coding(bitfile *ld, sbr_info *sbr, uint8_t ch)
+{
+ uint8_t n;
+
+ for (n = 0; n < sbr->N_high; n++)
+ {
+ sbr->bs_add_harmonic[ch][n] = faad_get1bit(ld
+ DEBUGVAR(1,278,"sinusoidal_coding(): bs_add_harmonic"));
+ }
+}
+
+
+#endif /* SBR_DEC */
\ No newline at end of file
--- /dev/null
+++ b/libfaad/sbr_syntax.h
@@ -1,0 +1,71 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_syntax.h,v 1.6 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_SYNTAX_H__
+#define __SBR_SYNTAX_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "bits.h"
+
+#define tHFGen 8
+#define tHFAdj 2
+
+#define EXT_SBR_DATA 13
+#define EXT_SBR_DATA_CRC 14
+
+#define FIXFIX 0
+#define FIXVAR 1
+#define VARFIX 2
+#define VARVAR 3
+
+#define LO_RES 0
+#define HI_RES 1
+
+#define NO_TIME_SLOTS 16
+#define NOISE_FLOOR_OFFSET 6.0
+
+
+uint8_t sbr_extension_data(bitfile *ld, sbr_info *sbr, uint8_t id_aac);
+static void sbr_header(bitfile *ld, sbr_info *sbr, uint8_t id_aac);
+static void sbr_data(bitfile *ld, sbr_info *sbr, uint8_t id_aac);
+static void sbr_single_channel_element(bitfile *ld, sbr_info *sbr);
+static void sbr_channel_pair_element(bitfile *ld, sbr_info *sbr);
+static void sbr_grid(bitfile *ld, sbr_info *sbr, uint8_t ch);
+static void sbr_dtdf(bitfile *ld, sbr_info *sbr, uint8_t ch);
+static void invf_mode(bitfile *ld, sbr_info *sbr, uint8_t ch);
+static void sbr_envelope(bitfile *ld, sbr_info *sbr, uint8_t ch);
+static void sbr_noise(bitfile *ld, sbr_info *sbr, uint8_t ch);
+static void sinusoidal_coding(bitfile *ld, sbr_info *sbr, uint8_t ch);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __SBR_SYNTAX_H__ */
+
--- /dev/null
+++ b/libfaad/sbr_tf_grid.c
@@ -1,0 +1,226 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_tf_grid.c,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+/* Time/Frequency grid */
+
+#include "common.h"
+#include "structs.h"
+
+#ifdef SBR_DEC
+
+#include <stdlib.h>
+
+#include "sbr_syntax.h"
+#include "sbr_tf_grid.h"
+
+void envelope_time_border_vector(sbr_info *sbr, uint8_t ch)
+{
+ uint8_t l, border;
+
+ for (l = 0; l <= sbr->L_E[ch]; l++)
+ {
+ sbr->t_E[ch][l] = 0;
+ }
+
+ sbr->t_E[ch][0] = sbr->rate * sbr->abs_bord_lead[ch];
+ sbr->t_E[ch][sbr->L_E[ch]] = sbr->rate * sbr->abs_bord_trail[ch];
+
+ switch (sbr->bs_frame_class[ch])
+ {
+ case FIXFIX:
+ switch (sbr->L_E[ch])
+ {
+ case 4:
+ sbr->t_E[ch][3] = sbr->rate * 12;
+ sbr->t_E[ch][2] = sbr->rate * 8;
+ sbr->t_E[ch][1] = sbr->rate * 4;
+ break;
+ case 2:
+ sbr->t_E[ch][1] = sbr->rate * 8;
+ break;
+ default:
+ break;
+ }
+ break;
+
+ case FIXVAR:
+ if (sbr->L_E[ch] > 1)
+ {
+ int8_t i = sbr->L_E[ch];
+ border = sbr->abs_bord_trail[ch];
+
+ for (l = 0; l < (sbr->L_E[ch] - 1); l++)
+ {
+ border -= sbr->bs_rel_bord[ch][l];
+ sbr->t_E[ch][--i] = sbr->rate * border;
+ }
+ }
+ break;
+
+ case VARFIX:
+ if (sbr->L_E[ch] > 1)
+ {
+ int8_t i = 1;
+ border = sbr->abs_bord_lead[ch];
+
+ for (l = 0; l < (sbr->L_E[ch] - 1); l++)
+ {
+ border += sbr->bs_rel_bord[ch][l];
+ sbr->t_E[ch][i++] = sbr->rate * border;
+ }
+ }
+ break;
+
+ case VARVAR:
+ if (sbr->bs_num_rel_0[ch])
+ {
+ int8_t i = 1;
+ border = sbr->abs_bord_lead[ch];
+
+ for (l = 0; l < sbr->bs_num_rel_0[ch]; l++)
+ {
+ border += sbr->bs_rel_bord_0[ch][l];
+ sbr->t_E[ch][i++] = sbr->rate * border;
+ }
+ }
+
+ if (sbr->bs_num_rel_1[ch])
+ {
+ int8_t i = sbr->L_E[ch];
+ border = sbr->abs_bord_trail[ch];
+
+ for (l = 0; l < sbr->bs_num_rel_1[ch]; l++)
+ {
+ border -= sbr->bs_rel_bord_1[ch][l];
+ sbr->t_E[ch][--i] = sbr->rate * border;
+ }
+ }
+ break;
+ }
+}
+
+void noise_floor_time_border_vector(sbr_info *sbr, uint8_t ch)
+{
+ sbr->t_Q[ch][0] = sbr->t_E[ch][0];
+
+ if (sbr->L_E[ch] == 1)
+ {
+ sbr->t_Q[ch][1] = sbr->t_E[ch][1];
+ sbr->t_Q[ch][2] = 0;
+ } else {
+ uint8_t index = middleBorder(sbr, ch);
+ sbr->t_Q[ch][1] = sbr->t_E[ch][index];
+ sbr->t_Q[ch][2] = sbr->t_E[ch][sbr->L_E[ch]];
+ }
+}
+
+static int16_t rel_bord_lead(sbr_info *sbr, uint8_t ch, uint8_t l)
+{
+ uint8_t i;
+ int16_t acc = 0;
+
+ switch (sbr->bs_frame_class[ch])
+ {
+ case FIXFIX:
+ return NO_TIME_SLOTS/sbr->L_E[ch];
+ case FIXVAR:
+ return 0;
+ case VARFIX:
+ for (i = 0; i < l; i++)
+ {
+ acc += sbr->bs_rel_bord[ch][i];
+ }
+ return acc;
+ case VARVAR:
+ for (i = 0; i < l; i++)
+ {
+ acc += sbr->bs_rel_bord_0[ch][i];
+ }
+ return acc;
+ }
+
+ return 0;
+}
+
+static int16_t rel_bord_trail(sbr_info *sbr, uint8_t ch, uint8_t l)
+{
+ uint8_t i;
+ int16_t acc = 0;
+
+ switch (sbr->bs_frame_class[ch])
+ {
+ case FIXFIX:
+ case VARFIX:
+ return 0;
+ case FIXVAR:
+ for (i = 0; i < l; i++)
+ {
+ acc += sbr->bs_rel_bord[ch][i];
+ }
+ return acc;
+ case VARVAR:
+ for (i = 0; i < l; i++)
+ {
+ acc += sbr->bs_rel_bord_1[ch][i];
+ }
+ return acc;
+ }
+
+ return 0;
+}
+
+static uint8_t middleBorder(sbr_info *sbr, uint8_t ch)
+{
+ int8_t retval;
+
+ switch (sbr->bs_frame_class[ch])
+ {
+ case FIXFIX:
+ retval = sbr->L_E[ch]/2;
+ break;
+ case VARFIX:
+ if (sbr->bs_pointer[ch] == 0)
+ retval = 1;
+ else if (sbr->bs_pointer[ch] == 1)
+ retval = sbr->L_E[ch] - 1;
+ else
+ retval = sbr->bs_pointer[ch] - 1;
+ break;
+ case FIXVAR:
+ case VARVAR:
+ if (sbr->bs_pointer[ch] > 1)
+ retval = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
+ else
+ retval = sbr->L_E[ch] - 1;
+ break;
+ }
+
+ return (retval > 0) ? retval : 0;
+}
+
+
+#endif
--- /dev/null
+++ b/libfaad/sbr_tf_grid.h
@@ -1,0 +1,48 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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: sbr_tf_grid.h,v 1.1 2003/07/29 08:20:13 menno Exp $
+**/
+
+#ifndef __SBR_TF_GRID_H__
+#define __SBR_TF_GRID_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void envelope_time_border_vector(sbr_info *sbr, uint8_t ch);
+void noise_floor_time_border_vector(sbr_info *sbr, uint8_t ch);
+
+static int16_t rel_bord_lead(sbr_info *sbr, uint8_t ch, uint8_t l);
+static int16_t rel_bord_trail(sbr_info *sbr, uint8_t ch, uint8_t l);
+static uint8_t middleBorder(sbr_info *sbr, uint8_t ch);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
--- a/libfaad/sine_win.h
+++ b/libfaad/sine_win.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: sine_win.h,v 1.1 2002/09/08 18:14:37 menno Exp $
+** 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: sine_win.h,v 1.2 2003/07/29 08:20:13 menno Exp $
**/
#ifndef __SINE_WIN_H__
--- a/libfaad/specrec.c
+++ b/libfaad/specrec.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: specrec.c,v 1.22 2003/06/23 15:21:20 menno Exp $
+** 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: specrec.c,v 1.23 2003/07/29 08:20:13 menno Exp $
**/
/*
--- a/libfaad/specrec.h
+++ b/libfaad/specrec.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: specrec.h,v 1.12 2003/06/23 15:21:20 menno Exp $
+** 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: specrec.h,v 1.13 2003/07/29 08:20:14 menno Exp $
**/
#ifndef __SPECREC_H__
--- a/libfaad/ssr.c
+++ b/libfaad/ssr.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ssr.c,v 1.3 2002/12/10 14:53:15 menno Exp $
+** 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: ssr.c,v 1.4 2003/07/29 08:20:14 menno Exp $
**/
#include "common.h"
--- a/libfaad/ssr.h
+++ b/libfaad/ssr.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ssr.h,v 1.3 2002/12/10 14:53:15 menno Exp $
+** 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: ssr.h,v 1.4 2003/07/29 08:20:14 menno Exp $
**/
#ifndef __SSR_H__
--- a/libfaad/ssr_fb.c
+++ b/libfaad/ssr_fb.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ssr_fb.c,v 1.1 2002/11/28 18:48:30 menno Exp $
+** 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: ssr_fb.c,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
#include "common.h"
--- a/libfaad/ssr_fb.h
+++ b/libfaad/ssr_fb.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ssr_fb.h,v 1.1 2002/11/28 18:48:30 menno Exp $
+** 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: ssr_fb.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
#ifndef __SSR_FB_H__
--- a/libfaad/ssr_ipqf.c
+++ b/libfaad/ssr_ipqf.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ssr_ipqf.c,v 1.2 2002/12/10 14:53:15 menno Exp $
+** 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: ssr_ipqf.c,v 1.3 2003/07/29 08:20:14 menno Exp $
**/
#include "common.h"
--- a/libfaad/ssr_ipqf.h
+++ b/libfaad/ssr_ipqf.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ssr_ipqf.h,v 1.2 2002/12/10 14:53:15 menno Exp $
+** 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: ssr_ipqf.h,v 1.3 2003/07/29 08:20:14 menno Exp $
**/
#ifndef __SSR_IPQF_H__
--- a/libfaad/ssr_win.h
+++ b/libfaad/ssr_win.h
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: ssr_win.h,v 1.1 2002/11/28 18:48:30 menno Exp $
+** 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: ssr_win.h,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
#ifndef __SSR_WIN_H__
--- a/libfaad/structs.h
+++ b/libfaad/structs.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: structs.h,v 1.9 2003/07/09 13:55:59 menno Exp $
+** 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: structs.h,v 1.10 2003/07/29 08:20:14 menno Exp $
**/
#ifndef __STRUCTS_H__
@@ -26,6 +32,10 @@
extern "C" {
#endif
+#ifdef SBR_DEC
+#include "sbr_dec.h"
+#endif
+
#define MAX_CHANNELS 64
#define MAX_SYNTAX_ELEMENTS 48
#define MAX_WINDOW_GROUPS 8
@@ -307,6 +317,7 @@
uint8_t aacSpectralDataResilienceFlag;
uint8_t epConfig;
+ int8_t sbr_present_flag;
} mp4AudioSpecificConfig;
typedef struct faacDecConfiguration
@@ -346,6 +357,8 @@
uint8_t aacSpectralDataResilienceFlag;
#endif
uint16_t frameLength;
+ uint16_t samplesLeft;
+ uint8_t postSeekResetFlag;
uint32_t frame;
@@ -366,6 +379,16 @@
drc_info *drc;
real_t *time_out[MAX_CHANNELS];
+
+#ifdef SBR_DEC
+ int8_t sbr_present_flag;
+
+ real_t *time_out2[MAX_CHANNELS];
+
+ uint8_t sbr_used[32];
+
+ sbr_info *sbr[32];
+#endif
#ifdef SSR_DEC
real_t *ssr_overlap[MAX_CHANNELS];
--- a/libfaad/syntax.c
+++ b/libfaad/syntax.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: syntax.c,v 1.50 2003/07/09 13:55:59 menno Exp $
+** 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: syntax.c,v 1.51 2003/07/29 08:20:14 menno Exp $
**/
/*
@@ -40,6 +46,9 @@
#ifdef ERROR_RESILIENCE
#include "rvlc.h"
#endif
+#ifdef SBR_DEC
+#include "sbr_syntax.h"
+#endif
/* Table 4.4.1 */
@@ -400,7 +409,7 @@
return elements;
break;
case ID_DSE:
- data_stream_element(ld);
+ data_stream_element(hDecoder, ld);
break;
case ID_PCE:
if ((hInfo->error = program_config_element(pce, ld)) > 0)
@@ -408,8 +417,21 @@
hDecoder->pce_set = 1;
break;
case ID_FIL:
- if ((hInfo->error = fill_element(ld, drc)) > 0)
+ /* one sbr_info describes a channel_element not a channel! */
+ if ((hInfo->error = fill_element(hDecoder, ld, drc
+#ifdef SBR_DEC
+ , (ch_ele-1)
+#endif
+ )) > 0)
return elements;
+#ifdef SBR_DEC
+ if (hDecoder->sbr_used[ch_ele-1])
+ {
+ hDecoder->sbr_present_flag = 1;
+ hDecoder->sbr[ch_ele-1]->sample_rate = sample_rates[hDecoder->sf_index];
+ hDecoder->sbr[ch_ele-1]->sample_rate *= 2;
+ }
+#endif
break;
}
}
@@ -930,7 +952,7 @@
}
/* Table 4.4.10 */
-static uint16_t data_stream_element(bitfile *ld)
+static uint16_t data_stream_element(faacDecHandle hDecoder, bitfile *ld)
{
uint8_t byte_aligned;
uint16_t i, count;
@@ -951,8 +973,31 @@
for (i = 0; i < count; i++)
{
- faad_getbits(ld, LEN_BYTE
+ uint8_t data = faad_getbits(ld, LEN_BYTE
DEBUGVAR(1,64,"data_stream_element(): data_stream_byte"));
+
+ if (count == 6 && data == 'N')
+ {
+ data = faad_getbits(ld, LEN_BYTE
+ DEBUGVAR(1,64,"data_stream_element(): data_stream_byte"));
+ i++;
+ if (data == 'D')
+ {
+ uint16_t samplesLeft;
+ uint8_t data2 = faad_getbits(ld, LEN_BYTE
+ DEBUGVAR(1,64,"data_stream_element(): data_stream_byte"));
+ data = faad_getbits(ld, LEN_BYTE
+ DEBUGVAR(1,64,"data_stream_element(): data_stream_byte"));
+ samplesLeft = faad_getbits(ld, LEN_BYTE
+ DEBUGVAR(1,64,"data_stream_element(): data_stream_byte"));
+ samplesLeft += (faad_getbits(ld, LEN_BYTE
+ DEBUGVAR(1,64,"data_stream_element(): data_stream_byte")) << 8);
+ i += 4;
+
+ if (data == 'L' && data2 == 'F')
+ hDecoder->samplesLeft = samplesLeft;
+ }
+ }
}
return count;
@@ -959,9 +1004,16 @@
}
/* Table 4.4.11 */
-static uint8_t fill_element(bitfile *ld, drc_info *drc)
+static uint8_t fill_element(faacDecHandle hDecoder, bitfile *ld, drc_info *drc
+#ifdef SBR_DEC
+ ,uint8_t sbr_ele
+#endif
+ )
{
uint16_t count;
+#ifdef SBR_DEC
+ uint8_t bs_extension_type;
+#endif
count = (uint16_t)faad_getbits(ld, 4
DEBUGVAR(1,65,"fill_element(): count"));
@@ -971,9 +1023,36 @@
DEBUGVAR(1,66,"fill_element(): extra count")) - 1;
}
- while (count > 0)
+ if (count > 0)
{
- count -= extension_payload(ld, drc, count);
+#ifdef SBR_DEC
+ hDecoder->sbr_used[sbr_ele] = 0;
+ bs_extension_type = (uint8_t)faad_showbits(ld, 4);
+
+ if ((bs_extension_type == EXT_SBR_DATA) ||
+ (bs_extension_type == EXT_SBR_DATA_CRC))
+ {
+ hDecoder->sbr_used[sbr_ele] = 1;
+
+ if (!hDecoder->sbr[sbr_ele])
+ hDecoder->sbr[sbr_ele] = sbrDecodeInit();
+
+ /* read in all the SBR data for processing later on
+ this is needed because the SBR bitstream reader needs to know
+ what element type comes _after_ the (this) SBR FIL element
+ */
+ hDecoder->sbr[sbr_ele]->data = (uint8_t*)faad_getbitbuffer(ld, count*8);
+ hDecoder->sbr[sbr_ele]->data_size = count;
+ } else {
+ hDecoder->sbr_used[sbr_ele] = 0;
+#endif
+ while (count > 0)
+ {
+ count -= extension_payload(ld, drc, count);
+ }
+#ifdef SBR_DEC
+ }
+#endif
}
return 0;
@@ -1376,8 +1455,6 @@
ics->scale_factors[g][sfb] = noise_energy;
break;
- case BOOKSCL: /* invalid books */
- return 3;
default: /* spectral books */
/* decode scale factor */
--- a/libfaad/syntax.h
+++ b/libfaad/syntax.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: syntax.h,v 1.31 2003/07/09 11:53:07 menno Exp $
+** 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: syntax.h,v 1.32 2003/07/29 08:20:14 menno Exp $
**/
#ifndef __SYNTAX_H__
@@ -75,7 +81,6 @@
#define ESC_HCB 11
#define QUAD_LEN 4
#define PAIR_LEN 2
-#define BOOKSCL 12
#define NOISE_HCB 13
#define INTENSITY_HCB2 14
#define INTENSITY_HCB 15
@@ -101,9 +106,13 @@
bitfile *ld, int16_t *spec_data1,
int16_t *spec_data2);
static uint8_t coupling_channel_element(faacDecHandle hDecoder, bitfile *ld);
-static uint16_t data_stream_element(bitfile *ld);
+static uint16_t data_stream_element(faacDecHandle hDecoder, bitfile *ld);
static uint8_t program_config_element(program_config *pce, bitfile *ld);
-static uint8_t fill_element(bitfile *ld, drc_info *drc);
+static uint8_t fill_element(faacDecHandle hDecoder, bitfile *ld, drc_info *drc
+#ifdef SBR_DEC
+ ,uint8_t sbr_ele
+#endif
+ );
static uint8_t individual_channel_stream(faacDecHandle hDecoder, element *ele,
bitfile *ld, ic_stream *ics, uint8_t scal_flag,
int16_t *spec_data);
--- a/libfaad/tns.c
+++ b/libfaad/tns.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: tns.c,v 1.20 2003/06/23 15:21:20 menno Exp $
+** 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: tns.c,v 1.21 2003/07/29 08:20:14 menno Exp $
**/
#include "common.h"
@@ -111,8 +117,7 @@
{
top = bottom;
bottom = max(top - tns->length[w][f], 0);
- tns_order = min(tns->order[w][f], tns_max_order(ics, sr_index,
- object_type));
+ tns_order = min(tns->order[w][f], TNS_MAX_ORDER);
if (!tns_order)
continue;
@@ -119,12 +124,8 @@
tns_decode_coef(tns_order, tns->coef_res[w]+3,
tns->coef_compress[w][f], tns->coef[w][f], lpc);
- start = ics->swb_offset[min(bottom,
- min(tns_max_bands(ics, sr_index, object_type, frame_len),
- ics->max_sfb))];
- end = ics->swb_offset[min(top,
- min(tns_max_bands(ics, sr_index, object_type, frame_len),
- ics->max_sfb))];
+ start = ics->swb_offset[min(bottom, ics->max_sfb)];
+ end = ics->swb_offset[min(top, ics->max_sfb)];
if ((size = end - start) <= 0)
continue;
@@ -163,8 +164,7 @@
{
top = bottom;
bottom = max(top - tns->length[w][f], 0);
- tns_order = min(tns->order[w][f], tns_max_order(ics, sr_index,
- object_type));
+ tns_order = min(tns->order[w][f], TNS_MAX_ORDER);
if (!tns_order)
continue;
@@ -171,12 +171,8 @@
tns_decode_coef(tns_order, tns->coef_res[w]+3,
tns->coef_compress[w][f], tns->coef[w][f], lpc);
- start = ics->swb_offset[min(bottom,
- min(tns_max_bands(ics, sr_index, object_type, frame_len),
- ics->max_sfb))];
- end = ics->swb_offset[min(top,
- min(tns_max_bands(ics, sr_index, object_type, frame_len),
- ics->max_sfb))];
+ start = ics->swb_offset[min(bottom, ics->max_sfb)];
+ end = ics->swb_offset[min(top, ics->max_sfb)];
if ((size = end - start) <= 0)
continue;
@@ -304,84 +300,4 @@
*spectrum = y;
spectrum += inc;
}
-}
-
-static uint8_t tns_max_bands_table[12][6] =
-{
- /* entry for each sampling rate
- * 1 Main/LC long window
- * 2 Main/LC short window
- * 3 SSR long window
- * 4 SSR short window
- * 5 LD 512 window
- * 6 LD 480 window
- */
- { 31, 9, 28, 7, 0, 0 }, /* 96000 */
- { 31, 9, 28, 7, 0, 0 }, /* 88200 */
- { 34, 10, 27, 7, 0, 0 }, /* 64000 */
- { 40, 14, 26, 6, 31, 31 }, /* 48000 */
- { 42, 14, 26, 6, 32, 32 }, /* 44100 */
- { 51, 14, 26, 6, 37, 37 }, /* 32000 */
- { 46, 14, 29, 7, 31, 30 }, /* 24000 */
- { 46, 14, 29, 7, 31, 30 }, /* 22050 */
- { 42, 14, 23, 8, 0, 0 }, /* 16000 */
- { 42, 14, 23, 8, 0, 0 }, /* 12000 */
- { 42, 14, 23, 8, 0, 0 }, /* 11025 */
- { 39, 14, 19, 7, 0, 0 }, /* 8000 */
-};
-
-static uint8_t tns_max_bands(ic_stream *ics, uint8_t sr_index,
- uint8_t object_type, uint16_t frame_len)
-{
- uint8_t i;
-
- i = (ics->window_sequence == EIGHT_SHORT_SEQUENCE) ? 1 : 0;
-#ifdef LD_DEC
- if (object_type == LD)
- {
- if (frame_len == 512)
- i = 4;
- else
- i = 5;
- }
-#endif
-
- return tns_max_bands_table[sr_index][i];
-}
-
-static uint8_t tns_max_order(ic_stream *ics, uint8_t sr_index,
- uint8_t object_type)
-{
- /* Correction in 14496-3 Cor. 1
- Works like MPEG2-AAC (13818-7) now
-
- For other object types (scalable) the following goes for tns max order
- for long windows:
- if (sr_index <= 5)
- return 12;
- else
- return 20;
- */
- if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
- {
- switch (object_type)
- {
- case MAIN:
- case LTP:
- case ER_LTP:
-#ifdef LD_DEC
- case LD:
-#endif
- return 20;
- case LC:
- case ER_LC:
- case DRM_ER_LC:
- case SSR:
- return 12;
- }
- } else {
- return 7;
- }
-
- return 0;
}
--- a/libfaad/tns.h
+++ b/libfaad/tns.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: tns.h,v 1.7 2003/06/23 15:21:20 menno Exp $
+** 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: tns.h,v 1.8 2003/07/29 08:20:14 menno Exp $
**/
#ifndef __TNS_H__
@@ -41,10 +47,6 @@
uint8_t order);
static void tns_ma_filter(real_t *spectrum, uint16_t size, int8_t inc, real_t *lpc,
uint8_t order);
-static uint8_t tns_max_bands(ic_stream *ics, uint8_t sr_index,
- uint8_t object_type, uint16_t frame_len);
-static uint8_t tns_max_order(ic_stream *ics, uint8_t sr_index,
- uint8_t object_type);
#ifdef __cplusplus
--- a/plugins/foo_mp4/foo_mp4.cpp
+++ b/plugins/foo_mp4/foo_mp4.cpp
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002-2003 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: foo_mp4.cpp,v 1.37 2003/07/09 12:33:08 menno Exp $
+** 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: foo_mp4.cpp,v 1.38 2003/07/29 08:20:14 menno Exp $
**/
#include <mp4.h>
@@ -44,7 +50,7 @@
#endif
DECLARE_COMPONENT_VERSION ("MPEG-4 AAC decoder",
- "$Revision: 1.37 $",
+ "$Revision: 1.38 $",
"Based on FAAD2 v" FAAD2_VERSION "\nCopyright (C) 2002-2003 http://www.audiocoding.com" );
class input_mp4 : public input
@@ -133,12 +139,9 @@
track, "mdia.minf.stbl.stsd.mp4a.esds.decConfigDescr.avgBitrate")) + 0.5);
info->info_set_int("channels", (__int64)channels);
info->info_set_int("samplerate", (__int64)samplerate);
-
-#if 0
- if (mp4ASC.sbr_present_flag)
+ if (mp4ASC.sbr_present_flag == 1)
info->info_set("codec", "AAC+SBR");
else
-#endif
info->info_set("codec", "AAC");
ReadMP4Tag(info);
@@ -150,6 +153,7 @@
{
hFile = MP4_INVALID_FILE_HANDLE;
hDecoder = NULL;
+ m_samples = 0;
}
~input_mp4()
@@ -254,6 +258,18 @@
if (p)
MP4SetMetadataFreeForm(hFile, "REPLAYGAIN_ALBUM_GAIN", (unsigned __int8*)p, strlen(p));
+ if (m_samples > 0)
+ {
+ unsigned __int8 length[4];
+
+ length[0] = (unsigned __int8)(((unsigned int)m_samples >> 24) & 0xFF);
+ length[1] = (unsigned __int8)(((unsigned int)m_samples >> 16) & 0xFF);
+ length[2] = (unsigned __int8)(((unsigned int)m_samples >> 8) & 0xFF);
+ length[3] = (unsigned __int8)(((unsigned int)m_samples ) & 0xFF);
+
+ MP4SetMetadataFreeForm(hFile, "NDFL", length, 4);
+ }
+
int numItems = info->meta_get_count();
if (numItems > 0)
{
@@ -331,6 +347,7 @@
MP4FileHandle hFile;
MP4SampleId sampleId, numSamples;
MP4TrackId track;
+ unsigned int m_samples;
int ReadMP4Tag(file_info *info)
{
@@ -400,6 +417,15 @@
MP4GetMetadataTempo(hFile, &tempo);
wsprintf(t, "%d BPM", tempo);
info->meta_add("TEMPO", t);
+ } else if (memcmp(pName, "NDFL", 4) == 0) {
+ unsigned __int8 *data = NULL;
+ unsigned __int32 valueSize = 0;
+ MP4GetMetadataFreeForm(hFile, "NDFL", &data, &valueSize);
+ if (data && valueSize == 4)
+ {
+ // len = number of samples in whole file per channel
+ m_samples = ((data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]);
+ }
} else {
float f = 0;
if (!stricmp(pName, "REPLAYGAIN_TRACK_PEAK"))
--- a/plugins/in_mp4/aac2mp4.cpp
+++ b/plugins/in_mp4/aac2mp4.cpp
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: aac2mp4.cpp,v 1.1 2002/10/05 15:20:20 menno Exp $
+** 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: aac2mp4.cpp,v 1.2 2003/07/29 08:20:14 menno Exp $
**/
#include <mpeg4ip.h>
--- a/plugins/in_mp4/aac2mp4.h
+++ b/plugins/in_mp4/aac2mp4.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: aac2mp4.h,v 1.2 2002/09/03 21:22:53 menno Exp $
+** 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: aac2mp4.h,v 1.3 2003/07/29 08:20:14 menno Exp $
**/
#ifndef AAC2MP4_H__
--- a/plugins/in_mp4/aacinfo.c
+++ b/plugins/in_mp4/aacinfo.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: aacinfo.c,v 1.4 2003/05/31 13:18:05 menno Exp $
+** 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: aacinfo.c,v 1.5 2003/07/29 08:20:14 menno Exp $
**/
#define WIN32_LEAN_AND_MEAN
--- a/plugins/in_mp4/aacinfo.h
+++ b/plugins/in_mp4/aacinfo.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: aacinfo.h,v 1.2 2002/08/15 17:41:44 menno Exp $
+** 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: aacinfo.h,v 1.3 2003/07/29 08:20:14 menno Exp $
**/
#ifndef AACINFO_INCLUDED
--- a/plugins/in_mp4/config.c
+++ b/plugins/in_mp4/config.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: config.c,v 1.2 2003/02/25 17:45:02 menno Exp $
+** 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: config.c,v 1.3 2003/07/29 08:20:14 menno Exp $
**/
#define WIN32_LEAN_AND_MEAN
--- a/plugins/in_mp4/config.h
+++ b/plugins/in_mp4/config.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: config.h,v 1.2 2003/02/25 17:45:03 menno Exp $
+** 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: config.h,v 1.3 2003/07/29 08:20:14 menno Exp $
**/
char app_name[];
--- a/plugins/in_mp4/in_mp4.c
+++ b/plugins/in_mp4/in_mp4.c
@@ -1,22 +1,28 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: in_mp4.c,v 1.34 2003/07/09 18:32:43 menno Exp $
+** 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: in_mp4.c,v 1.35 2003/07/29 08:20:14 menno Exp $
**/
//#define DEBUG_OUTPUT
@@ -213,6 +219,8 @@
{
char *file_info;
MP4FileHandle file;
+ char *pVal, dummy1[1024], dummy3;
+ short dummy, dummy2;
#ifdef DEBUG_OUTPUT
in_mp4_DebugOutput("mp4_info_dialog_proc");
@@ -220,16 +228,17 @@
switch (message) {
case WM_INITDIALOG:
- EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT), FALSE) ;
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT), FALSE);
ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT), SW_HIDE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), FALSE) ;
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), FALSE);
ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), SW_HIDE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), FALSE) ;
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), FALSE);
ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), SW_HIDE);
+
file = MP4Read(info_fn, 0);
- if (!file)
+ if (file == MP4_INVALID_FILE_HANDLE)
return FALSE;
file_info = MP4Info(file, MP4_INVALID_TRACK_ID);
@@ -236,6 +245,62 @@
SetDlgItemText(hwndDlg, IDC_INFOTEXT, file_info);
free(file_info);
+ /* get Metadata */
+
+ pVal = NULL;
+ MP4GetMetadataName(file, &pVal);
+ SetDlgItemText(hwndDlg,IDC_METANAME, pVal);
+
+ pVal = NULL;
+ MP4GetMetadataArtist(file, &pVal);
+ SetDlgItemText(hwndDlg,IDC_METAARTIST, pVal);
+
+ pVal = NULL;
+ MP4GetMetadataWriter(file, &pVal);
+ SetDlgItemText(hwndDlg,IDC_METAWRITER, pVal);
+
+ pVal = NULL;
+ MP4GetMetadataComment(file, &pVal);
+ SetDlgItemText(hwndDlg,IDC_METACOMMENTS, pVal);
+
+ pVal = NULL;
+ MP4GetMetadataAlbum(file, &pVal);
+ SetDlgItemText(hwndDlg,IDC_METAALBUM, pVal);
+
+ pVal = NULL;
+ MP4GetMetadataGenre(file, &pVal);
+ SetDlgItemText(hwndDlg,IDC_METAGENRE, pVal);
+
+ dummy = 0;
+ MP4GetMetadataTempo(file, &dummy);
+ wsprintf(dummy1, "%d", dummy);
+ SetDlgItemText(hwndDlg,IDC_METATEMPO, dummy1);
+
+ dummy = 0; dummy2 = 0;
+ MP4GetMetadataTrack(file, &dummy, &dummy2);
+ wsprintf(dummy1, "%d", dummy);
+ SetDlgItemText(hwndDlg,IDC_METATRACK1, dummy1);
+ wsprintf(dummy1, "%d", dummy2);
+ SetDlgItemText(hwndDlg,IDC_METATRACK2, dummy1);
+
+ dummy = 0; dummy2 = 0;
+ MP4GetMetadataDisk(file, &dummy, &dummy2);
+ wsprintf(dummy1, "%d", dummy);
+ SetDlgItemText(hwndDlg,IDC_METADISK1, dummy1);
+ wsprintf(dummy1, "%d", dummy2);
+ SetDlgItemText(hwndDlg,IDC_METADISK2, dummy1);
+
+ pVal = NULL;
+ MP4GetMetadataYear(file, &pVal);
+ SetDlgItemText(hwndDlg,IDC_METAYEAR, pVal);
+
+ dummy3 = 0;
+ MP4GetMetadataCompilation(file, &dummy3);
+ if (dummy3)
+ SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_SETCHECK, BST_CHECKED, 0);
+
+ /* ! Metadata */
+
MP4Close(file);
return TRUE;
@@ -243,7 +308,64 @@
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDCANCEL:
+ EndDialog(hwndDlg, wParam);
+ return TRUE;
case IDOK:
+
+ /* save Metadata changes */
+
+ file = MP4Modify(info_fn, 0, 0);
+ if (file == MP4_INVALID_FILE_HANDLE)
+ {
+ EndDialog(hwndDlg, wParam);
+ return FALSE;
+ }
+
+ GetDlgItemText(hwndDlg, IDC_METANAME, dummy1, 1024);
+ MP4SetMetadataName(file, dummy1);
+
+ GetDlgItemText(hwndDlg, IDC_METAWRITER, dummy1, 1024);
+ MP4SetMetadataWriter(file, dummy1);
+
+ GetDlgItemText(hwndDlg, IDC_METAARTIST, dummy1, 1024);
+ MP4SetMetadataArtist(file, dummy1);
+
+ GetDlgItemText(hwndDlg, IDC_METAALBUM, dummy1, 1024);
+ MP4SetMetadataAlbum(file, dummy1);
+
+ GetDlgItemText(hwndDlg, IDC_METACOMMENTS, dummy1, 1024);
+ MP4SetMetadataComment(file, dummy1);
+
+ GetDlgItemText(hwndDlg, IDC_METAGENRE, dummy1, 1024);
+ MP4SetMetadataGenre(file, dummy1);
+
+ GetDlgItemText(hwndDlg, IDC_METAYEAR, dummy1, 1024);
+ MP4SetMetadataYear(file, dummy1);
+
+ GetDlgItemText(hwndDlg, IDC_METATRACK1, dummy1, 1024);
+ dummy = atoi(dummy1);
+ GetDlgItemText(hwndDlg, IDC_METATRACK2, dummy1, 1024);
+ dummy2 = atoi(dummy1);
+ MP4SetMetadataTrack(file, dummy, dummy2);
+
+ GetDlgItemText(hwndDlg, IDC_METADISK1, dummy1, 1024);
+ dummy = atoi(dummy1);
+ GetDlgItemText(hwndDlg, IDC_METADISK2, dummy1, 1024);
+ dummy2 = atoi(dummy1);
+ MP4SetMetadataDisk(file, dummy, dummy2);
+
+ GetDlgItemText(hwndDlg, IDC_METATEMPO, dummy1, 1024);
+ dummy = atoi(dummy1);
+ MP4SetMetadataTempo(file, dummy);
+
+ dummy3 = SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_GETCHECK, 0, 0);
+ MP4SetMetadataCompilation(file, dummy3);
+
+ MP4Close(file);
+
+ MP4Optimize(info_fn, NULL, 0);
+ /* ! */
+
EndDialog(hwndDlg, wParam);
return TRUE;
}
@@ -282,6 +404,33 @@
case WM_INITDIALOG:
EnableWindow(GetDlgItem(hwndDlg,IDC_USERDATA), FALSE) ;
ShowWindow(GetDlgItem(hwndDlg,IDC_USERDATA), SW_HIDE);
+
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC1), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC2), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC3), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC4), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC5), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC6), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC7), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC8), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC9), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC10), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC11), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC12), SW_HIDE);
+
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METANAME), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METAARTIST), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METAWRITER), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METACOMMENTS), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METAALBUM), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METAGENRE), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METATEMPO), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METATRACK1), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METATRACK2), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METADISK1), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METADISK2), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METAYEAR), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg,IDC_METACOMPILATION), SW_HIDE);
info_text = malloc(1024*sizeof(char));
--- a/plugins/in_mp4/in_mp4.rc
+++ b/plugins/in_mp4/in_mp4.rc
@@ -52,19 +52,46 @@
// Dialog
//
-IDD_INFO DIALOGEX 0, 0, 303, 207
+IDD_INFO DIALOGEX 0, 0, 303, 255
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "MPEG-4 File Info"
FONT 8, "MS Sans Serif"
BEGIN
- DEFPUSHBUTTON "OK",IDOK,246,186,50,14
- LTEXT "Static",IDC_INFOTEXT,14,17,275,47,0,WS_EX_CLIENTEDGE
GROUPBOX "Track info",IDC_STATIC,7,7,289,64
- GROUPBOX "User data",IDC_USERDATA,7,76,289,104
- PUSHBUTTON "Convert Now!",IDC_CONVERT,111,151,81,14
- GROUPBOX "Convert to MP4",IDC_CONVERT2,7,81,289,99
+ EDITTEXT IDC_METANAME,53,91,151,14,ES_AUTOHSCROLL
+ EDITTEXT IDC_METAARTIST,53,109,151,14,ES_AUTOHSCROLL
+ EDITTEXT IDC_METAWRITER,53,127,151,14,ES_AUTOHSCROLL
+ EDITTEXT IDC_METAALBUM,53,145,233,14,ES_AUTOHSCROLL
+ EDITTEXT IDC_METACOMMENTS,53,163,234,35,ES_AUTOHSCROLL
+ EDITTEXT IDC_METAGENRE,53,202,91,14,ES_AUTOHSCROLL
+ EDITTEXT IDC_METAYEAR,234,91,52,14,ES_AUTOHSCROLL
+ EDITTEXT IDC_METATRACK1,234,109,17,14,ES_AUTOHSCROLL
+ EDITTEXT IDC_METATRACK2,269,109,17,14,ES_AUTOHSCROLL
+ EDITTEXT IDC_METADISK1,234,127,17,14,ES_AUTOHSCROLL
+ EDITTEXT IDC_METADISK2,269,127,17,14,ES_AUTOHSCROLL
+ EDITTEXT IDC_METATEMPO,175,202,22,14,ES_AUTOHSCROLL
+ CONTROL "Part of a compilation",IDC_METACOMPILATION,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,207,202,80,14
+ DEFPUSHBUTTON "OK",IDOK,246,234,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,186,234,50,14
+ PUSHBUTTON "Convert Now!",IDC_CONVERT,111,166,81,14
CTEXT "You can convert this file to MP4 if you like. This does not involve re-encoding, only the container format is changed. Advantages of MP4 files are that they are playable by a lot more players and they will have a lot of support in the future.",
- IDC_CONVERT1,24,98,255,27
+ IDC_CONVERT1,45,103,214,36
+ LTEXT "",IDC_INFOTEXT,14,17,275,47,0,WS_EX_CLIENTEDGE
+ GROUPBOX "User data",IDC_USERDATA,7,76,289,151
+ GROUPBOX "Convert to MP4",IDC_CONVERT2,7,81,289,145
+ LTEXT "Name",IDC_STATIC1,13,91,20,14,SS_CENTERIMAGE
+ LTEXT "Artist",IDC_STATIC2,13,109,16,14,SS_CENTERIMAGE
+ LTEXT "Composer",IDC_STATIC3,13,127,32,14,SS_CENTERIMAGE
+ LTEXT "Album",IDC_STATIC4,13,145,20,14,SS_CENTERIMAGE
+ LTEXT "Comments",IDC_STATIC5,13,163,34,14,SS_CENTERIMAGE
+ LTEXT "Year",IDC_STATIC7,211,91,16,14,SS_CENTERIMAGE
+ LTEXT "Disc",IDC_STATIC9,211,127,15,14,SS_CENTERIMAGE
+ LTEXT "Track",IDC_STATIC8,211,109,20,14,SS_CENTERIMAGE
+ LTEXT "Genre",IDC_STATIC6,13,202,20,14,SS_CENTERIMAGE
+ LTEXT "BPM",IDC_STATIC12,153,202,16,14,SS_CENTERIMAGE
+ LTEXT "of",IDC_STATIC10,257,109,8,14,SS_CENTERIMAGE
+ LTEXT "of",IDC_STATIC11,257,127,8,14,SS_CENTERIMAGE
END
IDD_CONFIG DIALOG DISCARDABLE 0, 0, 151, 108
@@ -109,7 +136,7 @@
LEFTMARGIN, 7
RIGHTMARGIN, 296
TOPMARGIN, 7
- BOTTOMMARGIN, 200
+ BOTTOMMARGIN, 248
END
IDD_CONFIG, DIALOG
--- a/plugins/in_mp4/resource.h
+++ b/plugins/in_mp4/resource.h
@@ -27,6 +27,31 @@
#define IDC_CONVERT1 1009
#define IDC_USERDATA 1010
#define IDC_USEFORAAC 1011
+#define IDC_METACOMPILATION 1012
+#define IDC_METANAME 1013
+#define IDC_METAARTIST 1014
+#define IDC_METAWRITER 1015
+#define IDC_METAALBUM 1016
+#define IDC_METACOMMENTS 1017
+#define IDC_METAGENRE 1018
+#define IDC_METAYEAR 1019
+#define IDC_METATRACK1 1020
+#define IDC_METADISK1 1021
+#define IDC_METATEMPO 1022
+#define IDC_METATRACK2 1023
+#define IDC_METADISK2 1024
+#define IDC_STATIC1 1025
+#define IDC_STATIC2 1026
+#define IDC_STATIC3 1027
+#define IDC_STATIC4 1028
+#define IDC_STATIC5 1029
+#define IDC_STATIC6 1030
+#define IDC_STATIC7 1031
+#define IDC_STATIC8 1032
+#define IDC_STATIC9 1033
+#define IDC_STATIC10 1034
+#define IDC_STATIC11 1035
+#define IDC_STATIC12 1036
// Next default values for new objects
//
@@ -34,7 +59,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1012
+#define _APS_NEXT_CONTROL_VALUE 1038
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
--- a/plugins/in_mp4/utils.c
+++ b/plugins/in_mp4/utils.c
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: utils.c,v 1.5 2003/02/09 20:42:52 menno Exp $
+** 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: utils.c,v 1.6 2003/07/29 08:20:14 menno Exp $
**/
#define WIN32_LEAN_AND_MEAN
--- a/plugins/in_mp4/utils.h
+++ b/plugins/in_mp4/utils.h
@@ -1,6 +1,6 @@
/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
@@ -16,7 +16,13 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: utils.h,v 1.2 2002/08/14 17:55:20 menno Exp $
+** 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: utils.h,v 1.3 2003/07/29 08:20:14 menno Exp $
**/
#ifndef UTILS_INCLUDED