Mercurial > audlegacy
annotate Plugins/Input/aac/libfaad2/sbr_dec.h @ 1010:29feaace84d0 trunk
[svn] - synchronize audacious-faad with FAAD2 CVS.
author | nenolod |
---|---|
date | Mon, 08 May 2006 06:56:47 -0700 |
parents | 0a2ad94e8607 |
children | 1e6c0a3f2d15 |
rev | line source |
---|---|
61 | 1 /* |
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com |
1010 | 4 ** |
61 | 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. | |
1010 | 9 ** |
61 | 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. | |
1010 | 14 ** |
61 | 15 ** You should have received a copy of the GNU General Public License |
1010 | 16 ** along with this program; if not, write to the Free Software |
61 | 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 ** | |
1010 | 25 ** $Id: sbr_dec.h,v 1.23 2004/02/04 20:07:24 menno Exp $ |
61 | 26 **/ |
27 | |
28 #ifndef __SBR_DEC_H__ | |
29 #define __SBR_DEC_H__ | |
30 | |
31 #ifdef __cplusplus | |
32 extern "C" { | |
33 #endif | |
34 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
35 #ifdef PS_DEC |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
36 #include "ps_dec.h" |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
37 #endif |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
38 #ifdef DRM_PS |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
39 #include "drm_dec.h" |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
40 #endif |
61 | 41 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
42 /* MAX_NTSRHFG: maximum of number_time_slots * rate + HFGen. 16*2+8 */ |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
43 #define MAX_NTSRHFG 40 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
44 #define MAX_NTSR 32 /* max number_time_slots * rate, ok for DRM and not DRM mode */ |
61 | 45 |
46 | |
47 typedef struct { | |
48 real_t *x; | |
49 uint8_t channels; | |
50 } qmfa_info; | |
51 | |
52 typedef struct { | |
1010 | 53 real_t *v[2]; |
54 uint8_t v_index; | |
61 | 55 uint8_t channels; |
1010 | 56 #ifdef USE_SSE |
57 void (*qmf_func)(void *a, void *b, void *c, void *d); | |
58 #endif | |
61 | 59 } qmfs_info; |
60 | |
61 typedef struct | |
62 { | |
63 uint32_t sample_rate; | |
64 | |
65 uint8_t rate; | |
66 uint8_t just_seeked; | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
67 uint8_t ret; |
61 | 68 |
69 uint8_t amp_res[2]; | |
70 | |
71 uint8_t k0; | |
72 uint8_t kx; | |
73 uint8_t M; | |
74 uint8_t N_master; | |
75 uint8_t N_high; | |
76 uint8_t N_low; | |
77 uint8_t N_Q; | |
78 uint8_t N_L[4]; | |
79 uint8_t n[2]; | |
80 | |
81 uint8_t f_master[64]; | |
82 uint8_t f_table_res[2][64]; | |
83 uint8_t f_table_noise[64]; | |
84 uint8_t f_table_lim[4][64]; | |
85 #ifdef SBR_LOW_POWER | |
86 uint8_t f_group[5][64]; | |
87 uint8_t N_G[5]; | |
88 #endif | |
89 | |
90 uint8_t table_map_k_to_g[64]; | |
91 | |
92 uint8_t abs_bord_lead[2]; | |
93 uint8_t abs_bord_trail[2]; | |
94 uint8_t n_rel_lead[2]; | |
95 uint8_t n_rel_trail[2]; | |
96 | |
97 uint8_t L_E[2]; | |
98 uint8_t L_E_prev[2]; | |
99 uint8_t L_Q[2]; | |
100 | |
1010 | 101 uint8_t t_E[2][6]; |
61 | 102 uint8_t t_Q[2][3]; |
1010 | 103 uint8_t f[2][6]; |
61 | 104 uint8_t f_prev[2]; |
105 | |
106 real_t *G_temp_prev[2][5]; | |
107 real_t *Q_temp_prev[2][5]; | |
108 | |
1010 | 109 int16_t E[2][64][5]; |
61 | 110 int16_t E_prev[2][64]; |
1010 | 111 real_t E_orig[2][64][5]; |
112 real_t E_curr[2][64][5]; | |
61 | 113 int32_t Q[2][64][2]; |
114 int32_t Q_prev[2][64]; | |
1010 | 115 real_t Q_orig[2][64][2]; |
61 | 116 |
117 int8_t l_A[2]; | |
118 int8_t l_A_prev[2]; | |
119 | |
1010 | 120 uint8_t bs_invf_mode[2][5]; |
121 uint8_t bs_invf_mode_prev[2][5]; | |
61 | 122 real_t bwArray[2][64]; |
123 real_t bwArray_prev[2][64]; | |
124 | |
125 uint8_t noPatches; | |
126 uint8_t patchNoSubbands[64]; | |
127 uint8_t patchStartSubband[64]; | |
128 | |
129 uint8_t bs_add_harmonic[2][64]; | |
130 uint8_t bs_add_harmonic_prev[2][64]; | |
131 | |
132 uint16_t index_noise_prev[2]; | |
133 uint8_t psi_is_prev[2]; | |
134 | |
135 uint8_t bs_start_freq_prev; | |
136 uint8_t bs_stop_freq_prev; | |
137 uint8_t bs_xover_band_prev; | |
138 uint8_t bs_freq_scale_prev; | |
139 uint8_t bs_alter_scale_prev; | |
140 uint8_t bs_noise_bands_prev; | |
141 | |
142 int8_t prevEnvIsShort[2]; | |
143 | |
144 int8_t kx_prev; | |
145 | |
146 uint8_t Reset; | |
147 uint32_t frame; | |
148 uint32_t header_count; | |
149 | |
150 uint8_t id_aac; | |
151 qmfa_info *qmfa[2]; | |
152 qmfs_info *qmfs[2]; | |
153 | |
154 qmf_t Xsbr[2][MAX_NTSRHFG][64]; | |
1010 | 155 qmf_t Xcodec[2][MAX_NTSRHFG][32]; |
61 | 156 |
157 #ifdef DRM | |
1010 | 158 int8_t lcstereo_flag; |
159 uint8_t bs_dataextra; | |
61 | 160 uint8_t Is_DRM_SBR; |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
161 #ifdef DRM_PS |
1010 | 162 drm_ps_info drm_ps; |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
163 #endif |
61 | 164 #endif |
165 | |
1010 | 166 uint8_t numTimeSlotsRate; |
167 uint8_t numTimeSlots; | |
168 uint8_t tHFGen; | |
169 uint8_t tHFAdj; | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
170 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
171 #ifdef PS_DEC |
1010 | 172 ps_info ps; |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
173 #endif |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
174 #if (defined(PS_DEC) || defined(DRM_PS)) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
175 uint8_t ps_used; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
176 #endif |
61 | 177 |
178 /* to get it compiling */ | |
179 /* we'll see during the coding of all the tools, whether | |
180 these are all used or not. | |
181 */ | |
182 uint8_t bs_header_flag; | |
183 uint8_t bs_crc_flag; | |
184 uint16_t bs_sbr_crc_bits; | |
185 uint8_t bs_protocol_version; | |
186 uint8_t bs_amp_res; | |
187 uint8_t bs_start_freq; | |
188 uint8_t bs_stop_freq; | |
189 uint8_t bs_xover_band; | |
190 uint8_t bs_freq_scale; | |
191 uint8_t bs_alter_scale; | |
192 uint8_t bs_noise_bands; | |
193 uint8_t bs_limiter_bands; | |
194 uint8_t bs_limiter_gains; | |
195 uint8_t bs_interpol_freq; | |
196 uint8_t bs_smoothing_mode; | |
197 uint8_t bs_samplerate_mode; | |
198 uint8_t bs_add_harmonic_flag[2]; | |
199 uint8_t bs_add_harmonic_flag_prev[2]; | |
200 uint8_t bs_extended_data; | |
201 uint8_t bs_extension_id; | |
202 uint8_t bs_extension_data; | |
203 uint8_t bs_coupling; | |
204 uint8_t bs_frame_class[2]; | |
205 uint8_t bs_rel_bord[2][9]; | |
206 uint8_t bs_rel_bord_0[2][9]; | |
207 uint8_t bs_rel_bord_1[2][9]; | |
208 uint8_t bs_pointer[2]; | |
209 uint8_t bs_abs_bord_0[2]; | |
210 uint8_t bs_abs_bord_1[2]; | |
211 uint8_t bs_num_rel_0[2]; | |
212 uint8_t bs_num_rel_1[2]; | |
213 uint8_t bs_df_env[2][9]; | |
214 uint8_t bs_df_noise[2][3]; | |
215 } sbr_info; | |
216 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
217 sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac, |
1010 | 218 uint32_t sample_rate |
61 | 219 #ifdef DRM |
1010 | 220 , uint8_t IsDRM |
61 | 221 #endif |
1010 | 222 ); |
61 | 223 void sbrDecodeEnd(sbr_info *sbr); |
224 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
225 uint8_t sbrDecodeCoupleFrame(sbr_info *sbr, real_t *left_chan, real_t *right_chan, |
1010 | 226 const uint8_t just_seeked, const uint8_t upsample_only); |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
227 uint8_t sbrDecodeSingleFrame(sbr_info *sbr, real_t *channel, |
1010 | 228 const uint8_t just_seeked, const uint8_t upsample_only); |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
229 #if (defined(PS_DEC) || defined(DRM_PS)) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
230 uint8_t sbrDecodeSingleFramePS(sbr_info *sbr, real_t *left_channel, real_t *right_channel, |
1010 | 231 const uint8_t just_seeked, const uint8_t upsample_only); |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
232 #endif |
61 | 233 |
234 | |
235 #ifdef __cplusplus | |
236 } | |
237 #endif | |
238 #endif | |
239 |