~ft/faad2

6bd8442bfc16bf6ba218fda8eba3abb6901669cf — menno 17 years ago 6790125
import SBR code
135 files changed, 12599 insertions(+), 1079 deletions(-)

M AUTHORS
M COPYING
M NEWS
M README
M TODO
M aacDECdrop/audio.c
M aacDECdrop/audio.h
M common/faad/aacinfo.c
M common/faad/aacinfo.h
M common/faad/filestream.c
M common/faad/filestream.h
M common/faad/id3v2tag.c
M common/faad/id3v2tag.h
M common/mp4av/aac.cpp
M common/mp4av/adts.cpp
M common/mp4av/audio.cpp
M common/mp4av/audio_hinters.cpp
M common/mp4av/l16.cpp
M common/mp4av/libmp4av.dsp
M common/mp4av/libmp4av_st.dsp
M common/mp4av/mp4av_adts.h
M common/mp4av/mp4av_mpeg4.h
M common/mp4av/mpeg3.cpp
M common/mp4av/mpeg4.cpp
M common/mp4av/rfc2250.cpp
M common/mp4av/rfc3119.cpp
M common/mp4av/rfcisma.cpp
M frontend/audio.c
M frontend/audio.h
M frontend/main.c
M include/faad.h
M libfaad/Makefile.am
M libfaad/analysis.h
M libfaad/bits.c
M libfaad/bits.h
M libfaad/cfft.c
M libfaad/cfft.h
M libfaad/cfft_tab.h
M libfaad/codebook/hcb.h
M libfaad/codebook/hcb_1.h
M libfaad/codebook/hcb_10.h
M libfaad/codebook/hcb_11.h
M libfaad/codebook/hcb_2.h
M libfaad/codebook/hcb_3.h
M libfaad/codebook/hcb_4.h
M libfaad/codebook/hcb_5.h
M libfaad/codebook/hcb_6.h
M libfaad/codebook/hcb_7.h
M libfaad/codebook/hcb_8.h
M libfaad/codebook/hcb_9.h
M libfaad/codebook/hcb_sf.h
M libfaad/common.c
M libfaad/common.h
M libfaad/decoder.c
M libfaad/decoder.h
M libfaad/drc.c
M libfaad/drc.h
M libfaad/error.c
M libfaad/error.h
M libfaad/filtbank.c
M libfaad/filtbank.h
M libfaad/fixed.h
M libfaad/hcr.c
M libfaad/huffman.h
M libfaad/ic_predict.c
M libfaad/ic_predict.h
M libfaad/iq_table.h
M libfaad/is.c
M libfaad/is.h
M libfaad/kbd_win.h
M libfaad/libfaad.dsp
M libfaad/lt_predict.c
M libfaad/lt_predict.h
M libfaad/mdct.c
M libfaad/mdct.h
M libfaad/mp4.c
M libfaad/mp4.h
M libfaad/ms.c
M libfaad/ms.h
M libfaad/output.c
M libfaad/output.h
M libfaad/pns.c
M libfaad/pns.h
M libfaad/pulse.c
M libfaad/pulse.h
M libfaad/rvlc.c
M libfaad/rvlc.h
A libfaad/sbr_dct.c
A libfaad/sbr_dct.h
A libfaad/sbr_dec.c
A libfaad/sbr_dec.h
A libfaad/sbr_e_nf.c
A libfaad/sbr_e_nf.h
A libfaad/sbr_fbt.c
A libfaad/sbr_fbt.h
A libfaad/sbr_hfadj.c
A libfaad/sbr_hfadj.h
A libfaad/sbr_hfgen.c
A libfaad/sbr_hfgen.h
A libfaad/sbr_huff.c
A libfaad/sbr_huff.h
A libfaad/sbr_noise.h
A libfaad/sbr_qmf.c
A libfaad/sbr_qmf.h
A libfaad/sbr_syntax.c
A libfaad/sbr_syntax.h
A libfaad/sbr_tf_grid.c
A libfaad/sbr_tf_grid.h
M libfaad/sine_win.h
M libfaad/specrec.c
M libfaad/specrec.h
M libfaad/ssr.c
M libfaad/ssr.h
M libfaad/ssr_fb.c
M libfaad/ssr_fb.h
M libfaad/ssr_ipqf.c
M libfaad/ssr_ipqf.h
M libfaad/ssr_win.h
M libfaad/structs.h
M libfaad/syntax.c
M libfaad/syntax.h
M libfaad/tns.c
M libfaad/tns.h
M plugins/foo_mp4/foo_mp4.cpp
M plugins/in_mp4/aac2mp4.cpp
M plugins/in_mp4/aac2mp4.h
M plugins/in_mp4/aacinfo.c
M plugins/in_mp4/aacinfo.h
M plugins/in_mp4/config.c
M plugins/in_mp4/config.h
M plugins/in_mp4/in_mp4.c
M plugins/in_mp4/in_mp4.rc
M plugins/in_mp4/resource.h
M plugins/in_mp4/utils.c
M plugins/in_mp4/utils.h
M AUTHORS => AUTHORS +2 -2
@@ 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

