Mercurial > mplayer.hg
annotate libfaad2/faad.h @ 12656:ecc8c794f000
static tables
author | alex |
---|---|
date | Fri, 25 Jun 2004 17:03:59 +0000 |
parents | d81145997036 |
children | 6d50ef45a058 |
rev | line source |
---|---|
10725 | 1 /* |
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding | |
3 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com | |
10989 | 4 ** |
10725 | 5 ** This program is free software; you can redistribute it and/or modify |
6 ** it under the terms of the GNU General Public License as published by | |
7 ** the Free Software Foundation; either version 2 of the License, or | |
8 ** (at your option) any later version. | |
10989 | 9 ** |
10725 | 10 ** This program is distributed in the hope that it will be useful, |
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 ** GNU General Public License for more details. | |
10989 | 14 ** |
10725 | 15 ** You should have received a copy of the GNU General Public License |
10989 | 16 ** along with this program; if not, write to the Free Software |
10725 | 17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 ** | |
19 ** Any non-GPL usage of this software or parts of this software is strictly | |
20 ** forbidden. | |
21 ** | |
22 ** Commercial non-GPL licensing of this software is possible. | |
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
24 ** | |
12625
d81145997036
More information about modifications to comply more closely with GPL 2a.
diego
parents:
12527
diff
changeset
|
25 ** Initially modified for use with MPlayer by Arpad Gereöffy on 2003/08/30 |
d81145997036
More information about modifications to comply more closely with GPL 2a.
diego
parents:
12527
diff
changeset
|
26 ** $Id: faad.h,v 1.3 2004/06/02 22:59:02 diego Exp $ |
d81145997036
More information about modifications to comply more closely with GPL 2a.
diego
parents:
12527
diff
changeset
|
27 ** detailed CVS changelog at http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/ |
10725 | 28 **/ |
29 | |
30 #ifndef __AACDEC_H__ | |
31 #define __AACDEC_H__ | |
32 | |
33 #ifdef __cplusplus | |
34 extern "C" { | |
35 #endif /* __cplusplus */ | |
36 | |
37 #ifdef _WIN32 | |
38 #pragma pack(push, 8) | |
39 #ifndef FAADAPI | |
40 #define FAADAPI __cdecl | |
41 #endif | |
42 #else | |
43 #ifndef FAADAPI | |
44 #define FAADAPI | |
45 #endif | |
46 #endif | |
47 | |
12527 | 48 #define FAAD2_VERSION "2.0" |
10725 | 49 |
50 /* object types for AAC */ | |
10989 | 51 #define MAIN 1 |
52 #define LC 2 | |
53 #define SSR 3 | |
54 #define LTP 4 | |
55 #define HE_AAC 5 | |
10725 | 56 #define ER_LC 17 |
57 #define ER_LTP 19 | |
58 #define LD 23 | |
59 #define DRM_ER_LC 27 /* special object type for DRM */ | |
60 | |
61 /* header types */ | |
62 #define RAW 0 | |
63 #define ADIF 1 | |
64 #define ADTS 2 | |
65 | |
10989 | 66 /* SBR signalling */ |
67 #define NO_SBR 0 | |
68 #define SBR_UPSAMPLED 1 | |
69 #define SBR_DOWNSAMPLED 2 | |
70 #define NO_SBR_UPSAMPLED 3 | |
71 | |
10725 | 72 /* library output formats */ |
73 #define FAAD_FMT_16BIT 1 | |
74 #define FAAD_FMT_24BIT 2 | |
75 #define FAAD_FMT_32BIT 3 | |
76 #define FAAD_FMT_FLOAT 4 | |
77 #define FAAD_FMT_DOUBLE 5 | |
78 #define FAAD_FMT_16BIT_DITHER 6 | |
79 #define FAAD_FMT_16BIT_L_SHAPE 7 | |
80 #define FAAD_FMT_16BIT_M_SHAPE 8 | |
81 #define FAAD_FMT_16BIT_H_SHAPE 9 | |
82 | |
83 /* Capabilities */ | |
84 #define LC_DEC_CAP (1<<0) | |
85 #define MAIN_DEC_CAP (1<<1) | |
86 #define LTP_DEC_CAP (1<<2) | |
87 #define LD_DEC_CAP (1<<3) | |
88 #define ERROR_RESILIENCE_CAP (1<<4) | |
89 #define FIXED_POINT_CAP (1<<5) | |
90 | |
91 /* Channel definitions */ | |
92 #define FRONT_CHANNEL_CENTER (1) | |
93 #define FRONT_CHANNEL_LEFT (2) | |
94 #define FRONT_CHANNEL_RIGHT (3) | |
95 #define SIDE_CHANNEL_LEFT (4) | |
96 #define SIDE_CHANNEL_RIGHT (5) | |
97 #define BACK_CHANNEL_LEFT (6) | |
98 #define BACK_CHANNEL_RIGHT (7) | |
99 #define BACK_CHANNEL_CENTER (8) | |
100 #define LFE_CHANNEL (9) | |
101 #define UNKNOWN_CHANNEL (0) | |
102 | |
10989 | 103 /* DRM channel definitions */ |
104 #define DRMCH_MONO 1 | |
105 #define DRMCH_STEREO 2 | |
106 #define DRMCH_SBR_MONO 3 | |
107 #define DRMCH_SBR_LC_STEREO 4 | |
108 #define DRMCH_SBR_STEREO 5 | |
109 | |
10725 | 110 |
111 /* A decode call can eat up to FAAD_MIN_STREAMSIZE bytes per decoded channel, | |
112 so at least so much bytes per channel should be available in this stream */ | |
113 #define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */ | |
114 | |
115 | |
116 typedef void *faacDecHandle; | |
117 | |
118 typedef struct mp4AudioSpecificConfig | |
119 { | |
120 /* Audio Specific Info */ | |
121 unsigned char objectTypeIndex; | |
122 unsigned char samplingFrequencyIndex; | |
123 unsigned long samplingFrequency; | |
124 unsigned char channelsConfiguration; | |
125 | |
126 /* GA Specific Info */ | |
127 unsigned char frameLengthFlag; | |
128 unsigned char dependsOnCoreCoder; | |
129 unsigned short coreCoderDelay; | |
130 unsigned char extensionFlag; | |
131 unsigned char aacSectionDataResilienceFlag; | |
132 unsigned char aacScalefactorDataResilienceFlag; | |
133 unsigned char aacSpectralDataResilienceFlag; | |
134 unsigned char epConfig; | |
135 | |
136 char sbr_present_flag; | |
10989 | 137 char forceUpSampling; |
10725 | 138 } mp4AudioSpecificConfig; |
139 | |
140 typedef struct faacDecConfiguration | |
141 { | |
142 unsigned char defObjectType; | |
143 unsigned long defSampleRate; | |
144 unsigned char outputFormat; | |
145 unsigned char downMatrix; | |
10989 | 146 unsigned char useOldADTSFormat; |
10725 | 147 } faacDecConfiguration, *faacDecConfigurationPtr; |
148 | |
149 typedef struct faacDecFrameInfo | |
150 { | |
151 unsigned long bytesconsumed; | |
152 unsigned long samples; | |
153 unsigned char channels; | |
154 unsigned char error; | |
155 unsigned long samplerate; | |
156 | |
10989 | 157 /* SBR: 0: off, 1: on; upsample, 2: on; downsampled, 3: off; upsampled */ |
158 unsigned char sbr; | |
159 | |
160 /* MPEG-4 ObjectType */ | |
161 unsigned char object_type; | |
162 | |
163 /* AAC header type; MP4 will be signalled as RAW also */ | |
164 unsigned char header_type; | |
165 | |
10725 | 166 /* multichannel configuration */ |
167 unsigned char num_front_channels; | |
168 unsigned char num_side_channels; | |
169 unsigned char num_back_channels; | |
170 unsigned char num_lfe_channels; | |
171 unsigned char channel_position[64]; | |
172 } faacDecFrameInfo; | |
173 | |
174 char* FAADAPI faacDecGetErrorMessage(unsigned char errcode); | |
175 | |
176 unsigned long FAADAPI faacDecGetCapabilities(); | |
177 | |
178 faacDecHandle FAADAPI faacDecOpen(); | |
179 | |
180 faacDecConfigurationPtr FAADAPI faacDecGetCurrentConfiguration(faacDecHandle hDecoder); | |
181 | |
182 unsigned char FAADAPI faacDecSetConfiguration(faacDecHandle hDecoder, | |
183 faacDecConfigurationPtr config); | |
184 | |
185 /* Init the library based on info from the AAC file (ADTS/ADIF) */ | |
186 long FAADAPI faacDecInit(faacDecHandle hDecoder, | |
187 unsigned char *buffer, | |
188 unsigned long buffer_size, | |
189 unsigned long *samplerate, | |
190 unsigned char *channels); | |
191 | |
192 /* Init the library using a DecoderSpecificInfo */ | |
193 char FAADAPI faacDecInit2(faacDecHandle hDecoder, unsigned char *pBuffer, | |
194 unsigned long SizeOfDecoderSpecificInfo, | |
195 unsigned long *samplerate, unsigned char *channels); | |
196 | |
197 /* Init the library for DRM */ | |
198 char FAADAPI faacDecInitDRM(faacDecHandle hDecoder, unsigned long samplerate, | |
199 unsigned char channels); | |
200 | |
10989 | 201 void FAADAPI faacDecPostSeekReset(faacDecHandle hDecoder, long frame); |
202 | |
10725 | 203 void FAADAPI faacDecClose(faacDecHandle hDecoder); |
204 | |
205 void* FAADAPI faacDecDecode(faacDecHandle hDecoder, | |
206 faacDecFrameInfo *hInfo, | |
207 unsigned char *buffer, | |
208 unsigned long buffer_size); | |
209 | |
210 char FAADAPI AudioSpecificConfig(unsigned char *pBuffer, | |
211 unsigned long buffer_size, | |
212 mp4AudioSpecificConfig *mp4ASC); | |
213 | |
214 #ifdef _WIN32 | |
215 #pragma pack(pop) | |
216 #endif | |
217 | |
218 #ifdef __cplusplus | |
219 } | |
220 #endif /* __cplusplus */ | |
221 | |
222 #endif |