Mercurial > audlegacy-plugins
comparison src/aac/libfaad2/structs.h @ 12:3da1b8942b8b trunk
[svn] - remove src/Input src/Output src/Effect src/General src/Visualization src/Container
author | nenolod |
---|---|
date | Mon, 18 Sep 2006 03:14:20 -0700 |
parents | src/Input/aac/libfaad2/structs.h@13389e613d67 |
children | 1d8b08df98c3 |
comparison
equal
deleted
inserted
replaced
11:cff1d04026ae | 12:3da1b8942b8b |
---|---|
1 /* | |
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding | |
3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com | |
4 ** | |
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. | |
9 ** | |
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. | |
14 ** | |
15 ** You should have received a copy of the GNU General Public License | |
16 ** along with this program; if not, write to the Free Software | |
17 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ** | |
25 ** $Id: structs.h,v 1.42 2004/09/08 09:43:11 gcp Exp $ | |
26 **/ | |
27 | |
28 #ifndef __STRUCTS_H__ | |
29 #define __STRUCTS_H__ | |
30 | |
31 #ifdef __cplusplus | |
32 extern "C" { | |
33 #endif | |
34 | |
35 #include "cfft.h" | |
36 #ifdef SBR_DEC | |
37 #include "sbr_dec.h" | |
38 #endif | |
39 | |
40 #define MAX_CHANNELS 64 | |
41 #define MAX_SYNTAX_ELEMENTS 48 | |
42 #define MAX_WINDOW_GROUPS 8 | |
43 #define MAX_SFB 51 | |
44 #define MAX_LTP_SFB 40 | |
45 #define MAX_LTP_SFB_S 8 | |
46 | |
47 /* used to save the prediction state */ | |
48 typedef struct { | |
49 signed short r[2]; | |
50 signed short COR[2]; | |
51 signed short VAR[2]; | |
52 } pred_state; | |
53 | |
54 typedef struct { | |
55 unsigned short N; | |
56 cfft_info *cfft; | |
57 complex_t *sincos; | |
58 #ifdef PROFILE | |
59 int64_t cycles; | |
60 int64_t fft_cycles; | |
61 #endif | |
62 } mdct_info; | |
63 | |
64 typedef struct | |
65 { | |
66 const real_t *long_window[2]; | |
67 const real_t *short_window[2]; | |
68 #ifdef LD_DEC | |
69 const real_t *ld_window[2]; | |
70 #endif | |
71 | |
72 mdct_info *mdct256; | |
73 #ifdef LD_DEC | |
74 mdct_info *mdct1024; | |
75 #endif | |
76 mdct_info *mdct2048; | |
77 #ifdef PROFILE | |
78 int64_t cycles; | |
79 #endif | |
80 } fb_info; | |
81 | |
82 typedef struct | |
83 { | |
84 unsigned char present; | |
85 | |
86 unsigned char num_bands; | |
87 unsigned char pce_instance_tag; | |
88 unsigned char excluded_chns_present; | |
89 unsigned char band_top[17]; | |
90 unsigned char prog_ref_level; | |
91 unsigned char dyn_rng_sgn[17]; | |
92 unsigned char dyn_rng_ctl[17]; | |
93 unsigned char exclude_mask[MAX_CHANNELS]; | |
94 unsigned char additional_excluded_chns[MAX_CHANNELS]; | |
95 | |
96 real_t ctrl1; | |
97 real_t ctrl2; | |
98 } drc_info; | |
99 | |
100 typedef struct | |
101 { | |
102 unsigned char element_instance_tag; | |
103 unsigned char object_type; | |
104 unsigned char sf_index; | |
105 unsigned char num_front_channel_elements; | |
106 unsigned char num_side_channel_elements; | |
107 unsigned char num_back_channel_elements; | |
108 unsigned char num_lfe_channel_elements; | |
109 unsigned char num_assoc_data_elements; | |
110 unsigned char num_valid_cc_elements; | |
111 unsigned char mono_mixdown_present; | |
112 unsigned char mono_mixdown_element_number; | |
113 unsigned char stereo_mixdown_present; | |
114 unsigned char stereo_mixdown_element_number; | |
115 unsigned char matrix_mixdown_idx_present; | |
116 unsigned char pseudo_surround_enable; | |
117 unsigned char matrix_mixdown_idx; | |
118 unsigned char front_element_is_cpe[16]; | |
119 unsigned char front_element_tag_select[16]; | |
120 unsigned char side_element_is_cpe[16]; | |
121 unsigned char side_element_tag_select[16]; | |
122 unsigned char back_element_is_cpe[16]; | |
123 unsigned char back_element_tag_select[16]; | |
124 unsigned char lfe_element_tag_select[16]; | |
125 unsigned char assoc_data_element_tag_select[16]; | |
126 unsigned char cc_element_is_ind_sw[16]; | |
127 unsigned char valid_cc_element_tag_select[16]; | |
128 | |
129 unsigned char channels; | |
130 | |
131 unsigned char comment_field_bytes; | |
132 unsigned char comment_field_data[257]; | |
133 | |
134 /* extra added values */ | |
135 unsigned char num_front_channels; | |
136 unsigned char num_side_channels; | |
137 unsigned char num_back_channels; | |
138 unsigned char num_lfe_channels; | |
139 unsigned char sce_channel[16]; | |
140 unsigned char cpe_channel[16]; | |
141 } program_config; | |
142 | |
143 typedef struct | |
144 { | |
145 unsigned short syncword; | |
146 unsigned char id; | |
147 unsigned char layer; | |
148 unsigned char protection_absent; | |
149 unsigned char profile; | |
150 unsigned char sf_index; | |
151 unsigned char private_bit; | |
152 unsigned char channel_configuration; | |
153 unsigned char original; | |
154 unsigned char home; | |
155 unsigned char emphasis; | |
156 unsigned char copyright_identification_bit; | |
157 unsigned char copyright_identification_start; | |
158 unsigned short aac_frame_length; | |
159 unsigned short adts_buffer_fullness; | |
160 unsigned char no_raw_data_blocks_in_frame; | |
161 unsigned short crc_check; | |
162 | |
163 /* control param */ | |
164 unsigned char old_format; | |
165 } adts_header; | |
166 | |
167 typedef struct | |
168 { | |
169 unsigned char copyright_id_present; | |
170 signed char copyright_id[10]; | |
171 unsigned char original_copy; | |
172 unsigned char home; | |
173 unsigned char bitstream_type; | |
174 unsigned long bitrate; | |
175 unsigned char num_program_config_elements; | |
176 unsigned long adif_buffer_fullness; | |
177 | |
178 /* maximum of 16 PCEs */ | |
179 program_config pce[16]; | |
180 } adif_header; | |
181 | |
182 #ifdef LTP_DEC | |
183 typedef struct | |
184 { | |
185 unsigned char last_band; | |
186 unsigned char data_present; | |
187 unsigned short lag; | |
188 unsigned char lag_update; | |
189 unsigned char coef; | |
190 unsigned char long_used[MAX_SFB]; | |
191 unsigned char short_used[8]; | |
192 unsigned char short_lag_present[8]; | |
193 unsigned char short_lag[8]; | |
194 } ltp_info; | |
195 #endif | |
196 | |
197 #ifdef MAIN_DEC | |
198 typedef struct | |
199 { | |
200 unsigned char limit; | |
201 unsigned char predictor_reset; | |
202 unsigned char predictor_reset_group_number; | |
203 unsigned char prediction_used[MAX_SFB]; | |
204 } pred_info; | |
205 #endif | |
206 | |
207 typedef struct | |
208 { | |
209 unsigned char number_pulse; | |
210 unsigned char pulse_start_sfb; | |
211 unsigned char pulse_offset[4]; | |
212 unsigned char pulse_amp[4]; | |
213 } pulse_info; | |
214 | |
215 typedef struct | |
216 { | |
217 unsigned char n_filt[8]; | |
218 unsigned char coef_res[8]; | |
219 unsigned char length[8][4]; | |
220 unsigned char order[8][4]; | |
221 unsigned char direction[8][4]; | |
222 unsigned char coef_compress[8][4]; | |
223 unsigned char coef[8][4][32]; | |
224 } tns_info; | |
225 | |
226 #ifdef SSR_DEC | |
227 typedef struct | |
228 { | |
229 unsigned char max_band; | |
230 | |
231 unsigned char adjust_num[4][8]; | |
232 unsigned char alevcode[4][8][8]; | |
233 unsigned char aloccode[4][8][8]; | |
234 } ssr_info; | |
235 #endif | |
236 | |
237 typedef struct | |
238 { | |
239 unsigned char max_sfb; | |
240 | |
241 unsigned char num_swb; | |
242 unsigned char num_window_groups; | |
243 unsigned char num_windows; | |
244 unsigned char window_sequence; | |
245 unsigned char window_group_length[8]; | |
246 unsigned char window_shape; | |
247 unsigned char scale_factor_grouping; | |
248 unsigned short sect_sfb_offset[8][15*8]; | |
249 unsigned short swb_offset[52]; | |
250 | |
251 unsigned char sect_cb[8][15*8]; | |
252 unsigned short sect_start[8][15*8]; | |
253 unsigned short sect_end[8][15*8]; | |
254 unsigned char sfb_cb[8][8*15]; | |
255 unsigned char num_sec[8]; /* number of sections in a group */ | |
256 | |
257 unsigned char global_gain; | |
258 signed short scale_factors[8][51]; /* [0..255] */ | |
259 | |
260 unsigned char ms_mask_present; | |
261 unsigned char ms_used[MAX_WINDOW_GROUPS][MAX_SFB]; | |
262 | |
263 unsigned char noise_used; | |
264 | |
265 unsigned char pulse_data_present; | |
266 unsigned char tns_data_present; | |
267 unsigned char gain_control_data_present; | |
268 unsigned char predictor_data_present; | |
269 | |
270 pulse_info pul; | |
271 tns_info tns; | |
272 #ifdef MAIN_DEC | |
273 pred_info pred; | |
274 #endif | |
275 #ifdef LTP_DEC | |
276 ltp_info ltp; | |
277 ltp_info ltp2; | |
278 #endif | |
279 #ifdef SSR_DEC | |
280 ssr_info ssr; | |
281 #endif | |
282 | |
283 #ifdef ERROR_RESILIENCE | |
284 /* ER HCR data */ | |
285 unsigned short length_of_reordered_spectral_data; | |
286 unsigned char length_of_longest_codeword; | |
287 /* ER RLVC data */ | |
288 unsigned char sf_concealment; | |
289 unsigned char rev_global_gain; | |
290 unsigned short length_of_rvlc_sf; | |
291 unsigned short dpcm_noise_nrg; | |
292 unsigned char sf_escapes_present; | |
293 unsigned char length_of_rvlc_escapes; | |
294 unsigned short dpcm_noise_last_position; | |
295 #endif | |
296 } ic_stream; /* individual channel stream */ | |
297 | |
298 typedef struct | |
299 { | |
300 unsigned char channel; | |
301 signed short paired_channel; | |
302 | |
303 unsigned char element_instance_tag; | |
304 unsigned char common_window; | |
305 | |
306 ic_stream ics1; | |
307 ic_stream ics2; | |
308 } element; /* syntax element (SCE, CPE, LFE) */ | |
309 | |
310 typedef struct mp4AudioSpecificConfig | |
311 { | |
312 /* Audio Specific Info */ | |
313 unsigned char objectTypeIndex; | |
314 unsigned char samplingFrequencyIndex; | |
315 unsigned long samplingFrequency; | |
316 unsigned char channelsConfiguration; | |
317 | |
318 /* GA Specific Info */ | |
319 unsigned char frameLengthFlag; | |
320 unsigned char dependsOnCoreCoder; | |
321 unsigned short coreCoderDelay; | |
322 unsigned char extensionFlag; | |
323 unsigned char aacSectionDataResilienceFlag; | |
324 unsigned char aacScalefactorDataResilienceFlag; | |
325 unsigned char aacSpectralDataResilienceFlag; | |
326 unsigned char epConfig; | |
327 | |
328 signed char sbr_present_flag; | |
329 unsigned char forceUpSampling; | |
330 unsigned char downSampledSBR; | |
331 } mp4AudioSpecificConfig; | |
332 | |
333 typedef struct NeAACDecConfiguration | |
334 { | |
335 unsigned char defObjectType; | |
336 unsigned long defSampleRate; | |
337 unsigned char outputFormat; | |
338 unsigned char downMatrix; | |
339 unsigned char useOldADTSFormat; | |
340 unsigned char dontUpSampleImplicitSBR; | |
341 } NeAACDecConfiguration, *NeAACDecConfigurationPtr; | |
342 | |
343 typedef struct NeAACDecFrameInfo | |
344 { | |
345 unsigned long bytesconsumed; | |
346 unsigned long samples; | |
347 unsigned char channels; | |
348 unsigned char error; | |
349 unsigned long samplerate; | |
350 | |
351 /* SBR: 0: off, 1: on; normal, 2: on; downsampled */ | |
352 unsigned char sbr; | |
353 | |
354 /* MPEG-4 ObjectType */ | |
355 unsigned char object_type; | |
356 | |
357 /* AAC header type; MP4 will be signalled as RAW also */ | |
358 unsigned char header_type; | |
359 | |
360 /* multichannel configuration */ | |
361 unsigned char num_front_channels; | |
362 unsigned char num_side_channels; | |
363 unsigned char num_back_channels; | |
364 unsigned char num_lfe_channels; | |
365 unsigned char channel_position[MAX_CHANNELS]; | |
366 | |
367 /* PS: 0: off, 1: on */ | |
368 unsigned char ps; | |
369 } NeAACDecFrameInfo; | |
370 | |
371 typedef struct | |
372 { | |
373 unsigned char adts_header_present; | |
374 unsigned char adif_header_present; | |
375 unsigned char sf_index; | |
376 unsigned char object_type; | |
377 unsigned char channelConfiguration; | |
378 #ifdef ERROR_RESILIENCE | |
379 unsigned char aacSectionDataResilienceFlag; | |
380 unsigned char aacScalefactorDataResilienceFlag; | |
381 unsigned char aacSpectralDataResilienceFlag; | |
382 #endif | |
383 unsigned short frameLength; | |
384 unsigned char postSeekResetFlag; | |
385 | |
386 unsigned long frame; | |
387 | |
388 unsigned char downMatrix; | |
389 unsigned char upMatrix; | |
390 unsigned char first_syn_ele; | |
391 unsigned char has_lfe; | |
392 /* number of channels in current frame */ | |
393 unsigned char fr_channels; | |
394 /* number of elements in current frame */ | |
395 unsigned char fr_ch_ele; | |
396 | |
397 /* element_output_channels: | |
398 determines the number of channels the element will output | |
399 */ | |
400 unsigned char element_output_channels[MAX_SYNTAX_ELEMENTS]; | |
401 /* element_alloced: | |
402 determines whether the data needed for the element is allocated or not | |
403 */ | |
404 unsigned char element_alloced[MAX_SYNTAX_ELEMENTS]; | |
405 /* alloced_channels: | |
406 determines the number of channels where output data is allocated for | |
407 */ | |
408 unsigned char alloced_channels; | |
409 | |
410 /* output data buffer */ | |
411 void *sample_buffer; | |
412 | |
413 unsigned char window_shape_prev[MAX_CHANNELS]; | |
414 #ifdef LTP_DEC | |
415 unsigned short ltp_lag[MAX_CHANNELS]; | |
416 #endif | |
417 fb_info *fb; | |
418 drc_info *drc; | |
419 | |
420 real_t *time_out[MAX_CHANNELS]; | |
421 real_t *fb_intermed[MAX_CHANNELS]; | |
422 | |
423 #ifdef SBR_DEC | |
424 signed char sbr_present_flag; | |
425 signed char forceUpSampling; | |
426 signed char downSampledSBR; | |
427 /* determines whether SBR data is allocated for the gives element */ | |
428 unsigned char sbr_alloced[MAX_SYNTAX_ELEMENTS]; | |
429 | |
430 sbr_info *sbr[MAX_SYNTAX_ELEMENTS]; | |
431 #endif | |
432 #if (defined(PS_DEC) || defined(DRM_PS)) | |
433 unsigned char ps_used[MAX_SYNTAX_ELEMENTS]; | |
434 unsigned char ps_used_global; | |
435 #endif | |
436 | |
437 #ifdef SSR_DEC | |
438 real_t *ssr_overlap[MAX_CHANNELS]; | |
439 real_t *prev_fmd[MAX_CHANNELS]; | |
440 real_t ipqf_buffer[MAX_CHANNELS][4][96/4]; | |
441 #endif | |
442 | |
443 #ifdef MAIN_DEC | |
444 pred_state *pred_stat[MAX_CHANNELS]; | |
445 #endif | |
446 #ifdef LTP_DEC | |
447 signed short *lt_pred_stat[MAX_CHANNELS]; | |
448 #endif | |
449 | |
450 /* Program Config Element */ | |
451 unsigned char pce_set; | |
452 program_config pce; | |
453 unsigned char element_id[MAX_CHANNELS]; | |
454 unsigned char internal_channel[MAX_CHANNELS]; | |
455 | |
456 /* Configuration data */ | |
457 NeAACDecConfiguration config; | |
458 | |
459 #ifdef PROFILE | |
460 int64_t cycles; | |
461 int64_t spectral_cycles; | |
462 int64_t output_cycles; | |
463 int64_t scalefac_cycles; | |
464 int64_t requant_cycles; | |
465 #endif | |
466 } NeAACDecStruct, *NeAACDecHandle; | |
467 | |
468 | |
469 | |
470 #ifdef __cplusplus | |
471 } | |
472 #endif | |
473 #endif |