M COPYING => COPYING +17 -7
@@ 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 @@ patent must be licensed for everyone's free use or not licensed at all.
  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 @@ make exceptions for this.  Our decision will be guided by the two goals
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 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
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

M NEWS => NEWS +2 -11
@@ 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

M README => README +44 -51
@@ 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,23 46,13 @@ ______
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

Version 1.0: 14 jan 2002
 - Initial revision of completely rewritten FAAD 2 library

Sorry, try building a ChangeLog from CVS.

__________________________________
REDISTRIBUTED OPEN SOURCE PACKAGES


@@ 66,27 60,20 @@ REDISTRIBUTED OPEN SOURCE PACKAGES
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 @@ faad2 - top level directory.

      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.


M TODO => TODO +1 -4
@@ 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

M aacDECdrop/audio.c => aacDECdrop/audio.c +10 -7
@@ 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

M aacDECdrop/audio.h => aacDECdrop/audio.h +10 -7
@@ 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

M common/faad/aacinfo.c => common/faad/aacinfo.c +9 -3
@@ 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

M common/faad/aacinfo.h => common/faad/aacinfo.h +9 -3
@@ 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__

M common/faad/filestream.c => common/faad/filestream.c +9 -3
@@ 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 */

M common/faad/filestream.h => common/faad/filestream.h +9 -3
@@ 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

M common/faad/id3v2tag.c => common/faad/id3v2tag.c +9 -3
@@ 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

M common/faad/id3v2tag.h => common/faad/id3v2tag.h +9 -3
@@ 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__

M common/mp4av/aac.cpp => common/mp4av/aac.cpp +47 -0
@@ 131,3 131,50 @@ extern "C" bool MP4AV_AacGetConfiguration(
	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;
}

