34 #include "aac_defines.h" 35 #include "libavutil/float_dsp.h" 36 #include "libavutil/fixed_dsp.h" 42 #include "mpeg4audio.h" 47 #define MAX_CHANNELS 64 48 #define MAX_ELEM_ID 16 50 #define TNS_MAX_ORDER 20 51 #define MAX_LTP_LONG_SFB 40 53 #define CLIP_AVOIDANCE_FACTOR 0.95f 55 enum RawDataBlockType {
66 enum ExtensionPayloadID {
70 EXT_DYNAMIC_RANGE = 0xb,
72 EXT_SBR_DATA_CRC = 0xe,
92 #define IS_CODEBOOK_UNSIGNED(x) (((x) - 1) & 10) 94 enum ChannelPosition {
96 AAC_CHANNEL_FRONT = 1,
108 BETWEEN_TNS_AND_IMDCT,
125 uint8_t layout_map[MAX_ELEM_ID*4][3];
128 uint64_t channel_layout;
146 #define MAX_PREDICTORS 672 148 #define SCALE_DIV_512 36 149 #define SCALE_ONE_POS 140 150 #define SCALE_MAX_POS 255 151 #define SCALE_MAX_DIFF 60 152 #define SCALE_DIFF_ZERO 60 154 #define POW_SF2_ZERO 200 156 #define NOISE_PRE 256 157 #define NOISE_PRE_BITS 9 158 #define NOISE_OFFSET 90 168 int8_t used[MAX_LTP_LONG_SFB];
176 enum WindowSequence window_sequence[2];
177 uint8_t use_kb_window[2];
178 int num_window_groups;
179 uint8_t group_len[8];
186 int predictor_present;
187 int predictor_initialized;
188 int predictor_reset_group;
189 int predictor_reset_count[31];
190 uint8_t prediction_used[41];
191 uint8_t window_clipping[8];
204 int coef_idx[8][4][TNS_MAX_ORDER];
205 INTFLOAT coef[8][4][TNS_MAX_ORDER];
215 int exclude_mask[MAX_CHANNELS];
237 enum RawDataBlockType type[8];
242 INTFLOAT gain[16][120];
254 int band_type_run_end[120];
258 uint8_t can_pns[128];
281 uint8_t ms_mask[128];
282 uint8_t is_mask[128];
308 int warned_remapping_once;
357 int warned_num_aac_frames;
360 int warned_gain_control;
367 void (*windowing_and_mdct_ltp)(
AACContext *ac, INTFLOAT *out,
370 void (*vector_pow43)(
int *coefs,
int len);
371 void (*subband_scale)(
int *dst,
int *src,
int scale,
int offset,
int len);
Band types following are encoded differently from others.
Definition: aac.h:86
This structure describes decoded (raw) audio or video data.
Definition: frame.h:218
struct LongTermPrediction LongTermPrediction
Long Term Prediction.
Definition: fixed_dsp.h:56
INTFLOAT * ret
PCM output.
Definition: aac.h:269
int common_window
Set if channels share a common 'IndividualChannelStream' in bitstream.
Definition: aac.h:278
Dynamic Range Control - decoded from the bitstream but not processed further.
Definition: aac.h:211
struct PredictorState PredictorState
Predictor State.
Spectral data are scaled white noise not coded in the bitstream.
Definition: aac.h:87
int band_incr
Number of DRC bands greater than 1 having DRC info.
Definition: aac.h:216
int dmono_mode
0->not dmono, 1->use first channel, 2->use second channel
Definition: aac.h:351
const uint16_t * swb_offset
table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular wind...
Definition: aac.h:181
BandType
Definition: aac.h:82
Output configuration under trial specified by an inband PCE.
Definition: aac.h:117
CouplingPoint
The point during decoding at which channel coupling is applied.
Definition: aac.h:106
int num_coupled
number of target elements
Definition: aac.h:236
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
Definition: mem.h:120
Scalefactor data are intensity stereo positions (in phase).
Definition: aac.h:89
Output configuration set in a global header but not yet locked.
Definition: aac.h:119
Spectral Band Replication definitions and structures.
uint8_t max_sfb
number of scalefactor bands per group
Definition: aac.h:175
int num_swb
number of scalefactor window bands
Definition: aac.h:183
Definition: mpeg4audio.h:33
struct DynamicRangeControl DynamicRangeControl
Dynamic Range Control - decoded from the bitstream but not processed further.
int prog_ref_level
A reference level for the long-term program audio level for all channels combined.
Definition: aac.h:219
Output configuration locked in place.
Definition: aac.h:120
Predictor State.
Definition: aac.h:135
Definition: float_dsp.h:24
int pce_instance_tag
Indicates with which program the DRC info is associated.
Definition: aac.h:212
int interpolation_scheme
Indicates the interpolation scheme used in the SBR QMF domain.
Definition: aac.h:217
coupling parameters
Definition: aac.h:234
int force_dmono_mode
0->not dmono, 1->use first channel, 2->use second channel
Definition: aac.h:350
int is_saved
Set if elements have stored overlap from previous frame.
Definition: aac.h:298
Libavcodec external API header.
Temporal Noise Shaping.
Definition: aac.h:198
struct TemporalNoiseShaping TemporalNoiseShaping
Temporal Noise Shaping.
Long Term Prediction.
Definition: aac.h:163
main external API structure.
Definition: avcodec.h:1518
Describe the class of an AVClass context structure.
Definition: log.h:67
Spectral data are coded with an escape sequence.
Definition: aac.h:85
const uint8_t * swb_sizes
table of scalefactor band sizes for a particular window
Definition: aac.h:182
OCStatus
Output configuration status.
Definition: aac.h:115
main AAC context
Definition: aac.h:293
int ms_mode
Signals mid/side stereo flags coding mode (used by encoder)
Definition: aac.h:279
Output configuration under trial specified by a frame header.
Definition: aac.h:118
uint8_t is_mode
Set if any bands have been encoded using intensity stereo (used by encoder)
Definition: aac.h:280
Scalefactor data are intensity stereo positions (out of phase).
Definition: aac.h:88
Single Channel Element - used for both SCE and LFE elements.
Definition: aac.h:248
struct SingleChannelElement SingleChannelElement
Single Channel Element - used for both SCE and LFE elements.
Individual Channel Stream.
Definition: aac.h:174
float clip_avoidance_factor
set if any window is near clipping to the necessary atennuation factor to avoid it ...
Definition: aac.h:192
channel element - generic struct for SCE/CPE/CCE/LFE
Definition: aac.h:275
struct ChannelCoupling ChannelCoupling
coupling parameters
Scalefactors and spectral data are all zero.
Definition: aac.h:83
struct ChannelElement ChannelElement
channel element - generic struct for SCE/CPE/CCE/LFE
Spectral Band Replication.
Definition: sbr.h:139
struct IndividualChannelStream IndividualChannelStream
Individual Channel Stream.
Output unconfigured.
Definition: aac.h:116
This and later band types encode two values (rather than four) with one code word.
Definition: aac.h:84