diff options
Diffstat (limited to 'src/libfaad/faad.h')
-rw-r--r-- | src/libfaad/faad.h | 101 |
1 files changed, 76 insertions, 25 deletions
diff --git a/src/libfaad/faad.h b/src/libfaad/faad.h index 11c69777c..31f8e13f1 100644 --- a/src/libfaad/faad.h +++ b/src/libfaad/faad.h @@ -1,6 +1,6 @@ /* -** FAAD - Freeware Advanced Audio Decoder -** Copyright (C) 2002 M. Bakker +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -16,7 +16,13 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** -** $Id: faad.h,v 1.4 2003/08/25 21:51:41 f1rmb 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.5 2003/12/30 02:00:10 miguelfreitas Exp $ **/ #ifndef __AACDEC_H__ @@ -37,13 +43,14 @@ extern "C" { #endif #endif -#define FAAD2_VERSION "1.2 beta" +#define FAAD2_VERSION "2.0 RC3 " /* object types for AAC */ -#define MAIN 0 -#define LC 1 -#define SSR 2 -#define LTP 3 +#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 @@ -54,27 +61,49 @@ extern "C" { #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 -#define FAAD_FMT_16BIT_DITHER 6 -#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) -#define LTP_DEC_CAP (1<<2) -#define LD_DEC_CAP (1<<3) -#define ERROR_RESILIENCE_CAP (1<<4) -#define FIXED_POINT_CAP (1<<5) - -/* A decode call can eat up to FAAD_MIN_STREAMSIZE octets per decoded channel, - so at least so much octets per channel should be available in this stream */ +#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_LC_STEREO 4 +#define DRMCH_SBR_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 */ @@ -91,13 +120,15 @@ 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; + char forceUpSampling; } mp4AudioSpecificConfig; typedef struct faacDecConfiguration @@ -105,6 +136,8 @@ typedef struct faacDecConfiguration unsigned char defObjectType; unsigned long defSampleRate; unsigned char outputFormat; + unsigned char downMatrix; + unsigned char useOldADTSFormat; } faacDecConfiguration, *faacDecConfigurationPtr; typedef struct faacDecFrameInfo @@ -114,13 +147,29 @@ typedef struct faacDecFrameInfo 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]; } faacDecFrameInfo; char* FAADAPI faacDecGetErrorMessage(unsigned char errcode); -unsigned long FAADAPI faacDecGetCapabilities(void); +unsigned long FAADAPI faacDecGetCapabilities(); -faacDecHandle FAADAPI faacDecOpen(void); +faacDecHandle FAADAPI faacDecOpen(); faacDecConfigurationPtr FAADAPI faacDecGetCurrentConfiguration(faacDecHandle hDecoder); @@ -143,6 +192,8 @@ char FAADAPI faacDecInit2(faacDecHandle hDecoder, unsigned char *pBuffer, char FAADAPI faacDecInitDRM(faacDecHandle hDecoder, unsigned long samplerate, unsigned char channels); +void FAADAPI faacDecPostSeekReset(faacDecHandle hDecoder, long frame); + void FAADAPI faacDecClose(faacDecHandle hDecoder); void* FAADAPI faacDecDecode(faacDecHandle hDecoder, |