OLD | NEW |
1 /* | 1 /* |
2 * AAC definitions and structures | 2 * AAC definitions and structures |
3 * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org ) | 3 * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org ) |
4 * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com ) | 4 * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com ) |
5 * | 5 * |
6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
7 * | 7 * |
8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 14 matching lines...) Expand all Loading... |
25 * AAC definitions and structures | 25 * AAC definitions and structures |
26 * @author Oded Shimon ( ods15 ods15 dyndns org ) | 26 * @author Oded Shimon ( ods15 ods15 dyndns org ) |
27 * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) | 27 * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) |
28 */ | 28 */ |
29 | 29 |
30 #ifndef AVCODEC_AAC_H | 30 #ifndef AVCODEC_AAC_H |
31 #define AVCODEC_AAC_H | 31 #define AVCODEC_AAC_H |
32 | 32 |
33 #include "avcodec.h" | 33 #include "avcodec.h" |
34 #include "dsputil.h" | 34 #include "dsputil.h" |
| 35 #include "fft.h" |
35 #include "mpeg4audio.h" | 36 #include "mpeg4audio.h" |
| 37 #include "sbr.h" |
36 | 38 |
37 #include <stdint.h> | 39 #include <stdint.h> |
38 | 40 |
39 #define AAC_INIT_VLC_STATIC(num, size) \ | 41 #define AAC_INIT_VLC_STATIC(num, size) \ |
40 INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \ | 42 INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \ |
41 ff_aac_spectral_bits[num], sizeof( ff_aac_spectral_bits[num][0]), sizeo
f( ff_aac_spectral_bits[num][0]), \ | 43 ff_aac_spectral_bits[num], sizeof( ff_aac_spectral_bits[num][0]), sizeo
f( ff_aac_spectral_bits[num][0]), \ |
42 ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), sizeo
f(ff_aac_spectral_codes[num][0]), \ | 44 ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), sizeo
f(ff_aac_spectral_codes[num][0]), \ |
43 size); | 45 size); |
44 | 46 |
45 #define MAX_CHANNELS 64 | 47 #define MAX_CHANNELS 64 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 */ | 209 */ |
208 typedef struct { | 210 typedef struct { |
209 IndividualChannelStream ics; | 211 IndividualChannelStream ics; |
210 TemporalNoiseShaping tns; | 212 TemporalNoiseShaping tns; |
211 Pulse pulse; | 213 Pulse pulse; |
212 enum BandType band_type[128]; ///< band types | 214 enum BandType band_type[128]; ///< band types |
213 int band_type_run_end[120]; ///< band type run end points | 215 int band_type_run_end[120]; ///< band type run end points |
214 float sf[120]; ///< scalefactors | 216 float sf[120]; ///< scalefactors |
215 int sf_idx[128]; ///< scalefactor indices (used by
encoder) | 217 int sf_idx[128]; ///< scalefactor indices (used by
encoder) |
216 uint8_t zeroes[128]; ///< band is not coded (used by en
coder) | 218 uint8_t zeroes[128]; ///< band is not coded (used by en
coder) |
217 DECLARE_ALIGNED_16(float, coeffs)[1024]; ///< coefficients for IMDCT | 219 DECLARE_ALIGNED(16, float, coeffs)[1024]; ///< coefficients for IMDCT |
218 DECLARE_ALIGNED_16(float, saved)[1024]; ///< overlap | 220 DECLARE_ALIGNED(16, float, saved)[1024]; ///< overlap |
219 DECLARE_ALIGNED_16(float, ret)[1024]; ///< PCM output | 221 DECLARE_ALIGNED(16, float, ret)[2048]; ///< PCM output |
220 PredictorState predictor_state[MAX_PREDICTORS]; | 222 PredictorState predictor_state[MAX_PREDICTORS]; |
221 } SingleChannelElement; | 223 } SingleChannelElement; |
222 | 224 |
223 /** | 225 /** |
224 * channel element - generic struct for SCE/CPE/CCE/LFE | 226 * channel element - generic struct for SCE/CPE/CCE/LFE |
225 */ | 227 */ |
226 typedef struct { | 228 typedef struct { |
227 // CPE specific | 229 // CPE specific |
228 int common_window; ///< Set if channels share a common 'IndividualCha
nnelStream' in bitstream. | 230 int common_window; ///< Set if channels share a common 'IndividualCha
nnelStream' in bitstream. |
229 int ms_mode; ///< Signals mid/side stereo flags coding mode (us
ed by encoder) | 231 int ms_mode; ///< Signals mid/side stereo flags coding mode (us
ed by encoder) |
230 uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scale
factor window band | 232 uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scale
factor window band |
231 // shared | 233 // shared |
232 SingleChannelElement ch[2]; | 234 SingleChannelElement ch[2]; |
233 // CCE specific | 235 // CCE specific |
234 ChannelCoupling coup; | 236 ChannelCoupling coup; |
| 237 SpectralBandReplication sbr; |
235 } ChannelElement; | 238 } ChannelElement; |
236 | 239 |
237 /** | 240 /** |
238 * main AAC context | 241 * main AAC context |
239 */ | 242 */ |
240 typedef struct { | 243 typedef struct { |
241 AVCodecContext * avccontext; | 244 AVCodecContext * avccontext; |
242 | 245 |
243 MPEG4AudioConfig m4ac; | 246 MPEG4AudioConfig m4ac; |
244 | 247 |
245 int is_saved; ///< Set if elements have stored overlap from
previous frame. | 248 int is_saved; ///< Set if elements have stored overlap from
previous frame. |
246 DynamicRangeControl che_drc; | 249 DynamicRangeControl che_drc; |
247 | 250 |
248 /** | 251 /** |
249 * @defgroup elements Channel element related data. | 252 * @defgroup elements Channel element related data. |
250 * @{ | 253 * @{ |
251 */ | 254 */ |
252 enum ChannelPosition che_pos[4][MAX_ELEM_ID]; /**< channel element channel m
apping with the | 255 enum ChannelPosition che_pos[4][MAX_ELEM_ID]; /**< channel element channel m
apping with the |
253 * first index as the first
4 raw data block types | 256 * first index as the first
4 raw data block types |
254 */ | 257 */ |
255 ChannelElement * che[4][MAX_ELEM_ID]; | 258 ChannelElement * che[4][MAX_ELEM_ID]; |
256 ChannelElement * tag_che_map[4][MAX_ELEM_ID]; | 259 ChannelElement * tag_che_map[4][MAX_ELEM_ID]; |
257 int tags_mapped; | 260 int tags_mapped; |
258 /** @} */ | 261 /** @} */ |
259 | 262 |
260 /** | 263 /** |
261 * @defgroup temporary aligned temporary buffers (We do not want to have the
se on the stack.) | 264 * @defgroup temporary aligned temporary buffers (We do not want to have the
se on the stack.) |
262 * @{ | 265 * @{ |
263 */ | 266 */ |
264 DECLARE_ALIGNED_16(float, buf_mdct)[1024]; | 267 DECLARE_ALIGNED(16, float, buf_mdct)[1024]; |
265 /** @} */ | 268 /** @} */ |
266 | 269 |
267 /** | 270 /** |
268 * @defgroup tables Computed / set up during initialization. | 271 * @defgroup tables Computed / set up during initialization. |
269 * @{ | 272 * @{ |
270 */ | 273 */ |
271 FFTContext mdct; | 274 FFTContext mdct; |
272 FFTContext mdct_small; | 275 FFTContext mdct_small; |
273 DSPContext dsp; | 276 DSPContext dsp; |
274 int random_state; | 277 int random_state; |
275 /** @} */ | 278 /** @} */ |
276 | 279 |
277 /** | 280 /** |
278 * @defgroup output Members used for output interleaving. | 281 * @defgroup output Members used for output interleaving. |
279 * @{ | 282 * @{ |
280 */ | 283 */ |
281 float *output_data[MAX_CHANNELS]; ///< Points to each elemen
t's 'ret' buffer (PCM output). | 284 float *output_data[MAX_CHANNELS]; ///< Points to each elemen
t's 'ret' buffer (PCM output). |
282 float add_bias; ///< offset for dsp.float_
to_int16 | 285 float add_bias; ///< offset for dsp.float_
to_int16 |
283 float sf_scale; ///< Pre-scale for correct
IMDCT and dsp.float_to_int16. | 286 float sf_scale; ///< Pre-scale for correct
IMDCT and dsp.float_to_int16. |
284 int sf_offset; ///< offset into pow2sf_ta
b as appropriate for dsp.float_to_int16 | 287 int sf_offset; ///< offset into pow2sf_ta
b as appropriate for dsp.float_to_int16 |
285 /** @} */ | 288 /** @} */ |
286 | 289 |
287 DECLARE_ALIGNED(16, float, temp)[128]; | 290 DECLARE_ALIGNED(16, float, temp)[128]; |
288 | 291 |
289 enum OCStatus output_configured; | 292 enum OCStatus output_configured; |
290 } AACContext; | 293 } AACContext; |
291 | 294 |
292 #endif /* AVCODEC_AAC_H */ | 295 #endif /* AVCODEC_AAC_H */ |
OLD | NEW |