ref: 72ee2353e48bdda961fdcec0e9a21a865f33ac91
parent: cd2a605682181958d9d0f136f7c61b87674b9e59
author: menno <menno>
date: Thu Mar 4 14:06:01 EST 2004
corporate function names :) changed faad.h to neaacdec.h
--- a/frontend/audio.c
+++ b/frontend/audio.c
@@ -22,7 +22,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: audio.c,v 1.22 2004/03/02 23:13:49 menno Exp $
+** $Id: audio.c,v 1.24 2004/03/10 19:45:40 menno Exp $
**/
#ifdef _WIN32
@@ -32,7 +32,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <math.h>
-#include <faad.h>
+#include <neaacdec.h>
#include "audio.h"
--- a/frontend/faad.dsp
+++ b/frontend/faad.dsp
@@ -25,7 +25,7 @@
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "faad - Win32 Release"
@@ -48,7 +48,7 @@
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 Advapi32.lib /nologo /subsystem:console /machine:I386
# SUBTRACT LINK32 /profile
@@ -73,7 +73,7 @@
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 Advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
@@ -108,19 +108,27 @@
# End Source File
# Begin Source File
-SOURCE=..\include\faad.h
+SOURCE=..\common\faad\getopt.h
# End Source File
# Begin Source File
-SOURCE=..\common\faad\getopt.h
+SOURCE=..\common\mp4v2\mp4.h
# End Source File
# Begin Source File
-SOURCE=..\common\mp4v2\mp4.h
+SOURCE=..\common\mp4ff\mp4ff.h
# End Source File
# Begin Source File
+SOURCE=..\common\mp4ff\mp4ff_int_types.h
+# End Source File
+# Begin Source File
+
SOURCE=..\common\mp4v2\mpeg4ip.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\neaacdec.h
# End Source File
# Begin Source File
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -22,7 +22,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: main.c,v 1.73 2004/03/02 23:13:50 menno Exp $
+** $Id: main.c,v 1.75 2004/03/10 19:45:40 menno Exp $
**/
#ifdef _WIN32
@@ -38,7 +38,7 @@
#include <stdlib.h>
#include <getopt.h>
-#include <faad.h>
+#include <neaacdec.h>
#include <mp4ff.h>
#include "audio.h"
--- a/include/faad.h
+++ b/include/faad.h
@@ -22,219 +22,8 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: faad.h,v 1.44 2004/03/02 20:53:56 menno Exp $
+** $Id: faad.h,v 1.46 2004/03/10 19:45:40 menno Exp $
**/
-#ifndef __AACDEC_H__
-#define __AACDEC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-#if 1
-/* MACROS FOR BACKWARDS COMPATIBILITY */
-/* structs */
-#define faacDecHandle NeAACDecHandle
-#define faacDecConfiguration NeAACDecConfiguration
-#define faacDecConfigurationPtr NeAACDecConfigurationPtr
-#define faacDecFrameInfo NeAACDecFrameInfo
-/* functions */
-#define faacDecGetErrorMessage NeAACDecGetErrorMessage
-#define faacDecSetConfiguration NeAACDecSetConfiguration
-#define faacDecInit NeAACDecInit
-#define faacDecInit2 NeAACDecInit2
-#define faacDecInitDRM NeAACDecInitDRM
-#define faacDecPostSeekReset NeAACDecPostSeekReset
-#define faacDecOpen NeAACDecOpen
-#define faacDecClose NeAACDecClose
-#define faacDecDecode NeAACDecDecode
-#define AudioSpecificConfig NeAACDecAudioSpecificConfig
-#endif
-
-
-#ifdef _WIN32
- #pragma pack(push, 8)
- #ifndef NEAACDECAPI
- #define NEAACDECAPI __cdecl
- #endif
-#else
- #ifndef NEAACDECAPI
- #define NEAACDECAPI
- #endif
-#endif
-
-#define FAAD2_VERSION "2.1 beta"
-
-/* object types for AAC */
-#define MAIN 1
-#define LC 2
-#define SSR 3
-#define LTP 4
-#define HE_AAC 5
-#define ER_LC 17
-#define ER_LTP 19
-#define LD 23
-#define DRM_ER_LC 27 /* special object type for DRM */
-
-/* header types */
-#define RAW 0
-#define ADIF 1
-#define ADTS 2
-
-/* SBR signalling */
-#define NO_SBR 0
-#define SBR_UPSAMPLED 1
-#define SBR_DOWNSAMPLED 2
-#define NO_SBR_UPSAMPLED 3
-
-/* library output formats */
-#define FAAD_FMT_16BIT 1
-#define FAAD_FMT_24BIT 2
-#define FAAD_FMT_32BIT 3
-#define FAAD_FMT_FLOAT 4
-#define FAAD_FMT_DOUBLE 5
-
-/* Capabilities */
-#define LC_DEC_CAP (1<<0) /* Can decode LC */
-#define MAIN_DEC_CAP (1<<1) /* Can decode MAIN */
-#define LTP_DEC_CAP (1<<2) /* Can decode LTP */
-#define LD_DEC_CAP (1<<3) /* Can decode LD */
-#define ERROR_RESILIENCE_CAP (1<<4) /* Can decode ER */
-#define FIXED_POINT_CAP (1<<5) /* Fixed point */
-
-/* Channel definitions */
-#define FRONT_CHANNEL_CENTER (1)
-#define FRONT_CHANNEL_LEFT (2)
-#define FRONT_CHANNEL_RIGHT (3)
-#define SIDE_CHANNEL_LEFT (4)
-#define SIDE_CHANNEL_RIGHT (5)
-#define BACK_CHANNEL_LEFT (6)
-#define BACK_CHANNEL_RIGHT (7)
-#define BACK_CHANNEL_CENTER (8)
-#define LFE_CHANNEL (9)
-#define UNKNOWN_CHANNEL (0)
-
-/* DRM channel definitions */
-#define DRMCH_MONO 1
-#define DRMCH_STEREO 2
-#define DRMCH_SBR_MONO 3
-#define DRMCH_SBR_STEREO 4
-#define DRMCH_SBR_PS_STEREO 5
-
-
-/* A decode call can eat up to FAAD_MIN_STREAMSIZE bytes per decoded channel,
- so at least so much bytes per channel should be available in this stream */
-#define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */
-
-
-typedef void *NeAACDecHandle;
-
-typedef struct mp4AudioSpecificConfig
-{
- /* Audio Specific Info */
- unsigned char objectTypeIndex;
- unsigned char samplingFrequencyIndex;
- unsigned long samplingFrequency;
- unsigned char channelsConfiguration;
-
- /* GA Specific Info */
- unsigned char frameLengthFlag;
- unsigned char dependsOnCoreCoder;
- unsigned short coreCoderDelay;
- unsigned char extensionFlag;
- unsigned char aacSectionDataResilienceFlag;
- unsigned char aacScalefactorDataResilienceFlag;
- unsigned char aacSpectralDataResilienceFlag;
- unsigned char epConfig;
-
- char sbr_present_flag;
- char forceUpSampling;
- char downSampledSBR;
-} mp4AudioSpecificConfig;
-
-typedef struct NeAACDecConfiguration
-{
- unsigned char defObjectType;
- unsigned long defSampleRate;
- unsigned char outputFormat;
- unsigned char downMatrix;
- unsigned char useOldADTSFormat;
- unsigned char dontUpSampleImplicitSBR;
-} NeAACDecConfiguration, *NeAACDecConfigurationPtr;
-
-typedef struct NeAACDecFrameInfo
-{
- unsigned long bytesconsumed;
- unsigned long samples;
- unsigned char channels;
- unsigned char error;
- unsigned long samplerate;
-
- /* SBR: 0: off, 1: on; upsample, 2: on; downsampled, 3: off; upsampled */
- unsigned char sbr;
-
- /* MPEG-4 ObjectType */
- unsigned char object_type;
-
- /* AAC header type; MP4 will be signalled as RAW also */
- unsigned char header_type;
-
- /* multichannel configuration */
- unsigned char num_front_channels;
- unsigned char num_side_channels;
- unsigned char num_back_channels;
- unsigned char num_lfe_channels;
- unsigned char channel_position[64];
-} NeAACDecFrameInfo;
-
-char* NEAACDECAPI NeAACDecGetErrorMessage(unsigned char errcode);
-
-unsigned long NEAACDECAPI NeAACDecGetCapabilities(void);
-
-NeAACDecHandle NEAACDECAPI NeAACDecOpen(void);
-
-NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
-
-unsigned char NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
- NeAACDecConfigurationPtr config);
-
-/* Init the library based on info from the AAC file (ADTS/ADIF) */
-long NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder,
- unsigned char *buffer,
- unsigned long buffer_size,
- unsigned long *samplerate,
- unsigned char *channels);
-
-/* Init the library using a DecoderSpecificInfo */
-char NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, unsigned char *pBuffer,
- unsigned long SizeOfDecoderSpecificInfo,
- unsigned long *samplerate, unsigned char *channels);
-
-/* Init the library for DRM */
-char NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle hDecoder, unsigned long samplerate,
- unsigned char channels);
-
-void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame);
-
-void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder);
-
-void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
- NeAACDecFrameInfo *hInfo,
- unsigned char *buffer,
- unsigned long buffer_size);
-
-char NEAACDECAPI NeAACDecAudioSpecificConfig(unsigned char *pBuffer,
- unsigned long buffer_size,
- mp4AudioSpecificConfig *mp4ASC);
-
-#ifdef _WIN32
- #pragma pack(pop)
-#endif
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif
+/* Backwards compatible link */
+#include "neaacdec.h"
--- /dev/null
+++ b/include/neaacdec.h
@@ -1,0 +1,241 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+**
+** Any non-GPL usage of this software or parts of this software is strictly
+** forbidden.
+**
+** Commercial non-GPL licensing of this software is possible.
+** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
+**
+** $Id: neaacdec.h,v 1.1 2004/03/04 19:06:01 menno Exp $
+**/
+
+#ifndef __NEAACDEC_H__
+#define __NEAACDEC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#if 1
+/* MACROS FOR BACKWARDS COMPATIBILITY */
+/* structs */
+#define faacDecHandle NeAACDecHandle
+#define faacDecConfiguration NeAACDecConfiguration
+#define faacDecConfigurationPtr NeAACDecConfigurationPtr
+#define faacDecFrameInfo NeAACDecFrameInfo
+/* functions */
+#define faacDecGetErrorMessage NeAACDecGetErrorMessage
+#define faacDecSetConfiguration NeAACDecSetConfiguration
+#define faacDecGetCurrentConfiguration NeAACDecGetCurrentConfiguration
+#define faacDecInit NeAACDecInit
+#define faacDecInit2 NeAACDecInit2
+#define faacDecInitDRM NeAACDecInitDRM
+#define faacDecPostSeekReset NeAACDecPostSeekReset
+#define faacDecOpen NeAACDecOpen
+#define faacDecClose NeAACDecClose
+#define faacDecDecode NeAACDecDecode
+#define AudioSpecificConfig NeAACDecAudioSpecificConfig
+#endif
+
+
+#ifdef _WIN32
+ #pragma pack(push, 8)
+ #ifndef NEAACDECAPI
+ #define NEAACDECAPI __cdecl
+ #endif
+#else
+ #ifndef NEAACDECAPI
+ #define NEAACDECAPI
+ #endif
+#endif
+
+#define FAAD2_VERSION "2.1 beta"
+
+/* object types for AAC */
+#define MAIN 1
+#define LC 2
+#define SSR 3
+#define LTP 4
+#define HE_AAC 5
+#define ER_LC 17
+#define ER_LTP 19
+#define LD 23
+#define DRM_ER_LC 27 /* special object type for DRM */
+
+/* header types */
+#define RAW 0
+#define ADIF 1
+#define ADTS 2
+
+/* SBR signalling */
+#define NO_SBR 0
+#define SBR_UPSAMPLED 1
+#define SBR_DOWNSAMPLED 2
+#define NO_SBR_UPSAMPLED 3
+
+/* library output formats */
+#define FAAD_FMT_16BIT 1
+#define FAAD_FMT_24BIT 2
+#define FAAD_FMT_32BIT 3
+#define FAAD_FMT_FLOAT 4
+#define FAAD_FMT_DOUBLE 5
+
+/* Capabilities */
+#define LC_DEC_CAP (1<<0) /* Can decode LC */
+#define MAIN_DEC_CAP (1<<1) /* Can decode MAIN */
+#define LTP_DEC_CAP (1<<2) /* Can decode LTP */
+#define LD_DEC_CAP (1<<3) /* Can decode LD */
+#define ERROR_RESILIENCE_CAP (1<<4) /* Can decode ER */
+#define FIXED_POINT_CAP (1<<5) /* Fixed point */
+
+/* Channel definitions */
+#define FRONT_CHANNEL_CENTER (1)
+#define FRONT_CHANNEL_LEFT (2)
+#define FRONT_CHANNEL_RIGHT (3)
+#define SIDE_CHANNEL_LEFT (4)
+#define SIDE_CHANNEL_RIGHT (5)
+#define BACK_CHANNEL_LEFT (6)
+#define BACK_CHANNEL_RIGHT (7)
+#define BACK_CHANNEL_CENTER (8)
+#define LFE_CHANNEL (9)
+#define UNKNOWN_CHANNEL (0)
+
+/* DRM channel definitions */
+#define DRMCH_MONO 1
+#define DRMCH_STEREO 2
+#define DRMCH_SBR_MONO 3
+#define DRMCH_SBR_STEREO 4
+#define DRMCH_SBR_PS_STEREO 5
+
+
+/* A decode call can eat up to FAAD_MIN_STREAMSIZE bytes per decoded channel,
+ so at least so much bytes per channel should be available in this stream */
+#define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */
+
+
+typedef void *NeAACDecHandle;
+
+typedef struct mp4AudioSpecificConfig
+{
+ /* Audio Specific Info */
+ unsigned char objectTypeIndex;
+ unsigned char samplingFrequencyIndex;
+ unsigned long samplingFrequency;
+ unsigned char channelsConfiguration;
+
+ /* GA Specific Info */
+ unsigned char frameLengthFlag;
+ unsigned char dependsOnCoreCoder;
+ unsigned short coreCoderDelay;
+ unsigned char extensionFlag;
+ unsigned char aacSectionDataResilienceFlag;
+ unsigned char aacScalefactorDataResilienceFlag;
+ unsigned char aacSpectralDataResilienceFlag;
+ unsigned char epConfig;
+
+ char sbr_present_flag;
+ char forceUpSampling;
+ char downSampledSBR;
+} mp4AudioSpecificConfig;
+
+typedef struct NeAACDecConfiguration
+{
+ unsigned char defObjectType;
+ unsigned long defSampleRate;
+ unsigned char outputFormat;
+ unsigned char downMatrix;
+ unsigned char useOldADTSFormat;
+ unsigned char dontUpSampleImplicitSBR;
+} NeAACDecConfiguration, *NeAACDecConfigurationPtr;
+
+typedef struct NeAACDecFrameInfo
+{
+ unsigned long bytesconsumed;
+ unsigned long samples;
+ unsigned char channels;
+ unsigned char error;
+ unsigned long samplerate;
+
+ /* SBR: 0: off, 1: on; upsample, 2: on; downsampled, 3: off; upsampled */
+ unsigned char sbr;
+
+ /* MPEG-4 ObjectType */
+ unsigned char object_type;
+
+ /* AAC header type; MP4 will be signalled as RAW also */
+ unsigned char header_type;
+
+ /* multichannel configuration */
+ unsigned char num_front_channels;
+ unsigned char num_side_channels;
+ unsigned char num_back_channels;
+ unsigned char num_lfe_channels;
+ unsigned char channel_position[64];
+} NeAACDecFrameInfo;
+
+char* NEAACDECAPI NeAACDecGetErrorMessage(unsigned char errcode);
+
+unsigned long NEAACDECAPI NeAACDecGetCapabilities(void);
+
+NeAACDecHandle NEAACDECAPI NeAACDecOpen(void);
+
+NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
+
+unsigned char NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
+ NeAACDecConfigurationPtr config);
+
+/* Init the library based on info from the AAC file (ADTS/ADIF) */
+long NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder,
+ unsigned char *buffer,
+ unsigned long buffer_size,
+ unsigned long *samplerate,
+ unsigned char *channels);
+
+/* Init the library using a DecoderSpecificInfo */
+char NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, unsigned char *pBuffer,
+ unsigned long SizeOfDecoderSpecificInfo,
+ unsigned long *samplerate, unsigned char *channels);
+
+/* Init the library for DRM */
+char NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle hDecoder, unsigned long samplerate,
+ unsigned char channels);
+
+void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame);
+
+void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder);
+
+void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
+ NeAACDecFrameInfo *hInfo,
+ unsigned char *buffer,
+ unsigned long buffer_size);
+
+char NEAACDECAPI NeAACDecAudioSpecificConfig(unsigned char *pBuffer,
+ unsigned long buffer_size,
+ mp4AudioSpecificConfig *mp4ASC);
+
+#ifdef _WIN32
+ #pragma pack(pop)
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
--- a/libfaad/common.h
+++ b/libfaad/common.h
@@ -1,19 +1,19 @@
/*
** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
+**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
-**
+**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
-**
+**
** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
+** 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
@@ -22,7 +22,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: common.h,v 1.51 2004/02/26 09:29:26 menno Exp $
+** $Id: common.h,v 1.52 2004/03/04 19:06:01 menno Exp $
**/
#ifndef __COMMON_H__
@@ -110,9 +110,6 @@
# endif
# ifdef SBR_DEC
# undef SBR_DEC
-# endif
-# ifndef SBR_LOW_POWER
-# define SBR_LOW_POWER
# endif
#endif // FIXED_POINT
--- a/libfaad/decoder.c
+++ b/libfaad/decoder.c
@@ -22,7 +22,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: decoder.c,v 1.97 2004/03/02 20:09:58 menno Exp $
+** $Id: decoder.c,v 1.98 2004/03/04 19:06:01 menno Exp $
**/
#include "common.h"
@@ -50,7 +50,7 @@
uint16_t dbg_count;
#endif
-int8_t* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode)
+char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode)
{
if (errcode >= NUM_ERROR_MESSAGES)
return NULL;
--- a/libfaad/decoder.h
+++ b/libfaad/decoder.h
@@ -22,7 +22,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: decoder.h,v 1.37 2004/03/02 20:09:58 menno Exp $
+** $Id: decoder.h,v 1.39 2004/03/10 19:45:41 menno Exp $
**/
#ifndef __DECODER_H__
@@ -69,7 +69,7 @@
#define LFE_CHANNEL (9)
#define UNKNOWN_CHANNEL (0)
-int8_t* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode);
+char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode);
uint32_t NEAACDECAPI NeAACDecGetCapabilities(void);
--- a/libfaad/error.c
+++ b/libfaad/error.c
@@ -22,13 +22,13 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: error.c,v 1.22 2004/02/26 09:29:26 menno Exp $
+** $Id: error.c,v 1.24 2004/03/10 19:45:41 menno Exp $
**/
#include "common.h"
#include "error.h"
-int8_t *err_msg[] = {
+char *err_msg[] = {
"No error",
"Gain control not yet implemented",
"Pulse coding not allowed in short blocks",
--- a/libfaad/error.h
+++ b/libfaad/error.h
@@ -22,7 +22,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: error.h,v 1.16 2004/01/28 19:17:25 menno Exp $
+** $Id: error.h,v 1.18 2004/03/10 19:45:41 menno Exp $
**/
#ifndef __ERROR_H__
@@ -33,7 +33,7 @@
#endif
#define NUM_ERROR_MESSAGES 26
-extern int8_t *err_msg[];
+extern char *err_msg[];
#ifdef __cplusplus
}
--- a/libfaad/sbr_dec.h
+++ b/libfaad/sbr_dec.h
@@ -22,7 +22,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: sbr_dec.h,v 1.25 2004/03/02 19:37:26 menno Exp $
+** $Id: sbr_dec.h,v 1.26 2004/03/04 19:06:01 menno Exp $
**/
#ifndef __SBR_DEC_H__
@@ -111,6 +111,9 @@
int16_t E_prev[2][64];
real_t E_orig[2][64][5];
real_t E_curr[2][64][5];
+#ifdef FIXED_POINT
+ uint8_t E_curr_is_coef[2][64][5];
+#endif
int32_t Q[2][64][2];
real_t Q_div[2][64][2];
real_t Q_div2[2][64][2];
--- a/plugins/in_mp4/in_mp4.c
+++ b/plugins/in_mp4/in_mp4.c
@@ -22,7 +22,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: in_mp4.c,v 1.50 2004/01/05 20:03:29 menno Exp $
+** $Id: in_mp4.c,v 1.51 2004/03/04 19:06:01 menno Exp $
**/
//#define DEBUG_OUTPUT
@@ -33,7 +33,7 @@
#include <commdlg.h>
#include <stdlib.h>
#include <math.h>
-#include <faad.h>
+#include <neaacdec.h>
#include <mp4.h>
#include "resource.h"
@@ -84,7 +84,7 @@
typedef struct state
{
/* general stuff */
- faacDecHandle hDecoder;
+ NeAACDecHandle hDecoder;
int samplerate;
unsigned char channels;
double decode_pos_ms; // current decoding position, in milliseconds
@@ -130,7 +130,7 @@
HANDLE play_thread_handle = INVALID_HANDLE_VALUE; // the handle to the decode thread
/* Function definitions */
-void *decode_aac_frame(state *st, faacDecFrameInfo *frameInfo);
+void *decode_aac_frame(state *st, NeAACDecFrameInfo *frameInfo);
DWORD WINAPI MP4PlayThread(void *b); // the decode thread procedure
DWORD WINAPI AACPlayThread(void *b); // the decode thread procedure
@@ -1460,7 +1460,7 @@
int avg_bitrate, br, sr;
unsigned char *buffer;
int buffer_size;
- faacDecConfigurationPtr config;
+ NeAACDecConfigurationPtr config;
#ifdef DEBUG_OUTPUT
in_mp4_DebugOutput("play");
@@ -1484,7 +1484,7 @@
int bread = 0;
double length = 0.;
__int64 bitrate = 128;
- faacDecFrameInfo frameInfo;
+ NeAACDecFrameInfo frameInfo;
module.is_seekable = 1;
@@ -1505,7 +1505,7 @@
for (init=0; init<2; init++)
{
- mp4state.hDecoder = faacDecOpen();
+ mp4state.hDecoder = NeAACDecOpen();
if (!mp4state.hDecoder)
{
show_error(module.hMainWindow, "Unable to open decoder library.");
@@ -1512,10 +1512,10 @@
return -1;
}
- config = faacDecGetCurrentConfiguration(mp4state.hDecoder);
+ config = NeAACDecGetCurrentConfiguration(mp4state.hDecoder);
config->outputFormat = m_resolution + 1;
config->downMatrix = m_downmix;
- faacDecSetConfiguration(mp4state.hDecoder, config);
+ NeAACDecSetConfiguration(mp4state.hDecoder, config);
memset(mp4state.m_aac_buffer, 0, 768*6);
bread = fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile);
@@ -1526,11 +1526,11 @@
if (init==0)
{
- faacDecFrameInfo frameInfo;
+ NeAACDecFrameInfo frameInfo;
fill_buffer(&mp4state);
- if ((mp4state.m_aac_bytes_consumed = faacDecInit(mp4state.hDecoder,
+ if ((mp4state.m_aac_bytes_consumed = NeAACDecInit(mp4state.hDecoder,
mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer,
&mp4state.samplerate, &mp4state.channels)) < 0)
{
@@ -1540,14 +1540,14 @@
advance_buffer(&mp4state, mp4state.m_aac_bytes_consumed);
do {
- memset(&frameInfo, 0, sizeof(faacDecFrameInfo));
+ memset(&frameInfo, 0, sizeof(NeAACDecFrameInfo));
fill_buffer(&mp4state);
- faacDecDecode(mp4state.hDecoder, &frameInfo, mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer);
+ NeAACDecDecode(mp4state.hDecoder, &frameInfo, mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer);
} while (!frameInfo.samples && !frameInfo.error);
if (frameInfo.error)
{
- show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error));
+ show_error(module.hMainWindow, NeAACDecGetErrorMessage(frameInfo.error));
return -1;
}
@@ -1560,7 +1560,7 @@
header_type = frameInfo.header_type;
*/
- faacDecClose(mp4state.hDecoder);
+ NeAACDecClose(mp4state.hDecoder);
fseek(mp4state.aacfile, tagsize, SEEK_SET);
}
}
@@ -1614,7 +1614,7 @@
mp4state.m_length = (int)(length*1000.);
fill_buffer(&mp4state);
- if ((mp4state.m_aac_bytes_consumed = faacDecInit(mp4state.hDecoder,
+ if ((mp4state.m_aac_bytes_consumed = NeAACDecInit(mp4state.hDecoder,
mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer,
&mp4state.samplerate, &mp4state.channels)) < 0)
{
@@ -1628,7 +1628,7 @@
else
avg_bitrate = bitrate*1000;
} else {
- mp4state.hDecoder = faacDecOpen();
+ mp4state.hDecoder = NeAACDecOpen();
if (!mp4state.hDecoder)
{
show_error(module.hMainWindow, "Unable to open decoder library.");
@@ -1635,16 +1635,16 @@
return -1;
}
- config = faacDecGetCurrentConfiguration(mp4state.hDecoder);
+ config = NeAACDecGetCurrentConfiguration(mp4state.hDecoder);
config->outputFormat = m_resolution + 1;
config->downMatrix = m_downmix;
- faacDecSetConfiguration(mp4state.hDecoder, config);
+ NeAACDecSetConfiguration(mp4state.hDecoder, config);
mp4state.mp4file = MP4Read(mp4state.filename, 0);
if (!mp4state.mp4file)
{
show_error(module.hMainWindow, "Unable to open file.");
- faacDecClose(mp4state.hDecoder);
+ NeAACDecClose(mp4state.hDecoder);
return -1;
}
@@ -1651,7 +1651,7 @@
if ((mp4state.mp4track = GetAACTrack(mp4state.mp4file)) < 0)
{
show_error(module.hMainWindow, "Unsupported Audio track type.");
- faacDecClose(mp4state.hDecoder);
+ NeAACDecClose(mp4state.hDecoder);
MP4Close(mp4state.mp4file);
return -1;
}
@@ -1662,16 +1662,16 @@
&buffer, &buffer_size);
if (!buffer)
{
- faacDecClose(mp4state.hDecoder);
+ NeAACDecClose(mp4state.hDecoder);
MP4Close(mp4state.mp4file);
return -1;
}
- if(faacDecInit2(mp4state.hDecoder, buffer, buffer_size,
+ if(NeAACDecInit2(mp4state.hDecoder, buffer, buffer_size,
&mp4state.samplerate, &mp4state.channels) < 0)
{
/* If some error initializing occured, skip the file */
- faacDecClose(mp4state.hDecoder);
+ NeAACDecClose(mp4state.hDecoder);
MP4Close(mp4state.mp4file);
if (buffer) free (buffer);
return -1;
@@ -1687,7 +1687,7 @@
if (buffer)
{
- if (AudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0)
+ if (NeAACDecAudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0)
{
if (mp4ASC.frameLengthFlag == 1) mp4state.framesize = 960;
if (mp4ASC.sbr_present_flag == 1) mp4state.framesize *= 2;
@@ -1709,7 +1709,7 @@
if (mp4state.channels == 0)
{
show_error(module.hMainWindow, "Number of channels not supported for playback.");
- faacDecClose(mp4state.hDecoder);
+ NeAACDecClose(mp4state.hDecoder);
if (mp4state.filetype)
fclose(mp4state.aacfile);
else
@@ -1725,7 +1725,7 @@
if (maxlatency < 0) // error opening device
{
- faacDecClose(mp4state.hDecoder);
+ NeAACDecClose(mp4state.hDecoder);
if (mp4state.filetype)
fclose(mp4state.aacfile);
else
@@ -1755,7 +1755,7 @@
(void *)&killPlayThread, 0, &thread_id)) == NULL)
{
show_error(module.hMainWindow, "Cannot create playback thread");
- faacDecClose(mp4state.hDecoder);
+ NeAACDecClose(mp4state.hDecoder);
fclose(mp4state.aacfile);
return -1;
}
@@ -1764,7 +1764,7 @@
(void *)&killPlayThread, 0, &thread_id)) == NULL)
{
show_error(module.hMainWindow, "Cannot create playback thread");
- faacDecClose(mp4state.hDecoder);
+ NeAACDecClose(mp4state.hDecoder);
MP4Close(mp4state.mp4file);
return -1;
}
@@ -1852,7 +1852,7 @@
target = target->next;
if (tmp) free(tmp);
}
- faacDecClose(mp4state.hDecoder);
+ NeAACDecClose(mp4state.hDecoder);
if (mp4state.filetype)
fclose(mp4state.aacfile);
else
@@ -2165,7 +2165,7 @@
void *sample_buffer;
unsigned char *buffer;
int buffer_size;
- faacDecFrameInfo frameInfo;
+ NeAACDecFrameInfo frameInfo;
#ifdef DEBUG_OUTPUT
in_mp4_DebugOutput("MP4PlayThread");
@@ -2232,12 +2232,12 @@
sample_buffer = NULL;
frameInfo.samples = 0;
} else {
- sample_buffer = faacDecDecode(mp4state.hDecoder, &frameInfo,
+ sample_buffer = NeAACDecDecode(mp4state.hDecoder, &frameInfo,
buffer, buffer_size);
}
if (frameInfo.error > 0)
{
- show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error));
+ show_error(module.hMainWindow, NeAACDecGetErrorMessage(frameInfo.error));
mp4state.last_frame = 1;
}
if (mp4state.sampleId > mp4state.numSamples)
@@ -2350,7 +2350,7 @@
return 0;
}
-void *decode_aac_frame(state *st, faacDecFrameInfo *frameInfo)
+void *decode_aac_frame(state *st, NeAACDecFrameInfo *frameInfo)
{
void *sample_buffer = NULL;
@@ -2360,7 +2360,7 @@
if (st->m_aac_bytes_into_buffer != 0)
{
- sample_buffer = faacDecDecode(st->hDecoder, frameInfo,
+ sample_buffer = NeAACDecDecode(st->hDecoder, frameInfo,
st->m_aac_buffer, st->m_aac_bytes_into_buffer);
if (st->m_header_type != 1)
@@ -2416,13 +2416,13 @@
st->m_aac_bytes_consumed = 0;
st->m_file_offset += bread;
- faacDecPostSeekReset(st->hDecoder, -1);
+ NeAACDecPostSeekReset(st->hDecoder, -1);
return 1;
} else {
if (seconds > st->cur_pos_sec)
{
- faacDecFrameInfo frameInfo;
+ NeAACDecFrameInfo frameInfo;
frames = (int)((seconds - st->cur_pos_sec)*((double)st->samplerate/(double)st->framesize));
@@ -2430,7 +2430,7 @@
{
for (i = 0; i < frames; i++)
{
- memset(&frameInfo, 0, sizeof(faacDecFrameInfo));
+ memset(&frameInfo, 0, sizeof(NeAACDecFrameInfo));
decode_aac_frame(st, &frameInfo);
if (frameInfo.error || (st->m_aac_bytes_into_buffer == 0))
@@ -2437,8 +2437,8 @@
{
if (frameInfo.error)
{
- if (faacDecGetErrorMessage(frameInfo.error) != NULL)
- show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error));
+ if (NeAACDecGetErrorMessage(frameInfo.error) != NULL)
+ show_error(module.hMainWindow, NeAACDecGetErrorMessage(frameInfo.error));
}
return 0;
}
@@ -2445,7 +2445,7 @@
}
}
- faacDecPostSeekReset(st->hDecoder, -1);
+ NeAACDecPostSeekReset(st->hDecoder, -1);
}
return 1;
}
@@ -2495,10 +2495,10 @@
Sleep(10);
} else if (module.outMod->CanWrite() >= (2048*mp4state.channels*sizeof(short))) {
- faacDecFrameInfo frameInfo;
+ NeAACDecFrameInfo frameInfo;
void *sample_buffer;
- memset(&frameInfo, 0, sizeof(faacDecFrameInfo));
+ memset(&frameInfo, 0, sizeof(NeAACDecFrameInfo));
sample_buffer = decode_aac_frame(&mp4state, &frameInfo);
@@ -2506,8 +2506,8 @@
{
if (frameInfo.error)
{
- if (faacDecGetErrorMessage(frameInfo.error) != NULL)
- show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error));
+ if (NeAACDecGetErrorMessage(frameInfo.error) != NULL)
+ show_error(module.hMainWindow, NeAACDecGetErrorMessage(frameInfo.error));
}
done = 1;
}
--- a/plugins/in_mp4/in_mp4.dsp
+++ b/plugins/in_mp4/in_mp4.dsp
@@ -124,11 +124,11 @@
# End Source File
# Begin Source File
-SOURCE=..\..\include\faad.h
+SOURCE=.\in2.h
# End Source File
# Begin Source File
-SOURCE=.\in2.h
+SOURCE=..\..\include\neaacdec.h
# End Source File
# Begin Source File
--- a/plugins/in_mp4/utils.c
+++ b/plugins/in_mp4/utils.c
@@ -22,13 +22,13 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: utils.c,v 1.6 2003/07/29 08:20:14 menno Exp $
+** $Id: utils.c,v 1.7 2004/03/04 19:06:01 menno Exp $
**/
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <mp4.h>
-#include <faad.h>
+#include <neaacdec.h>
#include "utils.h"
int StringComp(char const *str1, char const *str2, unsigned long len)