1 /*
2  * FAAC - Freeware Advanced Audio Coder
3  * Copyright (C) 2001 Menno Bakker
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Lesser General Public License for more details.
14 
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  */
20 
21 #ifndef FRAME_H
22 #define FRAME_H
23 
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27 
28 #include <faac.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33 
34 #include "coder.h"
35 #include "channels.h"
36 #include "blockswitch.h"
37 #include "fft.h"
38 #include "quantize.h"
39 
40 #pragma pack(push, 1)
41 
42 #include <faaccfg.h>
43 
44 typedef struct {
45     /* number of channels in AAC file */
46     unsigned int numChannels;
47 
48     /* samplerate of AAC file */
49     unsigned long sampleRate;
50     unsigned int sampleRateIdx;
51 
52     unsigned int usedBytes;
53 
54     /* frame number */
55     unsigned int frameNum;
56     unsigned int flushFrame;
57 
58     /* Scalefactorband data */
59     SR_INFO *srInfo;
60 
61     /* sample buffers of current next and next next frame*/
62     double *sampleBuff[MAX_CHANNELS];
63     double *nextSampleBuff[MAX_CHANNELS];
64     double *next2SampleBuff[MAX_CHANNELS];
65     double *next3SampleBuff[MAX_CHANNELS];
66 
67     /* Filterbank buffers */
68     double *sin_window_long;
69     double *sin_window_short;
70     double *kbd_window_long;
71     double *kbd_window_short;
72     double *freqBuff[MAX_CHANNELS];
73     double *overlapBuff[MAX_CHANNELS];
74 
75     double *msSpectrum[MAX_CHANNELS];
76 
77     /* Channel and Coder data for all channels */
78     CoderInfo coderInfo[MAX_CHANNELS];
79     ChannelInfo channelInfo[MAX_CHANNELS];
80 
81     /* Psychoacoustics data */
82     PsyInfo psyInfo[MAX_CHANNELS];
83     GlobalPsyInfo gpsyInfo;
84 
85     /* Configuration data */
86     faacEncConfiguration config;
87 
88     psymodel_t *psymodel;
89 
90     /* quantizer specific config */
91     AACQuantCfg aacquantCfg;
92 
93     /* FFT Tables */
94     FFT_Tables	fft_tables;
95 } faacEncStruct;
96 
97 #pragma pack(pop)
98 
99 #ifdef __cplusplus
100 }
101 #endif /* __cplusplus */
102 
103 #endif /* FRAME_H */
104