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 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

static INTFLOAT sine_120 [120]
 
static INTFLOAT sine_960 [960]
 
static INTFLOAT aac_kbd_long_960 [960]
 
static INTFLOAT aac_kbd_short_120 [120]
 
const AVCodec ff_aac_decoder
 
const 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.

◆ USE_FIXED

#define USE_FIXED   0

Definition at line 36 of file aacdec.c.

◆ LOAS_SYNC_WORD

#define LOAS_SYNC_WORD   0x2b7

11 bits LOAS sync word

Definition at line 264 of file aacdec.c.

Function Documentation

◆ reset_predict_state()

static av_always_inline void reset_predict_state ( PredictorState ps)
static

Definition at line 76 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 87 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 98 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 111 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 128 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 154 of file aacdec.c.

Referenced by predict().

◆ flt16_even()

static av_always_inline float flt16_even ( float  pf)
static

Definition at line 162 of file aacdec.c.

Referenced by predict().

◆ flt16_trunc()

static av_always_inline float flt16_trunc ( float  pf)
static

Definition at line 170 of file aacdec.c.

Referenced by predict().

◆ predict()

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

◆ 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 214 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 250 of file aacdec.c.

Referenced by spectral_to_sample().

◆ latm_get_value()

static uint32_t latm_get_value ( GetBitContext b)
inlinestatic

Definition at line 276 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 283 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 351 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 431 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 454 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 483 of file aacdec.c.

◆ latm_decode_init()

static av_cold int latm_decode_init ( AVCodecContext avctx)
static

Definition at line 544 of file aacdec.c.

Variable Documentation

◆ sine_120

INTFLOAT sine_120[120]
static

Definition at line 71 of file aacdec.c.

Referenced by aac_static_table_init(), and imdct_and_windowing_960().

◆ sine_960

INTFLOAT sine_960[960]
static

Definition at line 72 of file aacdec.c.

Referenced by aac_static_table_init(), and imdct_and_windowing_960().

◆ aac_kbd_long_960

INTFLOAT aac_kbd_long_960[960]
static

Definition at line 73 of file aacdec.c.

Referenced by aac_static_table_init(), and imdct_and_windowing_960().

◆ aac_kbd_short_120

INTFLOAT aac_kbd_short_120[120]
static

Definition at line 74 of file aacdec.c.

Referenced by aac_static_table_init(), and imdct_and_windowing_960().

◆ ff_aac_decoder

const 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 555 of file aacdec.c.

◆ ff_aac_latm_decoder

const 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 580 of file aacdec.c.

aac_channel_layout
static const uint64_t aac_channel_layout[16]
Definition: aacdectab.h:75
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:42
aac_decode_frame
static int aac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: aacdec_template.c:3436
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:948
aac_decode_init
static av_cold int aac_decode_init(AVCodecContext *avctx)
Definition: aacdec_template.c:1260
ff_aac_profiles
const AVProfile ff_aac_profiles[]
Definition: profiles.c:26
init
static int init
Definition: av_tx.c:47
latm_decode_init
static av_cold int latm_decode_init(AVCodecContext *avctx)
Definition: aacdec.c:544
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
aac_decoder_class
static const AVClass aac_decoder_class
Definition: aacdec_template.c:3559
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
flush
static void flush(AVCodecContext *avctx)
Definition: aacdec_template.c:593
aac_decode_close
static av_cold int aac_decode_close(AVCodecContext *avctx)
Definition: aacdec_template.c:3499
AV_CODEC_CAP_CHANNEL_CONF
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: codec.h:109
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: codec_id.h:425
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
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:117
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
LATMContext
Definition: aacdec.c:266
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:50
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
AACContext
main AAC context
Definition: aac.h:294
AV_CODEC_ID_AAC_LATM
@ AV_CODEC_ID_AAC_LATM
Definition: codec_id.h:472
latm_decode_frame
static int latm_decode_frame(AVCodecContext *avctx, void *out, int *got_frame_ptr, AVPacket *avpkt)
Definition: aacdec.c:483