M common/mp4av/adts.cpp => common/mp4av/adts.cpp +26 -22
@@ 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 @@ u_int32_t AdtsSamplingRates[NUM_ADTS_SAMPLING_RATES] = {
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;

	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); 
	}
	uint16_t frameLength;

	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_AdtsGetFrameSize(u_int8_t* pHdr)
 */
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 @@ extern "C" bool MP4AV_AdtsMakeFrameFromMp4Sample(
	MP4FileHandle mp4File,
	MP4TrackId trackId,
	MP4SampleId sampleId,
	int force_profile,
	u_int8_t** ppAdtsData,
	u_int32_t* pAdtsDataLength)
{


@@ 156,14 148,28 @@ extern "C" bool MP4AV_AdtsMakeFrameFromMp4Sample(
		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 @@ extern "C" bool MP4AV_AdtsMakeFrame(
	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 @@ extern "C" bool MP4AV_AdtsMakeFrame(
		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

M common/mp4av/audio.cpp => common/mp4av/audio.cpp +3 -3
@@ 56,7 56,7 @@ extern "C" u_int8_t MP4AV_AudioGetChannels(
	MP4TrackId audioTrackId)
{
	u_int8_t audioType = 
		MP4GetTrackAudioType(mp4File, audioTrackId);
		MP4GetTrackEsdsObjectTypeId(mp4File, audioTrackId);

	if (audioType == MP4_INVALID_AUDIO_TYPE) {
		return 0;


@@ 116,7 116,7 @@ extern "C" u_int32_t MP4AV_AudioGetSamplingRate(
	MP4TrackId audioTrackId)
{
	u_int8_t audioType = 
		MP4GetTrackAudioType(mp4File, audioTrackId);
		MP4GetTrackEsdsObjectTypeId(mp4File, audioTrackId);

	if (audioType == MP4_INVALID_AUDIO_TYPE) {
		return 0;


@@ 165,7 165,7 @@ extern "C" u_int16_t MP4AV_AudioGetSamplingWindow(
	MP4TrackId audioTrackId)
{
	u_int8_t audioType = 
		MP4GetTrackAudioType(mp4File, audioTrackId);
		MP4GetTrackEsdsObjectTypeId(mp4File, audioTrackId);

	if (audioType == MP4_INVALID_AUDIO_TYPE) {
		return 0;

M common/mp4av/audio_hinters.cpp => common/mp4av/audio_hinters.cpp +17 -0
@@ 100,6 100,17 @@ bool MP4AV_AudioConsecutiveHinter(
		}
	}

	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 @@ bool MP4AV_AudioInterleaveHinter(

	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 @@ bool MP4AV_AudioInterleaveHinter(

				// add sample to this hint
				pSampleIds[k] = sampleId;
				sampleIds++;
			}

			if (k == 0) {


@@ 150,6 163,9 @@ bool MP4AV_AudioInterleaveHinter(
				// 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 @@ bool MP4AV_AudioInterleaveHinter(
			// write hint
			rc = (*pConcatenator)(mp4File, mediaTrackId, hintTrackId,
				k, pSampleIds, hintDuration, maxPayloadSize);
			sampleIds = 0;

			if (!rc) {
				return false;

M common/mp4av/l16.cpp => common/mp4av/l16.cpp +2 -2
@@ 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 @@ extern "C" bool L16Hinter (MP4FileHandle mp4file,
  }
#endif

  audioType = MP4GetTrackAudioType(mp4file, trackid);
  audioType = MP4GetTrackEsdsObjectTypeId(mp4file, trackid);

  if (audioType != MP4_PCM16_BIG_ENDIAN_AUDIO_TYPE) return false;


M common/mp4av/libmp4av.dsp => common/mp4av/libmp4av.dsp +184 -184
@@ 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

M common/mp4av/libmp4av_st.dsp => common/mp4av/libmp4av_st.dsp +176 -178
@@ 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

M common/mp4av/mp4av_adts.h => common/mp4av/mp4av_adts.h +1 -0
@@ 77,6 77,7 @@ bool MP4AV_AdtsMakeFrameFromMp4Sample(
	MP4FileHandle mp4File,
	MP4TrackId trackId,
	MP4SampleId sampleId,
	int force_profile,
	u_int8_t** ppAdtsData,
	u_int32_t* pAdtsDataLength);


M common/mp4av/mp4av_mpeg4.h => common/mp4av/mp4av_mpeg4.h +3 -0
@@ 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,


@@ 48,6 49,8 @@ bool MP4AV_Mpeg4CreateVo(
	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, 
	u_int32_t volSize,

M common/mp4av/mpeg3.cpp => common/mp4av/mpeg3.cpp +1 -1
@@ 265,7 265,7 @@ extern "C" bool Mpeg12Hinter (MP4FileHandle mp4file,

  if (numSamples == 0) return false;

  videoType = MP4GetTrackVideoType(mp4file, trackid);
  videoType = MP4GetTrackEsdsObjectTypeId(mp4file, trackid);

  if (videoType != MP4_MPEG1_VIDEO_TYPE &&
      videoType != MP4_MPEG2_VIDEO_TYPE) {

M common/mp4av/mpeg4.cpp => common/mp4av/mpeg4.cpp +40 -2
@@ 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 @@ extern "C" bool MP4AV_Mpeg4CreateVo(
	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 @@ extern "C" bool MP4AV_Mpeg4CreateVol(
		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 @@ extern "C" bool MP4AV_Mpeg4CreateVol(

		/* 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,18 341,22 @@ extern "C" bool MP4AV_Mpeg4CreateVol(
			/* 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 */
		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);


M common/mp4av/rfc2250.cpp => common/mp4av/rfc2250.cpp +1 -1
@@ 45,7 45,7 @@ extern "C" bool MP4AV_Rfc2250Hinter(
	}

	u_int8_t audioType =
		MP4GetTrackAudioType(mp4File, mediaTrackId);
		MP4GetTrackEsdsObjectTypeId(mp4File, mediaTrackId);

	if (!MP4_IS_MP3_AUDIO_TYPE(audioType)) {
		return false;

M common/mp4av/rfc3119.cpp => common/mp4av/rfc3119.cpp +1 -1
@@ 417,7 417,7 @@ extern "C" bool MP4AV_Rfc3119Hinter(
	}

	u_int8_t audioType =
		MP4GetTrackAudioType(mp4File, mediaTrackId);
		MP4GetTrackEsdsObjectTypeId(mp4File, mediaTrackId);

	if (!MP4_IS_MP3_AUDIO_TYPE(audioType)) {
		return false;

M common/mp4av/rfcisma.cpp => common/mp4av/rfcisma.cpp +1 -1
@@ 183,7 183,7 @@ extern "C" bool MP4AV_RfcIsmaHinter(
	}

	u_int8_t audioType =
		MP4GetTrackAudioType(mp4File, mediaTrackId);
		MP4GetTrackEsdsObjectTypeId(mp4File, mediaTrackId);

	if (audioType != MP4_MPEG4_AUDIO_TYPE
	  && !MP4_IS_AAC_AUDIO_TYPE(audioType)) {

M frontend/audio.c => frontend/audio.c +13 -7
@@ 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

M frontend/audio.h => frontend/audio.h +13 -7
@@ 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

M frontend/main.c => frontend/main.c +14 -8
@@ 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 @@ int decodeMP4file(char *mp4file, char *sndfile, int to_stdout,
    /* 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);
    }


M include/faad.h => include/faad.h +17 -10
@@ 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 @@ extern "C" {
  #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 @@ extern "C" {
#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,13 110,14 @@ typedef struct mp4AudioSpecificConfig
    /* GA Specific Info */
    unsigned char frameLengthFlag;
    unsigned char dependsOnCoreCoder;
    unsigned long coreCoderDelay;
    unsigned short coreCoderDelay;
    unsigned char extensionFlag;
    unsigned char aacSectionDataResilienceFlag;
    unsigned char aacScalefactorDataResilienceFlag;
    unsigned char aacSpectralDataResilienceFlag;
    unsigned char epConfig;

    char sbr_present_flag;
} mp4AudioSpecificConfig;

typedef struct faacDecConfiguration

M libfaad/Makefile.am => libfaad/Makefile.am +7 -2
@@ 5,13 5,18 @@ libfaad_la_SOURCES = bits.c cfft.c decoder.c dither.c drc.c \
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

M libfaad/analysis.h => libfaad/analysis.h +9 -3
@@ 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__

M libfaad/bits.c => libfaad/bits.c +13 -7
@@ 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"

M libfaad/bits.h => libfaad/bits.h +9 -3
@@ 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__

M libfaad/cfft.c => libfaad/cfft.c +9 -3
@@ 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 $
**/

/*

M libfaad/cfft.h => libfaad/cfft.h +9 -3
@@ 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__

M libfaad/cfft_tab.h => libfaad/cfft_tab.h +13 -7
@@ 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__

M libfaad/codebook/hcb.h => libfaad/codebook/hcb.h +22 -36
@@ 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 @@ extern "C" {
#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,31 112,15 @@ typedef struct
    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[];

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
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[];

#include "codebook/hcb_1.h"
#include "codebook/hcb_2.h"


@@ 146,9 135,6 @@ extern uint8_t hcb_sf[][2];
#include "codebook/hcb_11.h"
#include "codebook/hcb_sf.h"

#endif



#ifdef __cplusplus
}

M libfaad/codebook/hcb_1.h => libfaad/codebook/hcb_1.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_10.h => libfaad/codebook/hcb_10.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_11.h => libfaad/codebook/hcb_11.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_2.h => libfaad/codebook/hcb_2.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_3.h => libfaad/codebook/hcb_3.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_4.h => libfaad/codebook/hcb_4.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_5.h => libfaad/codebook/hcb_5.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_6.h => libfaad/codebook/hcb_6.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_7.h => libfaad/codebook/hcb_7.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_8.h => libfaad/codebook/hcb_8.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_9.h => libfaad/codebook/hcb_9.h +13 -7
@@ 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 */

M libfaad/codebook/hcb_sf.h => libfaad/codebook/hcb_sf.h +13 -7
@@ 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 */

M libfaad/common.c => libfaad/common.c +13 -8
@@ 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 @@ static uint32_t  __r2 = 1;
 */
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 @@ uint32_t random_int(void)
	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


M libfaad/common.h => libfaad/common.h +41 -9
@@ 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 @@ extern "C" {
#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 @@ typedef real_t complex_t[2];


/* 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);


M libfaad/decoder.c => libfaad/decoder.c +151 -9
@@ 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 @@ faacDecHandle FAADAPI faacDecOpen()
    {
        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 @@ faacDecHandle FAADAPI faacDecOpen()
#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,6 294,15 @@ int8_t FAADAPI faacDecInit2(faacDecHandle hDecoder, uint8_t *pBuffer,
    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 */


@@ 343,6 371,9 @@ void FAADAPI faacDecClose(faacDecHandle hDecoder)
    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 @@ void FAADAPI faacDecClose(faacDecHandle hDecoder)

    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 @@ void* FAADAPI faacDecDecode(faacDecHandle hDecoder,
#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 @@ void* FAADAPI faacDecDecode(faacDecHandle hDecoder,

    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 @@ void* FAADAPI faacDecDecode(faacDecHandle hDecoder,
            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,8 991,52 @@ void* FAADAPI faacDecDecode(faacDecHandle hDecoder,
#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


@@ 929,6 1045,32 @@ void* FAADAPI faacDecDecode(faacDecHandle hDecoder,
#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 */

M libfaad/decoder.h => libfaad/decoder.h +9 -3
@@ 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__

M libfaad/drc.c => libfaad/drc.c +9 -3
@@ 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"

M libfaad/drc.h => libfaad/drc.h +9 -3
@@ 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__

M libfaad/error.c => libfaad/error.c +9 -3
@@ 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"

M libfaad/error.h => libfaad/error.h +9 -3
@@ 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__

M libfaad/filtbank.c => libfaad/filtbank.c +9 -3
@@ 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"

M libfaad/filtbank.h => libfaad/filtbank.h +9 -3
@@ 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__

M libfaad/fixed.h => libfaad/fixed.h +9 -3
@@ 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__

M libfaad/hcr.c => libfaad/hcr.c +11 -30
@@ 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 @@ static INLINE int8_t get1bit(bits_t *ld, uint8_t *result)
    int8_t ret;

    ret = getbits(ld, 1, &res);
    *result = res & 1;
    *result = (int8_t)(res & 1);
    return ret;
}



@@ 270,7 251,7 @@ static int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp )
                if (getbits(ld, i, &off))
                    return -1;
                j = off + (1<<i);
                sp[k] = neg ? -j : j;          
                sp[k] = (int16_t)((neg) ? -j : j);
            }
        }
    }    

M libfaad/huffman.h => libfaad/huffman.h +29 -12
@@ 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 INLINE int8_t huffman_scale_factor(bitfile *ld)
}


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 @@ static uint8_t huffman_binary_pair_sign(uint8_t cb, bitfile *ld, int16_t *sp)
    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 @@ static INLINE uint8_t huffman_spectral_data(uint8_t cb, bitfile *ld, int16_t *sp
    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 */

M libfaad/ic_predict.c => libfaad/ic_predict.c +9 -3
@@ 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"

M libfaad/ic_predict.h => libfaad/ic_predict.h +9 -3
@@ 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

M libfaad/iq_table.h => libfaad/iq_table.h +9 -3
@@ 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__

M libfaad/is.c => libfaad/is.c +9 -3
@@ 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"

M libfaad/is.h => libfaad/is.h +9 -3
@@ 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__

M libfaad/kbd_win.h => libfaad/kbd_win.h +9 -3
@@ 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__

M libfaad/libfaad.dsp => libfaad/libfaad.dsp +84 -4
@@ 163,6 163,46 @@ SOURCE=.\rvlc.c
# 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 @@ SOURCE=.\common.h
# 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


@@ 347,6 383,50 @@ 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

SOURCE=.\sine_win.h
# End Source File
# Begin Source File

M libfaad/lt_predict.c => libfaad/lt_predict.c +9 -4
@@ 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,10 16,15 @@
** 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"


M libfaad/lt_predict.h => libfaad/lt_predict.h +9 -3
@@ 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

M libfaad/mdct.c => libfaad/mdct.c +9 -3
@@ 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 $
**/

/*

M libfaad/mdct.h => libfaad/mdct.h +9 -3
@@ 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__

M libfaad/mp4.c => libfaad/mp4.c +72 -4
@@ 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 @@ static uint8_t ObjectTypesTable[32] = {
#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 @@ int8_t FAADAPI AudioSpecificConfig2(uint8_t *pBuffer,
{
    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 @@ int8_t FAADAPI AudioSpecificConfig2(uint8_t *pBuffer,
        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 ||


@@ 182,6 214,42 @@ int8_t FAADAPI AudioSpecificConfig2(uint8_t *pBuffer,
        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);

    return result;

M libfaad/mp4.h => libfaad/mp4.h +9 -3
@@ 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__

M libfaad/ms.c => libfaad/ms.c +9 -3
@@ 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"

M libfaad/ms.h => libfaad/ms.h +9 -3
@@ 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__

M libfaad/output.c => libfaad/output.c +9 -3
@@ 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"

M libfaad/output.h => libfaad/output.h +13 -7
@@ 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__

M libfaad/pns.c => libfaad/pns.c +9 -3
@@ 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"

M libfaad/pns.h => libfaad/pns.h +9 -3
@@ 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__

M libfaad/pulse.c => libfaad/pulse.c +9 -3
@@ 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"

M libfaad/pulse.h => libfaad/pulse.h +9 -3
@@ 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__

M libfaad/rvlc.c => libfaad/rvlc.c +9 -7
@@ 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 @@ static uint8_t rvlc_decode_sf_forward(ic_stream *ics, bitfile *ld_sf, bitfile *l
                    ics->scale_factors[g][sfb] = noise_energy;

                    break;
                case BOOKSCL: /* invalid books */
                    return 3;
                default: /* spectral books */

                    /* decode scale factor */


@@ 298,8 302,6 @@ static uint8_t rvlc_decode_sf_reverse(ic_stream *ics, bitfile *ld_sf, bitfile *l
                    ics->scale_factors[g][sfb] = noise_energy;

                    break;
                case BOOKSCL: /* invalid books */
                    return 3;
                default: /* spectral books */

                    if (sf_pcm_flag || (sfb == 0))

M libfaad/rvlc.h => libfaad/rvlc.h +9 -3
@@ 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__

A libfaad/sbr_dct.c => libfaad/sbr_dct.c +4274 -0
@@ 0,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;