00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __NEAACDEC_H__
00034 #define __NEAACDEC_H__
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00040
00041 #if 1
00042
00043
00044 #define faacDecHandle NeAACDecHandle
00045 #define faacDecConfiguration NeAACDecConfiguration
00046 #define faacDecConfigurationPtr NeAACDecConfigurationPtr
00047 #define faacDecFrameInfo NeAACDecFrameInfo
00048
00049 #define faacDecGetErrorMessage NeAACDecGetErrorMessage
00050 #define faacDecSetConfiguration NeAACDecSetConfiguration
00051 #define faacDecGetCurrentConfiguration NeAACDecGetCurrentConfiguration
00052 #define faacDecInit NeAACDecInit
00053 #define faacDecInit2 NeAACDecInit2
00054 #define faacDecInitDRM NeAACDecInitDRM
00055 #define faacDecPostSeekReset NeAACDecPostSeekReset
00056 #define faacDecOpen NeAACDecOpen
00057 #define faacDecClose NeAACDecClose
00058 #define faacDecDecode NeAACDecDecode
00059 #define AudioSpecificConfig NeAACDecAudioSpecificConfig
00060 #endif
00061
00062
00063 #ifdef _WIN32
00064 #pragma pack(push, 8)
00065 #ifndef NEAACDECAPI
00066 #define NEAACDECAPI __cdecl
00067 #endif
00068 #else
00069 #ifndef NEAACDECAPI
00070 #define NEAACDECAPI
00071 #endif
00072 #endif
00073
00074 #define FAAD2_VERSION "2.1 beta"
00075
00076
00077 #define MAIN 1
00078 #define LC 2
00079 #define SSR 3
00080 #define LTP 4
00081 #define HE_AAC 5
00082 #define ER_LC 17
00083 #define ER_LTP 19
00084 #define LD 23
00085 #define DRM_ER_LC 27
00086
00087
00088 #define RAW 0
00089 #define ADIF 1
00090 #define ADTS 2
00091
00092
00093 #define NO_SBR 0
00094 #define SBR_UPSAMPLED 1
00095 #define SBR_DOWNSAMPLED 2
00096 #define NO_SBR_UPSAMPLED 3
00097
00098
00099 #define FAAD_FMT_16BIT 1
00100 #define FAAD_FMT_24BIT 2
00101 #define FAAD_FMT_32BIT 3
00102 #define FAAD_FMT_FLOAT 4
00103 #define FAAD_FMT_FIXED FAAD_FMT_FLOAT
00104 #define FAAD_FMT_DOUBLE 5
00105
00106
00107 #define LC_DEC_CAP (1<<0)
00108 #define MAIN_DEC_CAP (1<<1)
00109 #define LTP_DEC_CAP (1<<2)
00110 #define LD_DEC_CAP (1<<3)
00111 #define ERROR_RESILIENCE_CAP (1<<4)
00112 #define FIXED_POINT_CAP (1<<5)
00113
00114
00115 #define FRONT_CHANNEL_CENTER (1)
00116 #define FRONT_CHANNEL_LEFT (2)
00117 #define FRONT_CHANNEL_RIGHT (3)
00118 #define SIDE_CHANNEL_LEFT (4)
00119 #define SIDE_CHANNEL_RIGHT (5)
00120 #define BACK_CHANNEL_LEFT (6)
00121 #define BACK_CHANNEL_RIGHT (7)
00122 #define BACK_CHANNEL_CENTER (8)
00123 #define LFE_CHANNEL (9)
00124 #define UNKNOWN_CHANNEL (0)
00125
00126
00127 #define DRMCH_MONO 1
00128 #define DRMCH_STEREO 2
00129 #define DRMCH_SBR_MONO 3
00130 #define DRMCH_SBR_STEREO 4
00131 #define DRMCH_SBR_PS_STEREO 5
00132
00133
00134
00135
00136 #define FAAD_MIN_STREAMSIZE 768
00137
00138
00139 typedef void *NeAACDecHandle;
00140
00141 typedef struct mp4AudioSpecificConfig
00142 {
00143
00144 unsigned char objectTypeIndex;
00145 unsigned char samplingFrequencyIndex;
00146 unsigned long samplingFrequency;
00147 unsigned char channelsConfiguration;
00148
00149
00150 unsigned char frameLengthFlag;
00151 unsigned char dependsOnCoreCoder;
00152 unsigned short coreCoderDelay;
00153 unsigned char extensionFlag;
00154 unsigned char aacSectionDataResilienceFlag;
00155 unsigned char aacScalefactorDataResilienceFlag;
00156 unsigned char aacSpectralDataResilienceFlag;
00157 unsigned char epConfig;
00158
00159 char sbr_present_flag;
00160 char forceUpSampling;
00161 char downSampledSBR;
00162 } mp4AudioSpecificConfig;
00163
00164 typedef struct NeAACDecConfiguration
00165 {
00166 unsigned char defObjectType;
00167 unsigned long defSampleRate;
00168 unsigned char outputFormat;
00169 unsigned char downMatrix;
00170 unsigned char useOldADTSFormat;
00171 unsigned char dontUpSampleImplicitSBR;
00172 } NeAACDecConfiguration, *NeAACDecConfigurationPtr;
00173
00174 typedef struct NeAACDecFrameInfo
00175 {
00176 unsigned long bytesconsumed;
00177 unsigned long samples;
00178 unsigned char channels;
00179 unsigned char error;
00180 unsigned long samplerate;
00181
00182
00183 unsigned char sbr;
00184
00185
00186 unsigned char object_type;
00187
00188
00189 unsigned char header_type;
00190
00191
00192 unsigned char num_front_channels;
00193 unsigned char num_side_channels;
00194 unsigned char num_back_channels;
00195 unsigned char num_lfe_channels;
00196 unsigned char channel_position[64];
00197
00198
00199 unsigned char ps;
00200 } NeAACDecFrameInfo;
00201
00202 char* NEAACDECAPI NeAACDecGetErrorMessage(unsigned char errcode);
00203
00204 unsigned long NEAACDECAPI NeAACDecGetCapabilities(void);
00205
00206 NeAACDecHandle NEAACDECAPI NeAACDecOpen(void);
00207
00208 NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
00209
00210 unsigned char NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
00211 NeAACDecConfigurationPtr config);
00212
00213
00214 long NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder,
00215 unsigned char *buffer,
00216 unsigned long buffer_size,
00217 unsigned long *samplerate,
00218 unsigned char *channels);
00219
00220
00221 char NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, unsigned char *pBuffer,
00222 unsigned long SizeOfDecoderSpecificInfo,
00223 unsigned long *samplerate, unsigned char *channels);
00224
00225
00226 char NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate,
00227 unsigned char channels);
00228
00229 void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame);
00230
00231 void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder);
00232
00233 void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
00234 NeAACDecFrameInfo *hInfo,
00235 unsigned char *buffer,
00236 unsigned long buffer_size);
00237
00238 void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder,
00239 NeAACDecFrameInfo *hInfo,
00240 unsigned char *buffer,
00241 unsigned long buffer_size,
00242 void **sample_buffer,
00243 unsigned long sample_buffer_size);
00244
00245 char NEAACDECAPI NeAACDecAudioSpecificConfig(unsigned char *pBuffer,
00246 unsigned long buffer_size,
00247 mp4AudioSpecificConfig *mp4ASC);
00248
00249 #ifdef _WIN32
00250 #pragma pack(pop)
00251 #endif
00252
00253 #ifdef __cplusplus
00254 }
00255 #endif
00256
00257 #endif