FFmpeg
Data Structures | Macros | Functions | Variables
aacdec.c File Reference
#include "libavutil/float_dsp.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
#include "fft.h"
#include "mdct15.h"
#include "lpc.h"
#include "kbdwin.h"
#include "sinewin.h"
#include "aac.h"
#include "aactab.h"
#include "aacdectab.h"
#include "adts_header.h"
#include "cbrt_data.h"
#include "sbr.h"
#include "aacsbr.h"
#include "mpeg4audio.h"
#include "profiles.h"
#include "libavutil/intfloat.h"
#include <errno.h>
#include <math.h>
#include <stdint.h>
#include <string.h>
#include "aacdec_template.c"

Go to the source code of this file.

Data Structures

struct  LATMContext
 

Macros

#define FFT_FLOAT   1
 
#define FFT_FIXED_32   0
 
#define USE_FIXED   0
 
#define LOAS_SYNC_WORD   0x2b7
 11 bits LOAS sync word More...
 

Functions

static av_always_inline void reset_predict_state (PredictorState *ps)
 
static float * VMUL2 (float *dst, const float *v, unsigned idx, const float *scale)
 
static float * VMUL4 (float *dst, const float *v, unsigned idx, const float *scale)
 
static float * VMUL2S (float *dst, const float *v, unsigned idx, unsigned sign, const float *scale)
 
static float * VMUL4S (float *dst, const float *v, unsigned idx, unsigned sign, const float *scale)
 
static av_always_inline float flt16_round (float pf)
 
static av_always_inline float flt16_even (float pf)
 
static av_always_inline float flt16_trunc (float pf)
 
static av_always_inline void predict (PredictorState *ps, float *coef, int output_enable)
 
static void apply_dependent_coupling (AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)
 Apply dependent channel coupling (applied before IMDCT). More...
 
static void apply_independent_coupling (AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)
 Apply independent channel coupling (applied after IMDCT). More...
 
static uint32_t latm_get_value (GetBitContext *b)
 
static int latm_decode_audio_specific_config (struct LATMContext *latmctx, GetBitContext *gb, int asclen)
 
static int read_stream_mux_config (struct LATMContext *latmctx, GetBitContext *gb)
 
static int read_payload_length_info (struct LATMContext *ctx, GetBitContext *gb)
 
static int read_audio_mux_element (struct LATMContext *latmctx, GetBitContext *gb)
 
