FFmpeg
aacdec.h
Go to the documentation of this file.
1 /*
2  * AAC decoder definitions and structures
3  * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
4  * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 /**
24  * @file
25  * AAC decoder definitions and structures
26  * @author Oded Shimon ( ods15 ods15 dyndns org )
27  * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
28  */
29 
30 #ifndef AVCODEC_AAC_AACDEC_H
31 #define AVCODEC_AAC_AACDEC_H
32 
33 #include <stdint.h>
34 
36 #include "libavutil/float_dsp.h"
37 #include "libavutil/fixed_dsp.h"
38 #include "libavutil/mem_internal.h"
39 #include "libavutil/tx.h"
40 
41 #include "libavcodec/aac.h"
42 #include "libavcodec/avcodec.h"
43 #include "libavcodec/mpeg4audio.h"
44 
45 #include "aacdec_ac.h"
46 
47 typedef struct AACDecContext AACDecContext;
48 
49 /**
50  * Output configuration status
51  */
52 enum OCStatus {
53  OC_NONE, ///< Output unconfigured
54  OC_TRIAL_PCE, ///< Output configuration under trial specified by an inband PCE
55  OC_TRIAL_FRAME, ///< Output configuration under trial specified by a frame header
56  OC_GLOBAL_HDR, ///< Output configuration set in a global header but not yet locked
57  OC_LOCKED, ///< Output configuration locked in place
58 };
59 
63 };
64 
65 /**
66  * The point during decoding at which channel coupling is applied.
67  */
72 };
73 
79 };
80 
85 };
86 
93 };
94 
98 };
99 
100 // Supposed to be equal to AAC_RENAME() in case of USE_FIXED.
101 #define RENAME_FIXED(name) name ## _fixed
102 
103 #define INTFLOAT_UNION(name, elems) \
104  union { \
105  int RENAME_FIXED(name) elems; \
106  float name elems; \
107  }
108 
109 #define INTFLOAT_ALIGNED_UNION(alignment, name, nb_elems) \
110  union { \
111  DECLARE_ALIGNED(alignment, int, RENAME_FIXED(name))[nb_elems]; \
112  DECLARE_ALIGNED(alignment, float, name)[nb_elems]; \
113  }
114 /**
115  * Long Term Prediction
116  */
117 typedef struct LongTermPrediction {
118  int8_t present;
119  int16_t lag;
123 
124 /* Per channel core mode */
125 typedef struct AACUsacElemData {
126  uint8_t core_mode;
129 
130  /* Timewarping ratio */
131 #define NUM_TW_NODES 16
133 
134  struct {
135  uint8_t acelp_core_mode : 3;
136  uint8_t lpd_mode : 5;
137 
138  uint8_t bpf_control_info : 1;
139  uint8_t core_mode_last : 1;
140  uint8_t fac_data_present : 1;
141 
143  } ldp;
144 
145  struct {
146  unsigned int seed;
147  uint8_t level : 3;
148  uint8_t offset : 5;
149  } noise;
150 
151  struct {
152  uint8_t gain;
153  uint32_t kv[8 /* (1024 / 16) / 8 */][8];
154  } fac;
155 
158 
159 /**
160  * Individual Channel Stream
161  */
162 typedef struct IndividualChannelStream {
163  uint8_t max_sfb; ///< number of scalefactor bands per group
165  uint8_t use_kb_window[2]; ///< If set, use Kaiser-Bessel window, otherwise use a sine window.
167  int prev_num_window_groups; ///< Previous frame's number of window groups
168  uint8_t group_len[8];
170  const uint16_t *swb_offset; ///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window
171  int num_swb; ///< number of scalefactor window bands
177  uint8_t prediction_used[41];
178  uint8_t window_clipping[8]; ///< set if a certain window is near clipping
180 
181 /**
182  * Temporal Noise Shaping
183  */
184 typedef struct TemporalNoiseShaping {
185  int present;
186  int n_filt[8];
187  int length[8][4];
188  int direction[8][4];
189  int order[8][4];
192 
193 /**
194  * coupling parameters
195  */
196 typedef struct ChannelCoupling {
197  enum CouplingPoint coupling_point; ///< The point during decoding at which coupling is applied.
198  int num_coupled; ///< number of target elements
199  enum RawDataBlockType type[8]; ///< Type of channel element to be coupled - SCE or CPE.
200  int id_select[8]; ///< element id
201  int ch_select[8]; /**< [0] shared list of gains; [1] list of gains for right channel;
202  * [2] list of gains for left channel; [3] lists of gains for both channels
203  */
204  INTFLOAT_UNION(gain, [16][120]);
206 
207 /**
208  * Single Channel Element - used for both SCE and LFE elements.
209  */
210 typedef struct SingleChannelElement {
212  AACUsacElemData ue; ///< USAC element data
214  enum BandType band_type[128]; ///< band types
215  int sfo[128]; ///< scalefactor offsets
216  INTFLOAT_UNION(sf, [128]); ///< scalefactors (8 windows * 16 sfb max)
217  INTFLOAT_ALIGNED_UNION(32, coeffs, 1024); ///< coefficients for IMDCT, maybe processed
218  INTFLOAT_ALIGNED_UNION(32, prev_coeffs, 1024); ///< unscaled previous contents of coeffs[] for USAC
219  INTFLOAT_ALIGNED_UNION(32, saved, 1536); ///< overlap
220  INTFLOAT_ALIGNED_UNION(32, ret_buf, 2048); ///< PCM output buffer
221  INTFLOAT_ALIGNED_UNION(16, ltp_state, 3072); ///< time signal for LTP
222  union {
223  struct PredictorStateFixed *RENAME_FIXED(predictor_state);
225  };
226  union {
227  float *output; ///< PCM output
228  int *RENAME_FIXED(output); ///< PCM output
229  };
231 
232 typedef struct AACUsacStereo {
233  uint8_t common_window;
234  uint8_t common_tw;
235  uint8_t tns_on_lr; ///< Apply TNS before M/S and stereo prediction
236 
237  uint8_t ms_mask_mode;
238  uint8_t config_idx;
239 
240  /* Complex prediction */
241  uint8_t use_prev_frame;
242  uint8_t pred_dir;
243  uint8_t complex_coef;
244 
245  uint8_t pred_used[128];
246 
247  INTFLOAT_ALIGNED_UNION(32, alpha_q_re, 1024);
248  INTFLOAT_ALIGNED_UNION(32, alpha_q_im, 1024);
249  INTFLOAT_ALIGNED_UNION(32, prev_alpha_q_re, 1024);
250  INTFLOAT_ALIGNED_UNION(32, prev_alpha_q_im, 1024);
251 
252  INTFLOAT_ALIGNED_UNION(32, dmix_re, 1024);
253  INTFLOAT_ALIGNED_UNION(32, prev_dmix_re, 1024); /* Recalculated on every frame */
254  INTFLOAT_ALIGNED_UNION(32, dmix_im, 1024); /* Final prediction data */
255 } AACUsacStereo;
256 
257 /**
258  * channel element - generic struct for SCE/CPE/CCE/LFE
259  */
260 typedef struct ChannelElement {
261  int present;
262  // CPE specific
263  uint8_t max_sfb_ste; ///< (USAC) Maximum of both max_sfb values
264  uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scalefactor window band
265  // shared
267  // CCE specific
269  // USAC stereo coupling data
272 
273 typedef struct AACUSACLoudnessInfo {
274  uint8_t drc_set_id : 6;
275  uint8_t downmix_id : 7;
276  struct {
277  uint16_t lvl : 12;
278  uint8_t present : 1;
279  } sample_peak;
280 
281  struct {
282  uint16_t lvl : 12;
283  uint8_t measurement : 4;
284  uint8_t reliability : 2;
285  uint8_t present : 1;
286  } true_peak;
287 
288  uint8_t nb_measurements : 4;
289  struct {
290  uint8_t method_def : 4;
291  uint8_t method_val;
292  uint8_t measurement : 4;
293  uint8_t reliability : 2;
294  } measurements[16];
296 
297 typedef struct AACUsacElemConfig {
299 
300  uint8_t tw_mdct : 1;
301  uint8_t noise_fill : 1;
302 
304 
305  struct {
306  int ratio;
307 
308  uint8_t harmonic_sbr : 1; /* harmonicSBR */
309  uint8_t bs_intertes : 1; /* bs_interTes */
310  uint8_t bs_pvc : 1; /* bs_pvc */
311 
312  struct {
313  uint8_t start_freq; /* dflt_start_freq */
314  uint8_t stop_freq; /* dflt_stop_freq */
315 
316  uint8_t freq_scale; /* dflt_freq_scale */
317  uint8_t alter_scale : 1; /* dflt_alter_scale */
318  uint8_t noise_bands; /* dflt_noise_bands */
319 
320  uint8_t limiter_bands; /* dflt_limiter_bands */
321  uint8_t limiter_gains; /* dflt_limiter_gains */
322  uint8_t interpol_freq : 1; /* dflt_interpol_freq */
323  uint8_t smoothing_mode : 1; /* dflt_smoothing_mode */
324  } dflt;
325  } sbr;
326 
327  struct {
328  uint8_t freq_res; /* bsFreqRes */
329  uint8_t fixed_gain; /* bsFixedGainDMX */
330  uint8_t temp_shape_config; /* bsTempShapeConfig */
331  uint8_t decorr_config; /* bsDecorrConfig */
332  uint8_t high_rate_mode : 1; /* bsHighRateMode */
333  uint8_t phase_coding : 1; /* bsPhaseCoding */
334 
335  uint8_t otts_bands_phase; /* bsOttBandsPhase */
336  uint8_t residual_coding; /* bsResidualCoding */
337  uint8_t residual_bands; /* bsResidualBands */
338  uint8_t pseudo_lr : 1; /* bsPseudoLr */
339  uint8_t env_quant_mode : 1; /* bsEnvQuantMode */
340  } mps;
341 
342  struct {
344  uint8_t payload_frag;
345  uint32_t default_len;
346  uint32_t pl_data_offset;
347  uint8_t *pl_data;
348  } ext;
350 
351 typedef struct AACUSACConfig {
352  uint8_t core_sbr_frame_len_idx; /* coreSbrFrameLengthIndex */
353  uint16_t core_frame_len;
355 
357  int nb_elems;
358 
359  struct {
360  uint8_t nb_album;
362  uint8_t nb_info;
364  } loudness;
365 } AACUSACConfig;
366 
367 typedef struct OutputConfiguration {
369  uint8_t layout_map[MAX_ELEM_ID*4][3];
375 
376 /**
377  * Dynamic Range Control - decoded from the bitstream but not processed further.
378  */
379 typedef struct DynamicRangeControl {
380  int pce_instance_tag; ///< Indicates with which program the DRC info is associated.
381  int dyn_rng_sgn[17]; ///< DRC sign information; 0 - positive, 1 - negative
382  int dyn_rng_ctl[17]; ///< DRC magnitude information
383  int exclude_mask[MAX_CHANNELS]; ///< Channels to be excluded from DRC processing.
384  int band_incr; ///< Number of DRC bands greater than 1 having DRC info.
385  int interpolation_scheme; ///< Indicates the interpolation scheme used in the SBR QMF domain.
386  int band_top[17]; ///< Indicates the top of the i-th DRC band in units of 4 spectral lines.
387  int prog_ref_level; /**< A reference level for the long-term program audio level for all
388  * channels combined.
389  */
391 
392 /**
393  * Decode-specific primitives
394  */
395 typedef struct AACDecProc {
397  GetBitContext *gb,
398  const Pulse *pulse,
399  SingleChannelElement *sce);
400 
402 
403  int (*sbr_ctx_alloc_init)(AACDecContext *ac, ChannelElement **che, int id_aac);
405  GetBitContext *gb, int crc, int cnt, int id_aac);
407  int id_aac, void /* INTFLOAT */ *L, void /* INTFLOAT */ *R);
409 } AACDecProc;
410 
411 /**
412  * DSP-specific primitives
413  */
414 typedef struct AACDecDSP {
416 
419  int ms_present);
420 
421  void (*apply_tns)(void *_coef_param, TemporalNoiseShaping *tns,
422  IndividualChannelStream *ics, int decode);
423 
426 
428 
430  SingleChannelElement *target,
431  ChannelElement *cce, int index);
433  SingleChannelElement *target,
434  ChannelElement *cce, int index);
435 
441 
442  void (*clip_output)(AACDecContext *ac, ChannelElement *che, int type, int samples);
443 } AACDecDSP;
444 
445 /**
446  * main AAC decoding context
447  */
449  const struct AVClass *class;
451 
454 
455  struct AVFrame *frame;
456 
457  int is_saved; ///< Set if elements have stored overlap from previous frame.
459 
460  /**
461  * @name Channel element related data
462  * @{
463  */
468  /** @} */
469 
470  /**
471  * @name temporary aligned temporary buffers
472  * (We do not want to have these on the stack.)
473  * @{
474  */
475  INTFLOAT_ALIGNED_UNION(32, buf_mdct, 1024);
476  INTFLOAT_ALIGNED_UNION(32, temp, 128);
477  /** @} */
478 
479  /**
480  * @name Computed / set up during initialization
481  * @{
482  */
492 
502  union {
505  };
507  /** @} */
508 
509  /**
510  * @name Members used for output
511  * @{
512  */
513  SingleChannelElement *output_element[MAX_CHANNELS]; ///< Points to each SingleChannelElement
514  /** @} */
515 
516 
517  /**
518  * @name Japanese DTV specific extension
519  * @{
520  */
521  int force_dmono_mode;///< 0->not dmono, 1->use first channel, 2->use second channel
522  int dmono_mode; ///< 0->not dmono, 1->use first channel, 2->use second channel
523  /** @} */
524 
526 
530  unsigned warned_71_wide;
533 
534  int is_fixed;
535 };
536 
537 #if defined(USE_FIXED) && USE_FIXED
538 #define fdsp RENAME_FIXED(fdsp)
539 #endif
540 
544 
546  GetBitContext *gb, int common_window, int scale_flag);
547 
549  GetBitContext *gb, const IndividualChannelStream *ics);
550 
552  uint8_t (*layout_map)[3],
553  int *tags,
554  int channel_config);
555 
557  uint8_t layout_map[MAX_ELEM_ID * 4][3], int tags,
558  enum OCStatus oc_type, int get_new_frame);
559 
560 ChannelElement *ff_aac_get_che(AACDecContext *ac, int type, int elem_id);
561 
562 #endif /* AVCODEC_AAC_AACDEC_H */
ChannelCoupling::type
enum RawDataBlockType type[8]
Type of channel element to be coupled - SCE or CPE.
Definition: aacdec.h:199
CouplingPoint
CouplingPoint
The point during decoding at which channel coupling is applied.
Definition: aacdec.h:68
MAX_ELEM_ID
#define MAX_ELEM_ID
Definition: aac.h:34
AACUsacElemConfig::stereo_config_index
uint8_t stereo_config_index
Definition: aacdec.h:303
AACUsacStereo::tns_on_lr
uint8_t tns_on_lr
Apply TNS before M/S and stereo prediction.
Definition: aacdec.h:235
AACUsacElemData::ac
AACArithState ac
Definition: aacdec.h:156
AACDecProc::decode_spectrum_and_dequant
int(* decode_spectrum_and_dequant)(AACDecContext *ac, GetBitContext *gb, const Pulse *pulse, SingleChannelElement *sce)
Definition: aacdec.h:396
AACUsacElemData::offset
uint8_t offset
Definition: aacdec.h:148
AACUsacElemConfig::limiter_gains
uint8_t limiter_gains
Definition: aacdec.h:321
AACDecContext::mdct960_fn
av_tx_fn mdct960_fn
Definition: aacdec.h:499
AACOutputChannelOrder
AACOutputChannelOrder
Definition: aacdec.h:60
SingleChannelElement::predictor_state
struct PredictorState * predictor_state
Definition: aacdec.h:224
BETWEEN_TNS_AND_IMDCT
@ BETWEEN_TNS_AND_IMDCT
Definition: aacdec.h:70
AACDecDSP::apply_intensity_stereo
void(* apply_intensity_stereo)(AACDecContext *ac, ChannelElement *cpe, int ms_present)
Definition: aacdec.h:418
aacdec_ac.h
AACUSACConfig
Definition: aacdec.h:351
ID_EXT_ELE_SAOC
@ ID_EXT_ELE_SAOC
Definition: aacdec.h:90
mem_internal.h
AACDecContext::mdct1024_fn
av_tx_fn mdct1024_fn
Definition: aacdec.h:500
AACUSACConfig::stream_identifier
uint16_t stream_identifier
Definition: aacdec.h:354
AACUSACConfig::nb_album
uint8_t nb_album
Definition: aacdec.h:360
AACDecContext::warned_he_aac_mono
int warned_he_aac_mono
Definition: aacdec.h:532
AACDecContext::mdct96
AVTXContext * mdct96
Definition: aacdec.h:483
AACUsacElemConfig::payload_frag
uint8_t payload_frag
Definition: aacdec.h:344
AACUsacElemConfig::sbr
struct AACUsacElemConfig::@24 sbr
LongTermPrediction::INTFLOAT_UNION
INTFLOAT_UNION(coef,)
AVTXContext
Definition: tx_priv.h:235
AACDecProc::sbr_ctx_alloc_init
int(* sbr_ctx_alloc_init)(AACDecContext *ac, ChannelElement **che, int id_aac)
Definition: aacdec.h:403
ID_USAC_LFE
@ ID_USAC_LFE
Definition: aacdec.h:77
LongTermPrediction::used
int8_t used[MAX_LTP_LONG_SFB]
Definition: aacdec.h:121
AACDecContext::mdct768
AVTXContext * mdct768
Definition: aacdec.h:488
AACUsacElemConfig::tw_mdct
uint8_t tw_mdct
Definition: aacdec.h:300
OC_TRIAL_PCE
@ OC_TRIAL_PCE
Output configuration under trial specified by an inband PCE.
Definition: aacdec.h:54
AACUsacElemData::acelp_core_mode
uint8_t acelp_core_mode
Definition: aacdec.h:135
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
LongTermPrediction::coef
float coef
Definition: aacenc.h:84
AACDecContext::mdct960
AVTXContext * mdct960
Definition: aacdec.h:489
AACUsacStereo::config_idx
uint8_t config_idx
Definition: aacdec.h:238
R
#define R
Definition: huffyuv.h:44
TemporalNoiseShaping::present
int present
Definition: aacdec.h:185
AACUsacElemData::scale_factor_grouping
uint8_t scale_factor_grouping
Definition: aacdec.h:127
AACDecContext::tag_che_map
ChannelElement * tag_che_map[4][MAX_ELEM_ID]
Definition: aacdec.h:465
AACUSACConfig::nb_info
uint8_t nb_info
Definition: aacdec.h:362
AVFixedDSPContext
Definition: fixed_dsp.h:55
AACUSACLoudnessInfo::measurement
uint8_t measurement
Definition: aacdec.h:283
AACDecDSP::apply_tns
void(* apply_tns)(void *_coef_param, TemporalNoiseShaping *tns, IndividualChannelStream *ics, int decode)
Definition: aacdec.h:421
AACUsacElemConfig::noise_bands
uint8_t noise_bands
Definition: aacdec.h:318
AACDecContext::warned_remapping_once
int warned_remapping_once
Definition: aacdec.h:467
AACDecContext::proc
AACDecProc proc
Definition: aacdec.h:453
AACUsacElemConfig::bs_pvc
uint8_t bs_pvc
Definition: aacdec.h:310
AACUsacStereo::pred_dir
uint8_t pred_dir
Definition: aacdec.h:242
AACDecContext::mdct512_fn
av_tx_fn mdct512_fn
Definition: aacdec.h:497
AACDecDSP::apply_prediction
void(* apply_prediction)(AACDecContext *ac, SingleChannelElement *sce)
Definition: aacdec.h:427
AACUsacElemData::tns_data_present
uint8_t tns_data_present
Definition: aacdec.h:128
ChannelElement::ch
SingleChannelElement ch[2]
Definition: aacdec.h:266
AACUsacElemData::level
uint8_t level
Definition: aacdec.h:147
ChannelElement::present
int present
Definition: aacdec.h:261
ID_CONFIG_EXT_STREAM_ID
@ ID_CONFIG_EXT_STREAM_ID
Definition: aacdec.h:84
ID_USAC_EXT
@ ID_USAC_EXT
Definition: aacdec.h:78
ff_aac_decode_init_float
int ff_aac_decode_init_float(AVCodecContext *avctx)
Definition: aacdec_float.c:164
AACDecContext::dmono_mode
int dmono_mode
0->not dmono, 1->use first channel, 2->use second channel
Definition: aacdec.h:522
MPEG4AudioConfig
Definition: mpeg4audio.h:29
DynamicRangeControl
Dynamic Range Control - decoded from the bitstream but not processed further.
Definition: aacdec.h:379
AACUsacElemConfig::pseudo_lr
uint8_t pseudo_lr
Definition: aacdec.h:338
IndividualChannelStream::num_swb
int num_swb
number of scalefactor window bands
Definition: aacdec.h:171
ff_aac_decode_init_fixed
int ff_aac_decode_init_fixed(AVCodecContext *avctx)
Dequantization-related.
Definition: aacdec_fixed.c:87
ChannelCoupling::INTFLOAT_UNION
INTFLOAT_UNION(gain, [16][120])
ChannelCoupling::coupling_point
enum CouplingPoint coupling_point
The point during decoding at which coupling is applied.
Definition: aacdec.h:197
SingleChannelElement::coeffs
float coeffs[1024]
coefficients for IMDCT, maybe processed
Definition: aacenc.h:139
AACUsacElemData::core_mode
uint8_t core_mode
Definition: aacdec.h:126
AACDecContext::force_dmono_mode
int force_dmono_mode
0->not dmono, 1->use first channel, 2->use second channel
Definition: aacdec.h:521
AACDecContext::warned_960_sbr
int warned_960_sbr
Definition: aacdec.h:529
AACDecContext::mdct480
AVTXContext * mdct480
Definition: aacdec.h:486
mpeg4audio.h
AACUsacElemConfig::interpol_freq
uint8_t interpol_freq
Definition: aacdec.h:322
AACUsacElemData::gain
uint8_t gain
Definition: aacdec.h:152
AACUsacElemConfig::dflt
struct AACUsacElemConfig::@24::@27 dflt
ChannelElement::coup
ChannelCoupling coup
Definition: aacdec.h:268
ChannelCoupling::id_select
int id_select[8]
element id
Definition: aacdec.h:200
SingleChannelElement::ret_buf
float ret_buf[2048]
PCM output buffer.
Definition: aacenc.h:140
ID_EXT_ELE_AUDIOPREROLL
@ ID_EXT_ELE_AUDIOPREROLL
Definition: aacdec.h:91
AACDecContext::warned_71_wide
unsigned warned_71_wide
Definition: aacdec.h:530
GetBitContext
Definition: get_bits.h:108
AACUSACLoudnessInfo::method_def
uint8_t method_def
Definition: aacdec.h:290
IndividualChannelStream::window_clipping
uint8_t window_clipping[8]
set if a certain window is near clipping
Definition: aacdec.h:178
AACDecContext::tags_mapped
int tags_mapped
Definition: aacdec.h:466
AACUsacElemConfig::high_rate_mode
uint8_t high_rate_mode
Definition: aacdec.h:332
AACDecProc::sbr_apply
void(* sbr_apply)(AACDecContext *ac, ChannelElement *che, int id_aac, void *L, void *R)
Definition: aacdec.h:406
OutputConfiguration::status
enum OCStatus status
Definition: aacdec.h:372
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
AACUsacElemConfig::freq_res
uint8_t freq_res
Definition: aacdec.h:328
AACDecContext::che_drc
DynamicRangeControl che_drc
Definition: aacdec.h:458
MAX_LTP_LONG_SFB
#define MAX_LTP_LONG_SFB
Definition: aac.h:37
SingleChannelElement::ics
IndividualChannelStream ics
Definition: aacdec.h:211
AACDecContext::mdct480_fn
av_tx_fn mdct480_fn
Definition: aacdec.h:496
AACUSACConfig::elems
AACUsacElemConfig elems[64]
Definition: aacdec.h:356
AACUsacElemConfig::pl_data_offset
uint32_t pl_data_offset
Definition: aacdec.h:346
ID_CONFIG_EXT_FILL
@ ID_CONFIG_EXT_FILL
Definition: aacdec.h:82
AACUsacElemConfig
Definition: aacdec.h:297
AACUsacElemData::kv
uint32_t kv[8][8]
Definition: aacdec.h:153
AACUsacElemConfig::ext
struct AACUsacElemConfig::@26 ext
AACUsacElemData::last_lpd_mode
int last_lpd_mode
Definition: aacdec.h:142
AACDecDSP::dequant_scalefactors
void(* dequant_scalefactors)(SingleChannelElement *sce)
Definition: aacdec.h:415
AACUsacElemConfig::residual_bands
uint8_t residual_bands
Definition: aacdec.h:337
DynamicRangeControl::exclude_mask
int exclude_mask[MAX_CHANNELS]
Channels to be excluded from DRC processing.
Definition: aacdec.h:383
av_tx_fn
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
Definition: tx.h:151
ff_aac_decode_init
int ff_aac_decode_init(AVCodecContext *avctx)
Definition: aacdec.c:1177
OC_GLOBAL_HDR
@ OC_GLOBAL_HDR
Output configuration set in a global header but not yet locked.
Definition: aacdec.h:56
SingleChannelElement::ltp_state
float ltp_state[3072]
time signal for LTP
Definition: aacenc.h:141
AACDecContext::mdct_ltp
AVTXContext * mdct_ltp
Definition: aacdec.h:491
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:72
AACUsacElemData::core_mode_last
uint8_t core_mode_last
Definition: aacdec.h:139
AACUsacElemConfig::harmonic_sbr
uint8_t harmonic_sbr
Definition: aacdec.h:308
AACDecDSP::apply_mid_side_stereo
void(* apply_mid_side_stereo)(AACDecContext *ac, ChannelElement *cpe)
Definition: aacdec.h:417
ChannelCoupling::num_coupled
int num_coupled
number of target elements
Definition: aacdec.h:198
TemporalNoiseShaping::direction
int direction[8][4]
Definition: aacdec.h:188
AACUsacElemConfig::pl_data
uint8_t * pl_data
Definition: aacdec.h:347
AACDecProc::decode_cce
int(* decode_cce)(AACDecContext *ac, GetBitContext *gb, ChannelElement *che)
Definition: aacdec.h:401
PredictorState
Predictor State.
Definition: aac_defines.h:130
AACUsacElemData
Definition: aacdec.h:125
AACDecDSP::imdct_and_windowing_ld
void(* imdct_and_windowing_ld)(AACDecContext *ac, SingleChannelElement *sce)
Definition: aacdec.h:439
AACUsacStereo::ms_mask_mode
uint8_t ms_mask_mode
Definition: aacdec.h:237
LongTermPrediction::present
int8_t present
Definition: aacdec.h:118
AACUSACConfig::core_sbr_frame_len_idx
uint8_t core_sbr_frame_len_idx
Definition: aacdec.h:352
fixed_dsp.h
ExtensionHeaderType
ExtensionHeaderType
Definition: aacdec.h:81
IndividualChannelStream
Individual Channel Stream.
Definition: aacdec.h:162
AACDecContext::che
ChannelElement * che[4][MAX_ELEM_ID]
Definition: aacdec.h:464
UNIDRCLOUDEXT_TERM
@ UNIDRCLOUDEXT_TERM
Definition: aacdec.h:96
ID_USAC_CPE
@ ID_USAC_CPE
Definition: aacdec.h:76
AACDecContext::fdsp
AVFloatDSPContext * fdsp
Definition: aacdec.h:504
AACDecContext::warned_num_aac_frames
int warned_num_aac_frames
Definition: aacdec.h:528
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
AACDecContext::mdct96_fn
av_tx_fn mdct96_fn
Definition: aacdec.h:493
AACDecProc::sbr_decode_extension
int(* sbr_decode_extension)(AACDecContext *ac, ChannelElement *che, GetBitContext *gb, int crc, int cnt, int id_aac)
Definition: aacdec.h:404
AACUsacElemData::seed
unsigned int seed
Definition: aacdec.h:146
AACUSACConfig::core_frame_len
uint16_t core_frame_len
Definition: aacdec.h:353
IndividualChannelStream::use_kb_window
uint8_t use_kb_window[2]
If set, use Kaiser-Bessel window, otherwise use a sine window.
Definition: aacdec.h:165
IndividualChannelStream::num_window_groups
int num_window_groups
Definition: aacdec.h:166
AACUSACConfig::loudness
struct AACUSACConfig::@28 loudness
BEFORE_TNS
@ BEFORE_TNS
Definition: aacdec.h:69
ChannelElement::ms_mask
uint8_t ms_mask[128]
Set if mid/side stereo is used for each scalefactor window band.
Definition: aacdec.h:264
aac.h
IndividualChannelStream::predictor_present
int predictor_present
Definition: aacdec.h:174
DynamicRangeControl::band_top
int band_top[17]
Indicates the top of the i-th DRC band in units of 4 spectral lines.
Definition: aacdec.h:386
AACUsacElemConfig::noise_fill
uint8_t noise_fill
Definition: aacdec.h:301
AACUSACLoudnessInfo::drc_set_id
uint8_t drc_set_id
Definition: aacdec.h:274
AACUSACLoudnessInfo::lvl
uint16_t lvl
Definition: aacdec.h:277
SingleChannelElement::INTFLOAT_UNION
INTFLOAT_UNION(sf, [128])
scalefactors (8 windows * 16 sfb max)
AACUSACLoudnessInfo::measurements
struct AACUSACLoudnessInfo::@23 measurements[16]
AACUsacElemConfig::temp_shape_config
uint8_t temp_shape_config
Definition: aacdec.h:330
AACUSACLoudnessInfo::method_val
uint8_t method_val
Definition: aacdec.h:291
TNS_MAX_ORDER
#define TNS_MAX_ORDER
Definition: aac.h:36
AACDecContext::mdct120
AVTXContext * mdct120
Definition: aacdec.h:484
AACUsacStereo
Definition: aacdec.h:232
OC_LOCKED
@ OC_LOCKED
Output configuration locked in place.
Definition: aacdec.h:57
index
int index
Definition: gxfenc.c:90
IndividualChannelStream::prev_num_window_groups
int prev_num_window_groups
Previous frame's number of window groups.
Definition: aacdec.h:167
AACUsacElemConfig::default_len
uint32_t default_len
Definition: aacdec.h:345
float_dsp.h
OutputConfiguration::layout_map_tags
int layout_map_tags
Definition: aacdec.h:370
SingleChannelElement::ue
AACUsacElemData ue
USAC element data.
Definition: aacdec.h:212
AACUsacExtension
AACUsacExtension
Definition: aacdec.h:87
AACDecDSP
DSP-specific primitives.
Definition: aacdec.h:414
OutputConfiguration::layout_map
uint8_t layout_map[MAX_ELEM_ID *4][3]
Definition: aacdec.h:369
AACDecDSP::update_ltp
void(* update_ltp)(AACDecContext *ac, SingleChannelElement *sce)
Definition: aacdec.h:425
AACDecDSP::apply_independent_coupling
void(* apply_independent_coupling)(AACDecContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)
Definition: aacdec.h:432
AACUsacElemConfig::bs_intertes
uint8_t bs_intertes
Definition: aacdec.h:309
ff_aac_get_che
ChannelElement * ff_aac_get_che(AACDecContext *ac, int type, int elem_id)
Definition: aacdec.c:592
IndividualChannelStream::window_sequence
enum WindowSequence window_sequence[2]
Definition: aacdec.h:164
AACDecContext::dsp
AACDecDSP dsp
Definition: aacdec.h:452
AACDecDSP::clip_output
void(* clip_output)(AACDecContext *ac, ChannelElement *che, int type, int samples)
Definition: aacdec.h:442
OC_NONE
@ OC_NONE
Output unconfigured.
Definition: aacdec.h:53
AACDecDSP::apply_dependent_coupling
void(* apply_dependent_coupling)(AACDecContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)
Definition: aacdec.h:429
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:317
AACDecContext::mdct1024
AVTXContext * mdct1024
Definition: aacdec.h:490
BandType
BandType
Definition: aac.h:66
AACDecDSP::imdct_and_windowing
void(* imdct_and_windowing)(AACDecContext *ac, SingleChannelElement *sce)
Definition: aacdec.h:436
ChannelElement::max_sfb_ste
uint8_t max_sfb_ste
(USAC) Maximum of both max_sfb values
Definition: aacdec.h:263
OCStatus
OCStatus
Output configuration status.
Definition: aacdec.h:52
AACUsacElem
AACUsacElem
Definition: aacdec.h:74
SingleChannelElement::sfo
int sfo[128]
scalefactor offsets
Definition: aacdec.h:215
DynamicRangeControl::prog_ref_level
int prog_ref_level
A reference level for the long-term program audio level for all channels combined.
Definition: aacdec.h:387
AACUSACLoudnessInfo::nb_measurements
uint8_t nb_measurements
Definition: aacdec.h:288
AACDecContext::output_element
SingleChannelElement * output_element[MAX_CHANNELS]
Points to each SingleChannelElement.
Definition: aacdec.h:513
ChannelElement::us
AACUsacStereo us
Definition: aacdec.h:270
AVFloatDSPContext
Definition: float_dsp.h:24
AACDecContext::output_channel_order
enum AACOutputChannelOrder output_channel_order
Definition: aacdec.h:525
OutputConfiguration
Definition: aacdec.h:367
AACUSACLoudnessInfo::present
uint8_t present
Definition: aacdec.h:278
AACUsacElemConfig::mps
struct AACUsacElemConfig::@25 mps
AACDecContext::INTFLOAT_ALIGNED_UNION
INTFLOAT_ALIGNED_UNION(32, buf_mdct, 1024)
AACUsacElemConfig::stop_freq
uint8_t stop_freq
Definition: aacdec.h:314
SingleChannelElement::band_type
enum BandType band_type[128]
band types
Definition: aacdec.h:214
MAX_CHANNELS
#define MAX_CHANNELS
Definition: aac.h:33
AACDecContext::mdct128
AVTXContext * mdct128
Definition: aacdec.h:485
DynamicRangeControl::dyn_rng_ctl
int dyn_rng_ctl[17]
DRC magnitude information.
Definition: aacdec.h:382
AACUsacElemConfig::fixed_gain
uint8_t fixed_gain
Definition: aacdec.h:329
ID_CONFIG_EXT_LOUDNESS_INFO
@ ID_CONFIG_EXT_LOUDNESS_INFO
Definition: aacdec.h:83
AACDecDSP::apply_ltp
void(* apply_ltp)(AACDecContext *ac, SingleChannelElement *sce)
Definition: aacdec.h:424
SingleChannelElement::output
float * output
PCM output.
Definition: aacdec.h:227
AACDecContext::mdct768_fn
av_tx_fn mdct768_fn
Definition: aacdec.h:498
AACDecDSP::imdct_and_windowing_960
void(* imdct_and_windowing_960)(AACDecContext *ac, SingleChannelElement *sce)
Definition: aacdec.h:438
ff_aac_decode_tns
int ff_aac_decode_tns(AACDecContext *ac, TemporalNoiseShaping *tns, GetBitContext *gb, const IndividualChannelStream *ics)
Decode Temporal Noise Shaping data; reference: table 4.48.
Definition: aacdec.c:1557
ff_aac_output_configure
int ff_aac_output_configure(AACDecContext *ac, uint8_t layout_map[MAX_ELEM_ID *4][3], int tags, enum OCStatus oc_type, int get_new_frame)
Configure output channel order based on the current program configuration element.
Definition: aacdec.c:459
ff_aac_decode_ics
int ff_aac_decode_ics(AACDecContext *ac, SingleChannelElement *sce, GetBitContext *gb, int common_window, int scale_flag)
Decode an individual_channel_stream payload; reference: table 4.44.
Definition: aacdec.c:1664
AACUsacStereo::pred_used
uint8_t pred_used[128]
Definition: aacdec.h:245
AACUSACLoudnessInfo::downmix_id
uint8_t downmix_id
Definition: aacdec.h:275
ff_aac_set_default_channel_config
int ff_aac_set_default_channel_config(AACDecContext *ac, AVCodecContext *avctx, uint8_t(*layout_map)[3], int *tags, int channel_config)
Set up channel positions based on a default channel configuration as specified in table 1....
Definition: aacdec.c:552
CHANNEL_ORDER_CODED
@ CHANNEL_ORDER_CODED
Definition: aacdec.h:62
RawDataBlockType
RawDataBlockType
Definition: aac.h:39
SingleChannelElement
Single Channel Element - used for both SCE and LFE elements.
Definition: aacdec.h:210
AACDecContext::is_fixed
int is_fixed
Definition: aacdec.h:534
IndividualChannelStream::num_windows
int num_windows
Definition: aacdec.h:172
OutputConfiguration::usac
AACUSACConfig usac
Definition: aacdec.h:373
AACDecContext::warned_gain_control
int warned_gain_control
Definition: aacdec.h:531
AACDecContext::random_state
int random_state
Definition: aacdec.h:506
ChannelElement
channel element - generic struct for SCE/CPE/CCE/LFE
Definition: aacdec.h:260
IndividualChannelStream::swb_offset
const uint16_t * swb_offset
table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular wind...
Definition: aacdec.h:170
AACUsacElemConfig::type
enum AACUsacElem type
Definition: aacdec.h:298
RENAME_FIXED
#define RENAME_FIXED(name)
Definition: aacdec.h:101
LongTermPrediction::lag
int16_t lag
Definition: aacdec.h:119
AACUsacElemConfig::decorr_config
uint8_t decorr_config
Definition: aacdec.h:331
TemporalNoiseShaping::order
int order[8][4]
Definition: aacdec.h:189
NUM_TW_NODES
#define NUM_TW_NODES
Definition: aacdec.h:131
AACUsacStereo::use_prev_frame
uint8_t use_prev_frame
Definition: aacdec.h:241
AACDecContext::oc
OutputConfiguration oc[2]
Definition: aacdec.h:527
AACUsacStereo::common_tw
uint8_t common_tw
Definition: aacdec.h:234
IndividualChannelStream::tns_max_bands
int tns_max_bands
Definition: aacdec.h:173
TemporalNoiseShaping::length
int length[8][4]
Definition: aacdec.h:187
AACDecDSP::imdct_and_windowing_eld
void(* imdct_and_windowing_eld)(AACDecContext *ac, SingleChannelElement *sce)
Definition: aacdec.h:440
AACUsacElemConfig::limiter_bands
uint8_t limiter_bands
Definition: aacdec.h:320
AACUSACConfig::nb_elems
int nb_elems
Definition: aacdec.h:357
AACUsacElemConfig::start_freq
uint8_t start_freq
Definition: aacdec.h:313
avcodec.h
ID_EXT_ELE_UNI_DRC
@ ID_EXT_ELE_UNI_DRC
Definition: aacdec.h:92
SingleChannelElement::INTFLOAT_ALIGNED_UNION
INTFLOAT_ALIGNED_UNION(32, coeffs, 1024)
coefficients for IMDCT, maybe processed
DynamicRangeControl::pce_instance_tag
int pce_instance_tag
Indicates with which program the DRC info is associated.
Definition: aacdec.h:380
AACUsacStereo::common_window
uint8_t common_window
Definition: aacdec.h:233
AACUsacElemConfig::freq_scale
uint8_t freq_scale
Definition: aacdec.h:316
AACUsacStereo::complex_coef
uint8_t complex_coef
Definition: aacdec.h:243
AACDecContext::frame
struct AVFrame * frame
Definition: aacdec.h:455
UNIDRCLOUDEXT_EQ
@ UNIDRCLOUDEXT_EQ
Definition: aacdec.h:97
TemporalNoiseShaping::coef
float coef[8][4][TNS_MAX_ORDER]
Definition: aacenc.h:121
CHANNEL_ORDER_DEFAULT
@ CHANNEL_ORDER_DEFAULT
Definition: aacdec.h:61
ChannelCoupling::ch_select
int ch_select[8]
[0] shared list of gains; [1] list of gains for right channel; [2] list of gains for left channel; [3...
Definition: aacdec.h:201
AACUSACLoudnessInfo::true_peak
struct AACUSACLoudnessInfo::@22 true_peak
SingleChannelElement::tns
TemporalNoiseShaping tns
Definition: aacdec.h:213
TemporalNoiseShaping::INTFLOAT_UNION
INTFLOAT_UNION(coef, [8][4][TNS_MAX_ORDER])
AACDecContext
main AAC decoding context
Definition: aacdec.h:448
AACUSACConfig::info
AACUSACLoudnessInfo info[64]
Definition: aacdec.h:363
AVCodecContext
main external API structure.
Definition: avcodec.h:451
AACUsacElemData::fac_data_present
uint8_t fac_data_present
Definition: aacdec.h:140
LongTermPrediction
Long Term Prediction.
Definition: aacdec.h:117
channel_layout.h
AACDecContext::avctx
struct AVCodecContext * avctx
Definition: aacdec.h:450
AACUsacElemConfig::smoothing_mode
uint8_t smoothing_mode
Definition: aacdec.h:323
IndividualChannelStream::prediction_used
uint8_t prediction_used[41]
Definition: aacdec.h:177
AACUSACLoudnessInfo
Definition: aacdec.h:273
TemporalNoiseShaping
Temporal Noise Shaping.
Definition: aacdec.h:184
AACUsacElemConfig::env_quant_mode
uint8_t env_quant_mode
Definition: aacdec.h:339
temp
else temp
Definition: vf_mcdeint.c:263
L
#define L(x)
Definition: vpx_arith.h:36
samples
Filter the word “frame” indicates either a video frame or a group of audio samples
Definition: filter_design.txt:8
DynamicRangeControl::band_incr
int band_incr
Number of DRC bands greater than 1 having DRC info.
Definition: aacdec.h:384
AACDecContext::mdct_ltp_fn
av_tx_fn mdct_ltp_fn
Definition: aacdec.h:501
AACUsacElemConfig::ratio
int ratio
Definition: aacdec.h:306
OutputConfiguration::m4ac
MPEG4AudioConfig m4ac
Definition: aacdec.h:368
AACUsacElemData::fac
struct AACUsacElemData::@16 fac
OutputConfiguration::ch_layout
AVChannelLayout ch_layout
Definition: aacdec.h:371
AACDecDSP::imdct_and_windowing_768
void(* imdct_and_windowing_768)(AACDecContext *ac, SingleChannelElement *sce)
Definition: aacdec.h:437
AACDecContext::is_saved
int is_saved
Set if elements have stored overlap from previous frame.
Definition: aacdec.h:457
ID_EXT_ELE_MPEGS
@ ID_EXT_ELE_MPEGS
Definition: aacdec.h:89
DynamicRangeControl::dyn_rng_sgn
int dyn_rng_sgn[17]
DRC sign information; 0 - positive, 1 - negative.
Definition: aacdec.h:381
AACUsacElemData::tw_ratio
uint8_t tw_ratio[NUM_TW_NODES]
Definition: aacdec.h:132
AACUsacElemData::ldp
struct AACUsacElemData::@14 ldp
AACUSACLoudnessInfo::reliability
uint8_t reliability
Definition: aacdec.h:284
ChannelCoupling
coupling parameters
Definition: aacdec.h:196
AACUsacElemData::noise
struct AACUsacElemData::@15 noise
AACUsacStereo::INTFLOAT_ALIGNED_UNION
INTFLOAT_ALIGNED_UNION(32, alpha_q_re, 1024)
AACDecProc
Decode-specific primitives.
Definition: aacdec.h:395
IndividualChannelStream::max_sfb
uint8_t max_sfb
number of scalefactor bands per group
Definition: aacdec.h:163
Pulse
Definition: aac.h:99
AACDecContext::mdct512
AVTXContext * mdct512
Definition: aacdec.h:487
DynamicRangeControl::interpolation_scheme
int interpolation_scheme
Indicates the interpolation scheme used in the SBR QMF domain.
Definition: aacdec.h:385
WindowSequence
WindowSequence
Definition: aac.h:59
AFTER_IMDCT
@ AFTER_IMDCT
Definition: aacdec.h:71
AACUSACLoudnessInfo::sample_peak
struct AACUSACLoudnessInfo::@21 sample_peak
IndividualChannelStream::ltp
LongTermPrediction ltp
Definition: aacdec.h:169
AACUsacElemConfig::alter_scale
uint8_t alter_scale
Definition: aacdec.h:317
AACArithState
Definition: aacdec_ac.h:27
AACUsacElemConfig::residual_coding
uint8_t residual_coding
Definition: aacdec.h:336
AACUsacElemConfig::otts_bands_phase
uint8_t otts_bands_phase
Definition: aacdec.h:335
AACUSACLoudnessExt
AACUSACLoudnessExt
Definition: aacdec.h:95
IndividualChannelStream::group_len
uint8_t group_len[8]
Definition: aacdec.h:168
TemporalNoiseShaping::n_filt
int n_filt[8]
Definition: aacdec.h:186
AACUsacElemData::lpd_mode
uint8_t lpd_mode
Definition: aacdec.h:136
OC_TRIAL_FRAME
@ OC_TRIAL_FRAME
Output configuration under trial specified by a frame header.
Definition: aacdec.h:55
AACUsacElemData::bpf_control_info
uint8_t bpf_control_info
Definition: aacdec.h:138
AACUsacElemConfig::phase_coding
uint8_t phase_coding
Definition: aacdec.h:333
AACDecProc::sbr_ctx_close
void(* sbr_ctx_close)(ChannelElement *che)
Definition: aacdec.h:408
ID_EXT_ELE_FILL
@ ID_EXT_ELE_FILL
Definition: aacdec.h:88
IndividualChannelStream::predictor_reset_group
int predictor_reset_group
Definition: aacdec.h:176
tx.h
AACUSACConfig::album_info
AACUSACLoudnessInfo album_info[64]
Definition: aacdec.h:361
AACDecContext::mdct120_fn
av_tx_fn mdct120_fn
Definition: aacdec.h:494
AACDecContext::mdct128_fn
av_tx_fn mdct128_fn
Definition: aacdec.h:495
IndividualChannelStream::predictor_initialized
int predictor_initialized
Definition: aacdec.h:175
ID_USAC_SCE
@ ID_USAC_SCE
Definition: aacdec.h:75