FFmpeg: libavcodec/aacdec.h Source File
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_AACDEC_H
31 #define AVCODEC_AACDEC_H
32
33 #include <stdint.h>
34
40
45
46 /**
47 * Output configuration status
48 */
51 OC_TRIAL_PCE,
///< Output configuration under trial specified by an inband PCE
52 OC_TRIAL_FRAME,
///< Output configuration under trial specified by a frame header
53 OC_GLOBAL_HDR,
///< Output configuration set in a global header but not yet locked
54 OC_LOCKED,
///< Output configuration locked in place
55 };
56
60 };
61
62 /**
63 * The point during decoding at which channel coupling is applied.
64 */
69 };
70
71 /**
72 * Long Term Prediction
73 */
80
81 /**
82 * Individual Channel Stream
83 */
85 uint8_t
max_sfb;
///< number of scalefactor bands per group
87 uint8_t
use_kb_window[2];
///< If set, use Kaiser-Bessel window, otherwise use a sine window.
91 const uint16_t *
swb_offset;
///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window
92 int num_swb;
///< number of scalefactor window bands
101
102 /**
103 * Temporal Noise Shaping
104 */
113
114 /**
115 * coupling parameters
116 */
122 int ch_select[8];
/**< [0] shared list of gains; [1] list of gains for right channel;
123 * [2] list of gains for left channel; [3] lists of gains for both channels
124 */
127
128 /**
129 * Single Channel Element - used for both SCE and LFE elements.
130 */
144
145 /**
146 * channel element - generic struct for SCE/CPE/CCE/LFE
147 */
150 // CPE specific
151 uint8_t
ms_mask[128];
///< Set if mid/side stereo is used for each scalefactor window band
152 // shared
154 // CCE specific
158
166
167 /**
168 * Dynamic Range Control - decoded from the bitstream but not processed further.
169 */
172 int dyn_rng_sgn[17];
///< DRC sign information; 0 - positive, 1 - negative
175 int band_incr;
///< Number of DRC bands greater than 1 having DRC info.
177 int band_top[17];
///< Indicates the top of the i-th DRC band in units of 4 spectral lines.
178 int prog_ref_level;
/**< A reference level for the long-term program audio level for all
179 * channels combined.
180 */
182
183 /**
184 * main AAC decoding context
185 */
190
191 int is_saved;
///< Set if elements have stored overlap from previous frame.
193
194 /**
195 * @name Channel element related data
196 * @{
197 */
202 /** @} */
203
204 /**
205 * @name temporary aligned temporary buffers
206 * (We do not want to have these on the stack.)
207 * @{
208 */
211 /** @} */
212
213 /**
214 * @name Computed / set up during initialization
215 * @{
216 */
224
232 #if USE_FIXED
234 #else
236 #endif /* USE_FIXED */
238 /** @} */
239
240 /**
241 * @name Members used for output
242 * @{
243 */
245 /** @} */
246
247
248 /**
249 * @name Japanese DTV specific extension
250 * @{
251 */
253 int dmono_mode;
///< 0->not dmono, 1->use first channel, 2->use second channel
254 /** @} */
255
257
264
265 /* aacdec functions pointers */
276
278
279 #endif /* AVCODEC_AACDEC_H */
enum RawDataBlockType type[8]
Type of channel element to be coupled - SCE or CPE.
CouplingPoint
The point during decoding at which channel coupling is applied.
void(* update_ltp)(struct AACDecContext *ac, SingleChannelElement *sce)
int8_t used[MAX_LTP_LONG_SFB]
@ OC_TRIAL_PCE
Output configuration under trial specified by an inband PCE.
This structure describes decoded (raw) audio or video data.
ChannelElement * tag_che_map[4][MAX_ELEM_ID]
int warned_remapping_once
INTFLOAT * ret
PCM output.
SingleChannelElement ch[2]
int dmono_mode
0->not dmono, 1->use first channel, 2->use second channel
Dynamic Range Control - decoded from the bitstream but not processed further.
int num_swb
number of scalefactor window bands
enum CouplingPoint coupling_point
The point during decoding at which coupling is applied.
int force_dmono_mode
0->not dmono, 1->use first channel, 2->use second channel
INTFLOAT saved[1536]
overlap
INTFLOAT ret_buf[2048]
PCM output buffer.
void(* vector_pow43)(int *coefs, int len)
int id_select[8]
element id
uint8_t window_clipping[8]
set if a certain window is near clipping
DynamicRangeControl che_drc
IndividualChannelStream ics
int exclude_mask[MAX_CHANNELS]
Channels to be excluded from DRC processing.
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
@ OC_GLOBAL_HDR
Output configuration set in a global header but not yet locked.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
INTFLOAT coeffs[1024]
coefficients for IMDCT, maybe processed
int num_coupled
number of target elements
void(* apply_ltp)(struct AACDecContext *ac, SingleChannelElement *sce)
Individual Channel Stream.
ChannelElement * che[4][MAX_ELEM_ID]
INTFLOAT coef[8][4][TNS_MAX_ORDER]
void(* imdct_and_windowing)(struct AACDecContext *ac, SingleChannelElement *sce)
int warned_num_aac_frames
PredictorState predictor_state[MAX_PREDICTORS]
Describe the class of an AVClass context structure.
uint8_t use_kb_window[2]
If set, use Kaiser-Bessel window, otherwise use a sine window.
uint8_t ms_mask[128]
Set if mid/side stereo is used for each scalefactor window band.
int band_top[17]
Indicates the top of the i-th DRC band in units of 4 spectral lines.
@ OC_LOCKED
Output configuration locked in place.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int band_type_run_end[120]
band type run end points
uint8_t layout_map[MAX_ELEM_ID *4][3]
enum WindowSequence window_sequence[2]
@ OC_NONE
Output unconfigured.
void(* windowing_and_mdct_ltp)(struct AACDecContext *ac, INTFLOAT *out, INTFLOAT *in, IndividualChannelStream *ics)
static void scale(int *out, const int *in, const int w, const int h, const int shift)
An AVChannelLayout holds information about the channel layout of audio data.
#define DECLARE_ALIGNED(n, t, v)
OCStatus
Output configuration status.
int prog_ref_level
A reference level for the long-term program audio level for all channels combined.
Spectral Band Replication.
SingleChannelElement * output_element[MAX_CHANNELS]
Points to each SingleChannelElement.
enum AACOutputChannelOrder output_channel_order
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 offset
enum BandType band_type[128]
band types
int dyn_rng_ctl[17]
DRC magnitude information.
Single Channel Element - used for both SCE and LFE elements.
SpectralBandReplication sbr
channel element - generic struct for SCE/CPE/CCE/LFE
const uint16_t * swb_offset
table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular wind...
void(* subband_scale)(int *dst, int *src, int scale, int offset, int len, void *log_context)
OutputConfiguration oc[2]
int pce_instance_tag
Indicates with which program the DRC info is associated.
INTFLOAT sf[120]
scalefactors
int ch_select[8]
[0] shared list of gains; [1] list of gains for right channel; [2] list of gains for left channel; [3...
main AAC decoding context
main external API structure.
struct AVCodecContext * avctx
uint8_t prediction_used[41]
int band_incr
Number of DRC bands greater than 1 having DRC info.
AVChannelLayout ch_layout
int is_saved
Set if elements have stored overlap from previous frame.
void(* apply_tns)(INTFLOAT coef[1024], TemporalNoiseShaping *tns, IndividualChannelStream *ics, int decode)
int dyn_rng_sgn[17]
DRC sign information; 0 - positive, 1 - negative.
uint8_t max_sfb
number of scalefactor bands per group
INTFLOAT ltp_state[3072]
time signal for LTP
int interpolation_scheme
Indicates the interpolation scheme used in the SBR QMF domain.
void ff_aacdec_init_mips(AACDecContext *c)
@ OC_TRIAL_FRAME
Output configuration under trial specified by a frame header.
int predictor_reset_group
int predictor_initialized
Generated on Thu Sep 26 2024 23:14:46 for FFmpeg by
doxygen
1.8.17