static int latm_decode_frame (AVCodecContext *avctx, void *out, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold int latm_decode_init (AVCodecContext *avctx)
 

Variables

AVCodec ff_aac_decoder
 
AVCodec ff_aac_latm_decoder
 

Detailed Description

AAC decoder

Author
Oded Shimon ( ods15 ods15 dyndns org )
Maxim Gavrilov ( maxim.gavrilov gmail com )

Definition in file aacdec.c.

Macro Definition Documentation

◆ FFT_FLOAT

#define FFT_FLOAT   1

Definition at line 35 of file aacdec.c.

◆ FFT_FIXED_32

#define FFT_FIXED_32   0

Definition at line 36 of file aacdec.c.

◆ USE_FIXED

#define USE_FIXED   0

Definition at line 37 of file aacdec.c.

◆ LOAS_SYNC_WORD

#define LOAS_SYNC_WORD   0x2b7

11 bits LOAS sync word

Definition at line 260 of file aacdec.c.

Function Documentation

◆ reset_predict_state()

static av_always_inline void reset_predict_state ( PredictorState ps)
static

Definition at line 72 of file aacdec.c.

Referenced by reset_all_predictors(), and reset_predictor_group().

◆ VMUL2()

static float* VMUL2 ( float *  dst,
const float *  v,
unsigned  idx,
const float *  scale 
)
inlinestatic

Definition at line 83 of file aacdec.c.

Referenced by decode_spectrum_and_dequant().

◆ VMUL4()

static float* VMUL4 ( float *  dst,
const float *  v,
unsigned  idx,
const float *  scale 
)
inlinestatic

Definition at line 94 of file aacdec.c.

Referenced by decode_spectrum_and_dequant().

◆ VMUL2S()

static float* VMUL2S ( float *  dst,
const float *  v,
unsigned  idx,
unsigned  sign,
const float *  scale 
)
inlinestatic

Definition at line 107 of file aacdec.c.

Referenced by decode_spectrum_and_dequant().

◆ VMUL4S()

static float* VMUL4S ( float *  dst,
const float *  v,
unsigned  idx,
unsigned  sign,
const float *  scale 
)
inlinestatic

Definition at line 124 of file aacdec.c.

Referenced by decode_spectrum_and_dequant().

◆ flt16_round()

static av_always_inline float flt16_round ( float  pf)
static

Definition at line 150 of file aacdec.c.

Referenced by predict().

◆ flt16_even()

static av_always_inline float flt16_even ( float  pf)
static

Definition at line 158 of file aacdec.c.

Referenced by predict().

◆ flt16_trunc()

static av_always_inline float flt16_trunc ( float  pf)
static

Definition at line 166 of file aacdec.c.

Referenced by predict().

◆ predict()

static av_always_inline void predict ( PredictorState ps,
float *  coef,
int  output_enable 
)
static

Definition at line 174 of file aacdec.c.

Referenced by apply_prediction(), decode_frame(), decode_line_TMPL(), and encode_line_TMPL().

◆ apply_dependent_coupling()

static void apply_dependent_coupling ( AACContext ac,
SingleChannelElement target,
ChannelElement cce,
int  index 
)
static

Apply dependent channel coupling (applied before IMDCT).

Parameters
indexindex into coupling gain array

Definition at line 210 of file aacdec.c.

Referenced by spectral_to_sample().

◆ apply_independent_coupling()

static void apply_independent_coupling ( AACContext ac,
SingleChannelElement target,
ChannelElement cce,
int  index 
)
static

Apply independent channel coupling (applied after IMDCT).

Parameters
indexindex into coupling gain array

Definition at line 246 of file aacdec.c.

Referenced by spectral_to_sample().

◆ latm_get_value()

static uint32_t latm_get_value ( GetBitContext b)
inlinestatic

Definition at line 272 of file aacdec.c.

Referenced by read_stream_mux_config().

◆ latm_decode_audio_specific_config()

static int latm_decode_audio_specific_config ( struct LATMContext latmctx,
GetBitContext gb,
int  asclen 
)
static

Definition at line 279 of file aacdec.c.

Referenced by read_stream_mux_config().

◆ read_stream_mux_config()

static int read_stream_mux_config ( struct LATMContext latmctx,
GetBitContext gb 
)
static

Definition at line 347 of file aacdec.c.

Referenced by read_audio_mux_element().

◆ read_payload_length_info()

static int read_payload_length_info ( struct LATMContext ctx,
GetBitContext gb 
)
static

Definition at line 427 of file aacdec.c.

Referenced by read_audio_mux_element().

◆ read_audio_mux_element()

static int read_audio_mux_element ( struct LATMContext latmctx,
GetBitContext gb 
)
static

Definition at line 450 of file aacdec.c.

Referenced by latm_decode_frame().

◆ latm_decode_frame()

static int latm_decode_frame ( AVCodecContext avctx,
void *  out,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 479 of file aacdec.c.

◆ latm_decode_init()

static av_cold int latm_decode_init ( AVCodecContext avctx)
static

Definition at line 540 of file aacdec.c.

Variable Documentation

◆ ff_aac_decoder

AVCodec ff_aac_decoder
Initial value:
= {
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.priv_data_size = sizeof(AACContext),
.close = aac_decode_close,
.sample_fmts = (const enum AVSampleFormat[]) {
},
.channel_layouts = aac_channel_layout,
.flush = flush,
.priv_class = &aac_decoder_class,
}

Definition at line 551 of file aacdec.c.

◆ ff_aac_latm_decoder

AVCodec ff_aac_latm_decoder
Initial value:
= {
.name = "aac_latm",
.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"),
.priv_data_size = sizeof(struct LATMContext),
.close = aac_decode_close,
.decode = latm_decode_frame,
.sample_fmts = (const enum AVSampleFormat[]) {
},
.channel_layouts = aac_channel_layout,
.flush = flush,
}

Definition at line 576 of file aacdec.c.

aac_channel_layout
static const uint64_t aac_channel_layout[16]
Definition: aacdectab.h:57
AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:40
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
aac_decode_frame
static int aac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: aacdec_template.c:3325
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:686
aac_decode_init
static av_cold int aac_decode_init(AVCodecContext *avctx)
Definition: aacdec_template.c:1155
ff_aac_profiles
const AVProfile ff_aac_profiles[]
Definition: profiles.c:26
latm_decode_init
static av_cold int latm_decode_init(AVCodecContext *avctx)
Definition: aacdec.c:540
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
aac_decoder_class
static const AVClass aac_decoder_class
Definition: aacdec_template.c:3448
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
flush
static void flush(AVCodecContext *avctx)
Definition: aacdec_template.c:500
aac_decode_close
static av_cold int aac_decode_close(AVCodecContext *avctx)
Definition: aacdec_template.c:3388
AV_CODEC_CAP_CHANNEL_CONF
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: avcodec.h:1033
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: avcodec.h:566
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
LATMContext
Definition: aacdec.c:262
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:48
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
AACContext
main AAC context
Definition: aac.h:293
AV_CODEC_ID_AAC_LATM
@ AV_CODEC_ID_AAC_LATM
Definition: avcodec.h:613
latm_decode_frame
static int latm_decode_frame(AVCodecContext *avctx, void *out, int *got_frame_ptr, AVPacket *avpkt)
Definition: aacdec.c:479