30#ifndef AVCODEC_AAC_AACDEC_H
31#define AVCODEC_AAC_AACDEC_H
108#define RENAME_FIXED(name) name ## _fixed
110#define INTFLOAT_UNION(name, elems) \
112 int RENAME_FIXED(name) elems; \
116#define INTFLOAT_ALIGNED_UNION(alignment, name, nb_elems) \
118 DECLARE_ALIGNED(alignment, int, RENAME_FIXED(name))[nb_elems]; \
119 DECLARE_ALIGNED(alignment, float, name)[nb_elems]; \
138#define NUM_TW_NODES 16
595#if defined(USE_FIXED) && USE_FIXED
596#define fdsp RENAME_FIXED(fdsp)
610 uint8_t (*layout_map)[3],
616 enum OCStatus oc_type,
int get_new_frame);
AAC definitions and structures.
#define MPS_MAX_TIME_SLOTS
#define MPS_MAX_PARAM_SETS
#define MPS_MAX_PARAM_BANDS
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.
CouplingPoint
The point during decoding at which channel coupling is applied.
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.
ChannelElement * ff_aac_get_che(AACDecContext *ac, int type, int elem_id)
#define RENAME_FIXED(name)
@ ID_EXT_ELE_AUDIOPREROLL
int ff_aac_decode_tns(AACDecContext *ac, TemporalNoiseShaping *tns, GetBitContext *gb, const IndividualChannelStream *ics)
Decode Temporal Noise Shaping data; reference: table 4.48.
@ UNIDRCCONFEXT_PARAM_DRC
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....
int ff_aac_decode_init_fixed(AVCodecContext *avctx)
Dequantization-related.
int ff_aac_decode_init_float(AVCodecContext *avctx)
@ ID_CONFIG_EXT_LOUDNESS_INFO
@ ID_CONFIG_EXT_STREAM_ID
int ff_aac_decode_init(AVCodecContext *avctx)
OCStatus
Output configuration status.
@ OC_TRIAL_FRAME
Output configuration under trial specified by a frame header.
@ OC_TRIAL_PCE
Output configuration under trial specified by an inband PCE.
@ OC_LOCKED
Output configuration locked in place.
@ OC_GLOBAL_HDR
Output configuration set in a global header but not yet locked.
@ OC_NONE
Output unconfigured.
Libavcodec external API header.
Public libavutil channel layout APIs header.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static int noise(AVBSFContext *ctx, AVPacket *pkt)
main AAC decoding context
int target_level
Target output loudness in dBFS, used for xHE-AAC loudness normalization based on the parsed loudnessI...
int warned_loudness_missing
struct AVCodecContext * avctx
ChannelElement * che[4][MAX_ELEM_ID]
ChannelElement * tag_che_map[4][MAX_ELEM_ID]
int warned_remapping_once
DynamicRangeControl che_drc
enum AACOutputChannelOrder output_channel_order
int is_saved
Set if elements have stored overlap from previous frame.
INTFLOAT_ALIGNED_UNION(32, buf_mdct, 1024)
int warned_num_aac_frames
int dmono_mode
0->not dmono, 1->use first channel, 2->use second channel
SingleChannelElement * output_element[MAX_CHANNELS]
Points to each SingleChannelElement.
INTFLOAT_ALIGNED_UNION(32, temp, 128)
OutputConfiguration oc[2]
int force_dmono_mode
0->not dmono, 1->use first channel, 2->use second channel
void(* apply_intensity_stereo)(AACDecContext *ac, ChannelElement *cpe, int ms_present)
void(* imdct_and_windowing_eld)(AACDecContext *ac, SingleChannelElement *sce)
void(* imdct_and_windowing_960)(AACDecContext *ac, SingleChannelElement *sce)
void(* imdct_and_windowing_ld)(AACDecContext *ac, SingleChannelElement *sce)
void(* apply_independent_coupling)(AACDecContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)
void(* apply_prediction)(AACDecContext *ac, SingleChannelElement *sce)
void(* apply_tns)(void *_coef_param, TemporalNoiseShaping *tns, IndividualChannelStream *ics, int decode)
void(* imdct_and_windowing)(AACDecContext *ac, SingleChannelElement *sce)
void(* update_ltp)(AACDecContext *ac, SingleChannelElement *sce)
void(* apply_dependent_coupling)(AACDecContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)
void(* apply_ltp)(AACDecContext *ac, SingleChannelElement *sce)
void(* clip_output)(AACDecContext *ac, ChannelElement *che, int type, int samples)
void(* apply_mid_side_stereo)(AACDecContext *ac, ChannelElement *cpe)
void(* imdct_and_windowing_768)(AACDecContext *ac, SingleChannelElement *sce)
void(* dequant_scalefactors)(SingleChannelElement *sce)
Decode-specific primitives.
void(* sbr_ctx_close)(ChannelElement *che)
void(* sbr_apply)(AACDecContext *ac, ChannelElement *che, int id_aac, int fl960, void *L, void *R)
int(* decode_cce)(AACDecContext *ac, GetBitContext *gb, ChannelElement *che)
int(* sbr_ctx_alloc_init)(AACDecContext *ac, ChannelElement **che, int id_aac)
int(* sbr_decode_extension)(AACDecContext *ac, ChannelElement *che, GetBitContext *gb, int crc, int cnt, int id_aac, int fl960)
int(* decode_spectrum_and_dequant)(AACDecContext *ac, GetBitContext *gb, const Pulse *pulse, SingleChannelElement *sce)
AACUSACLoudnessInfo album_info[64]
uint8_t core_sbr_frame_len_idx
AACUSACLoudnessInfo info[64]
struct AACUSACConfig::@255231064241100350351340257372241321307313006210 loudness
uint16_t stream_identifier
int input_method_val
Raw bsMethodValue (μ) of the program/anchor-loudness measurement selected for normalization at config...
AACUsacElemConfig elems[MAX_ELEM_ID]
struct AACUSACLoudnessInfo::@144211065203337024143363352034022367376254316171 measurements[16]
struct AACUSACLoudnessInfo::@321071037316376126376256250004061141151267156374 sample_peak
struct AACUSACLoudnessInfo::@243062262052376245203144120027045262312013170327 true_peak
struct AACUsacElemConfig::@355171322144321232200235357333175172075212042356::@272034025153077076322075376027006155226106336120 dflt
struct AACUsacElemConfig::@155117225007163044355101232061326353222222330310 drc
uint8_t stereo_config_index
struct AACUsacElemConfig::@031364347270230120164276243152035317262270312044 mps
uint8_t temp_shape_config
struct AACUsacElemConfig::@253167335173233142055027357074223104054112322124 ext
uint8_t otts_bands_phase_present
struct AACUsacElemConfig::@155117225007163044355101232061326353222222330310::@250177363014367151273127351060337350061157103052 loudness
struct AACUsacElemConfig::@355171322144321232200235357333175172075212042356 sbr
uint8_t scale_factor_grouping
struct AACUsacElemData::@170324333014322114255251102173201272223305376176 ldp
struct AACUsacElemData::@261150123320056304135021253254164365325070141151 fac
uint8_t tw_ratio[NUM_TW_NODES]
int smooth_mode[MPS_MAX_PARAM_SETS]
int smooth_time[MPS_MAX_PARAM_SETS]
int16_t temp_shape_data[MPS_MAX_TIME_SLOTS]
int param_sets[MPS_MAX_PARAM_SETS]
int ott_idx[MPS_ELE_NB][MPS_MAX_PARAM_SETS][MPS_MAX_PARAM_BANDS]
AACMPSLosslessData ott[MPS_ELE_NB]
int freq_res_stride_smg[MPS_MAX_PARAM_SETS]
bool smg_data[MPS_MAX_PARAM_SETS][MPS_MAX_PARAM_BANDS]
bool temp_shape_enable_ch[2]
uint8_t tns_on_lr
Apply TNS before M/S and stereo prediction.
INTFLOAT_ALIGNED_UNION(32, dmix_im, 1024)
INTFLOAT_ALIGNED_UNION(32, prev_alpha_q_re, 1024)
INTFLOAT_ALIGNED_UNION(32, prev_alpha_q_im, 1024)
INTFLOAT_ALIGNED_UNION(32, prev_dmix_re, 1024)
INTFLOAT_ALIGNED_UNION(32, dmix_re, 1024)
INTFLOAT_ALIGNED_UNION(32, alpha_q_im, 1024)
INTFLOAT_ALIGNED_UNION(32, alpha_q_re, 1024)
An AVChannelLayout holds information about the channel layout of audio data.
Describe the class of an AVClass context structure.
main external API structure.
This structure describes decoded (raw) audio or video data.
int id_select[8]
element id
enum CouplingPoint coupling_point
The point during decoding at which coupling is applied.
int num_coupled
number of target elements
int ch_select[8]
[0] shared list of gains; [1] list of gains for right channel; [2] list of gains for left channel; [3...
INTFLOAT_UNION(gain, [16][120])
enum RawDataBlockType type[8]
Type of channel element to be coupled - SCE or CPE.
channel element - generic struct for SCE/CPE/CCE/LFE
uint8_t ms_mask[128]
Set if mid/side stereo is used for each scalefactor window band.
SingleChannelElement ch[2]
uint8_t max_sfb_ste
(USAC) Maximum of both max_sfb values
Dynamic Range Control - decoded from the bitstream but not processed further.
int interpolation_scheme
Indicates the interpolation scheme used in the SBR QMF domain.
int exclude_mask[MAX_CHANNELS]
Channels to be excluded from DRC processing.
int band_incr
Number of DRC bands greater than 1 having DRC info.
int dyn_rng_ctl[17]
DRC magnitude information.
int prog_ref_level
A reference level for the long-term program audio level for all channels combined.
int pce_instance_tag
Indicates with which program the DRC info is associated.
int band_top[17]
Indicates the top of the i-th DRC band in units of 4 spectral lines.
int dyn_rng_sgn[17]
DRC sign information; 0 - positive, 1 - negative.
Individual Channel Stream.
uint8_t max_sfb
number of scalefactor bands per group
int prev_num_window_groups
Previous frame's number of window groups.
int num_swb
number of scalefactor window bands
int predictor_reset_group
uint8_t prediction_used[41]
uint8_t use_kb_window[2]
If set, use Kaiser-Bessel window, otherwise use a sine window.
int predictor_initialized
enum WindowSequence window_sequence[2]
const uint16_t * swb_offset
table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular wind...
uint8_t window_clipping[8]
set if a certain window is near clipping
int8_t used[MAX_LTP_LONG_SFB]
AVChannelLayout ch_layout
uint8_t layout_map[MAX_ELEM_ID *4][3]
Single Channel Element - used for both SCE and LFE elements.
struct PredictorState * predictor_state
float coeffs[1024]
coefficients for IMDCT, maybe processed
INTFLOAT_ALIGNED_UNION(16, ltp_state, 3072)
time signal for LTP
int sfo[128]
scalefactor offsets
INTFLOAT_ALIGNED_UNION(32, ret_buf, 2048)
PCM output buffer.
INTFLOAT_ALIGNED_UNION(32, saved, 1536)
overlap
INTFLOAT_ALIGNED_UNION(32, prev_coeffs, 1024)
unscaled previous contents of coeffs[] for USAC
AACUsacElemData ue
USAC element data.
float ret_buf[2048]
PCM output buffer.
float * output
PCM output.
enum BandType band_type[128]
band types
INTFLOAT_ALIGNED_UNION(32, coeffs, 1024)
coefficients for IMDCT, maybe processed
IndividualChannelStream ics
INTFLOAT_UNION(sf, [128])
scalefactors (8 windows * 16 sfb max)
INTFLOAT_UNION(coef, [8][4][TNS_MAX_ORDER])
float coef[8][4][TNS_MAX_ORDER]
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.