1/* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13 * express or implied.
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
17 */
18/*
19
20 Pathname: s_tDec_Int_Chan.h
21
22------------------------------------------------------------------------------
23 REVISION HISTORY
24
25 Description: Change data types of win
26
27 Description: Remove wnd_shape structure.
28
29 Description: Remove dependency on window_block.h, Fix header too.
30
31 Description:
32 Modified to utilize memory in the last 1024 elements in fxpCoef.
33
34 Description:
35 (1) Modified to include the lines...
36
37    #ifdef __cplusplus
38    extern "C" {
39    #endif
40
41    #ifdef __cplusplus
42    }
43    #endif
44
45 (2) Updated the copyright header.
46
47 Description:
48 (1) Move temporary FrameInfo structure into the shared region with fxpCoef.
49 (2) Add more comments detailing the size of the shared structure.
50
51 Description:
52 (1) Changed time_quant from 2048 Int32 buffer to 1024 Int32 buffer.
53
54 Who:                                         Date:
55 Description:
56
57------------------------------------------------------------------------------
58 INCLUDE DESCRIPTION
59
60 This include file defines the structure, tDec_Int_Chan
61
62------------------------------------------------------------------------------
63*/
64
65/*----------------------------------------------------------------------------
66; CONTINUE ONLY IF NOT ALREADY DEFINED
67----------------------------------------------------------------------------*/
68#ifndef S_TDEC_INT_CHAN_H
69#define S_TDEC_INT_CHAN_H
70
71#ifdef __cplusplus
72extern "C"
73{
74#endif
75
76    /*----------------------------------------------------------------------------
77    ; INCLUDES
78    ----------------------------------------------------------------------------*/
79#include "pv_audio_type_defs.h"
80#include "e_rawbitstreamconst.h"
81#include "s_tns_frame_info.h"
82#include "s_wnd_shape.h"
83#include "s_lt_pred_status.h"
84#include "s_sectinfo.h"
85#include "s_frameinfo.h"
86#include "e_window_shape.h"
87#include "e_window_sequence.h"
88#include "window_block_fxp.h"
89
90    /*----------------------------------------------------------------------------
91    ; MACROS
92    ; Define module specific macros here
93    ----------------------------------------------------------------------------*/
94
95    /*----------------------------------------------------------------------------
96    ; DEFINES
97    ; Include all pre-processor statements here.
98    ----------------------------------------------------------------------------*/
99
100    /*----------------------------------------------------------------------------
101    ; EXTERNAL VARIABLES REFERENCES
102    ; Declare variables used in this module but defined elsewhere
103    ----------------------------------------------------------------------------*/
104
105    /*----------------------------------------------------------------------------
106    ; SIMPLE TYPEDEF'S
107    ----------------------------------------------------------------------------*/
108
109    /*----------------------------------------------------------------------------
110    ; ENUMERATED TYPEDEF'S
111    ----------------------------------------------------------------------------*/
112
113    /*----------------------------------------------------------------------------
114    ; STRUCTURES TYPEDEF'S
115    ----------------------------------------------------------------------------*/
116
117    /* This structure was created with the specific goal in mind of sharing memory
118     * with the last 1024 data elements in fxpCoef.
119     *
120     * The size of this structure must NOT exceed 4 kilobytes
121     * Also, the size of the fxpCoef array cannot be less than 8 kilobytes
122     *
123     * The fxpCoef array is declared as an Int32, so its size should not vary
124     * from platform to platform.
125     *
126     * The shared structure is 3,640 bytes (3.55 KB), on a 32-bit platform,
127     * which represents the worst case.
128     */
129    typedef struct
130    {
131        TNS_frame_info       tns;
132
133        FrameInfo            frameInfo;
134
135        Int                  factors[MAXBANDS];
136        Int                  cb_map[MAXBANDS];
137        Int                  group[NSHORT];
138        Int                  qFormat[MAXBANDS];
139
140        Int                  max_sfb;
141        LT_PRED_STATUS       lt_status;
142
143    } per_chan_share_w_fxpCoef;
144
145    /*
146     * This structure contains one per channel.
147     */
148    typedef struct
149    {
150#ifdef AAC_PLUS
151        Int16                ltp_buffer[LT_BLEN + 2*288]; /* LT_BLEN  = 2048 + 2*288 */
152#else
153        Int16                ltp_buffer[LT_BLEN]; /* LT_BLEN  = 2048 */
154#endif
155
156
157        Int32                time_quant[LONG_WINDOW]; /*  1024 holds overlap&add */
158
159        Int32                *fxpCoef;         /* Spectrum coeff.*/
160
161        per_chan_share_w_fxpCoef * pShareWfxpCoef;
162
163        Int32                abs_max_per_window[NUM_SHORT_WINDOWS];
164
165        WINDOW_SEQUENCE      wnd;
166
167
168        WINDOW_SHAPE         wnd_shape_prev_bk;
169        WINDOW_SHAPE         wnd_shape_this_bk;
170
171    } tDec_Int_Chan;
172
173    /*----------------------------------------------------------------------------
174    ; GLOBAL FUNCTION DEFINITIONS
175    ; Function Prototype declaration
176    ----------------------------------------------------------------------------*/
177
178#ifdef __cplusplus
179}
180#endif
181
182#endif /* S_TDEC_INT_CHAN_H */
183
184