Mercurial > mplayer.hg
comparison libfaad2/sbr_dec.h @ 12527:4a370c80fe5c
update to the 2.0 release of faad, patch by adland
author | diego |
---|---|
date | Wed, 02 Jun 2004 22:59:04 +0000 |
parents | 3185f64f6350 |
children | d81145997036 |
comparison
equal
deleted
inserted
replaced
12526:e183ad37d24c | 12527:4a370c80fe5c |
---|---|
1 /* | 1 /* |
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding | 2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
3 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com | 3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com |
4 ** | 4 ** |
5 ** This program is free software; you can redistribute it and/or modify | 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 | 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 | 7 ** the Free Software Foundation; either version 2 of the License, or |
8 ** (at your option) any later version. | 8 ** (at your option) any later version. |
20 ** forbidden. | 20 ** forbidden. |
21 ** | 21 ** |
22 ** Commercial non-GPL licensing of this software is possible. | 22 ** Commercial non-GPL licensing of this software is possible. |
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | 23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. |
24 ** | 24 ** |
25 ** $Id: sbr_dec.h,v 1.7 2003/09/25 12:04:31 menno Exp $ | 25 ** $Id: sbr_dec.h,v 1.2 2003/10/03 22:22:27 alex Exp $ |
26 **/ | 26 **/ |
27 | 27 |
28 #ifndef __SBR_DEC_H__ | 28 #ifndef __SBR_DEC_H__ |
29 #define __SBR_DEC_H__ | 29 #define __SBR_DEC_H__ |
30 | 30 |
31 #ifdef __cplusplus | 31 #ifdef __cplusplus |
32 extern "C" { | 32 extern "C" { |
33 #endif | 33 #endif |
34 | |
35 #ifdef PS_DEC | |
36 #include "ps_dec.h" | |
37 #endif | |
38 #ifdef DRM_PS | |
39 #include "drm_dec.h" | |
40 #endif | |
41 | |
42 /* MAX_NTSRHFG: maximum of number_time_slots * rate + HFGen. 16*2+8 */ | |
43 #define MAX_NTSRHFG 40 | |
44 #define MAX_NTSR 32 /* max number_time_slots * rate, ok for DRM and not DRM mode */ | |
45 | |
34 | 46 |
35 typedef struct { | 47 typedef struct { |
36 real_t *x; | 48 real_t *x; |
37 uint8_t channels; | 49 uint8_t channels; |
38 } qmfa_info; | 50 } qmfa_info; |
39 | 51 |
40 typedef struct { | 52 typedef struct { |
41 real_t *v[2]; | 53 real_t *v[2]; |
42 uint8_t v_index; | 54 uint8_t v_index; |
43 uint8_t channels; | 55 uint8_t channels; |
56 #ifdef USE_SSE | |
57 void (*qmf_func)(void *a, void *b, void *c, void *d); | |
58 #endif | |
44 } qmfs_info; | 59 } qmfs_info; |
45 | 60 |
46 typedef struct | 61 typedef struct |
47 { | 62 { |
48 uint32_t sample_rate; | 63 uint32_t sample_rate; |
49 | 64 |
50 uint8_t rate; | 65 uint8_t rate; |
51 uint8_t just_seeked; | 66 uint8_t just_seeked; |
67 uint8_t ret; | |
52 | 68 |
53 uint8_t amp_res[2]; | 69 uint8_t amp_res[2]; |
54 | 70 |
55 uint8_t k0; | 71 uint8_t k0; |
56 uint8_t kx; | 72 uint8_t kx; |
129 | 145 |
130 uint8_t Reset; | 146 uint8_t Reset; |
131 uint32_t frame; | 147 uint32_t frame; |
132 uint32_t header_count; | 148 uint32_t header_count; |
133 | 149 |
134 uint8_t *data; | |
135 uint16_t data_size; | |
136 | |
137 uint8_t id_aac; | 150 uint8_t id_aac; |
138 qmfa_info *qmfa[2]; | 151 qmfa_info *qmfa[2]; |
139 qmfs_info *qmfs[2]; | 152 qmfs_info *qmfs[2]; |
140 | 153 |
141 qmf_t *Xsbr[2]; | 154 qmf_t Xsbr[2][MAX_NTSRHFG][64]; |
142 qmf_t *Xcodec[2]; | 155 qmf_t Xcodec[2][MAX_NTSRHFG][32]; |
143 | 156 |
144 #ifdef DRM | 157 #ifdef DRM |
145 int8_t lcstereo_flag; | 158 int8_t lcstereo_flag; |
146 uint8_t bs_dataextra; | 159 uint8_t bs_dataextra; |
147 uint16_t data_size_bits; | |
148 uint8_t Is_DRM_SBR; | 160 uint8_t Is_DRM_SBR; |
149 #endif | 161 #ifdef DRM_PS |
150 | 162 drm_ps_info drm_ps; |
151 uint16_t numTimeSlotsRate; | 163 #endif |
152 uint16_t numTimeSlots; | 164 #endif |
165 | |
166 uint8_t numTimeSlotsRate; | |
167 uint8_t numTimeSlots; | |
153 uint8_t tHFGen; | 168 uint8_t tHFGen; |
154 uint8_t tHFAdj; | 169 uint8_t tHFAdj; |
170 | |
171 #ifdef PS_DEC | |
172 ps_info ps; | |
173 #endif | |
174 #if (defined(PS_DEC) || defined(DRM_PS)) | |
175 uint8_t ps_used; | |
176 #endif | |
155 | 177 |
156 /* to get it compiling */ | 178 /* to get it compiling */ |
157 /* we'll see during the coding of all the tools, whether | 179 /* we'll see during the coding of all the tools, whether |
158 these are all used or not. | 180 these are all used or not. |
159 */ | 181 */ |
190 uint8_t bs_num_rel_1[2]; | 212 uint8_t bs_num_rel_1[2]; |
191 uint8_t bs_df_env[2][9]; | 213 uint8_t bs_df_env[2][9]; |
192 uint8_t bs_df_noise[2][3]; | 214 uint8_t bs_df_noise[2][3]; |
193 } sbr_info; | 215 } sbr_info; |
194 | 216 |
195 sbr_info *sbrDecodeInit(uint16_t framelength | 217 sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac, |
218 uint32_t sample_rate | |
196 #ifdef DRM | 219 #ifdef DRM |
197 , uint8_t IsDRM | 220 , uint8_t IsDRM |
198 #endif | 221 #endif |
199 ); | 222 ); |
200 void sbrDecodeEnd(sbr_info *sbr); | 223 void sbrDecodeEnd(sbr_info *sbr); |
201 | 224 |
202 void sbrDecodeFrame(sbr_info *sbr, real_t *left_channel, | 225 uint8_t sbrDecodeCoupleFrame(sbr_info *sbr, real_t *left_chan, real_t *right_chan, |
203 real_t *right_channel, uint8_t id_aac, | 226 const uint8_t just_seeked, const uint8_t upsample_only); |
204 uint8_t just_seeked, uint8_t upsample_only); | 227 uint8_t sbrDecodeSingleFrame(sbr_info *sbr, real_t *channel, |
228 const uint8_t just_seeked, const uint8_t upsample_only); | |
229 #if (defined(PS_DEC) || defined(DRM_PS)) | |
230 uint8_t sbrDecodeSingleFramePS(sbr_info *sbr, real_t *left_channel, real_t *right_channel, | |
231 const uint8_t just_seeked, const uint8_t upsample_only); | |
232 #endif | |
205 | 233 |
206 | 234 |
207 #ifdef __cplusplus | 235 #ifdef __cplusplus |
208 } | 236 } |
209 #endif | 237 #endif |