FFmpeg
Data Structures | Macros | Functions | Variables
aacdec.c File Reference
#include "libavutil/float_dsp.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "get_bits.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 USE_FIXED   0
 
#define TX_TYPE   AV_TX_FLOAT_MDCT
 
#define LOAS_SYNC_WORD   0x2b7
 11 bits LOAS sync word More...
 

Functions

static av_always_inline void reset_predict_state (PredictorState *ps)
 
static floatVMUL2 (float *dst, const float *v, unsigned idx, const float *scale)
 
static floatVMUL4 (float *dst, const float *v, unsigned idx, const float *scale)
 
static floatVMUL2S (float *dst, const float *v, unsigned idx, unsigned sign, const float *scale)
 
static floatVMUL4S (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, AVFrame *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 FFCodec ff_aac_decoder
 
const FFCodec 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

◆ USE_FIXED

#define USE_FIXED   0

Definition at line 35 of file aacdec.c.

◆ TX_TYPE

#define TX_TYPE   AV_TX_FLOAT_MDCT

Definition at line 36 of file aacdec.c.

◆ LOAS_SYNC_WORD

#define LOAS_SYNC_WORD   0x2b7

11 bits LOAS sync word

Definition at line 262 of file aacdec.c.

Function Documentation

◆ reset_predict_state()

static av_always_inline void reset_predict_state ( PredictorState ps)
static

Definition at line 74 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 85 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 96 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 109 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 126 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 152 of file aacdec.c.

Referenced by predict().

◆ flt16_even()

static av_always_inline float flt16_even ( float  pf)
static

Definition at line 160 of file aacdec.c.

Referenced by predict().

◆ flt16_trunc()

static av_always_inline float flt16_trunc ( float  pf)
static

Definition at line 168 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 176 of file aacdec.c.

Referenced by apply_prediction(), decode_frame(), decode_line(), decode_macroblock(), and encode_line().

◆ 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 212 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 248 of file aacdec.c.

Referenced by spectral_to_sample().

◆ latm_get_value()

static uint32_t latm_get_value ( GetBitContext b)
inlinestatic

Definition at line 274 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 281 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 349 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 429 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 452 of file aacdec.c.

Referenced by latm_decode_frame().

◆ latm_decode_frame()

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

Definition at line 481 of file aacdec.c.

◆ latm_decode_init()

static av_cold int latm_decode_init ( AVCodecContext avctx)
static

Definition at line 542 of file aacdec.c.

Variable Documentation

◆ sine_120

INTFLOAT sine_120[120]
static

Definition at line 69 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 70 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 71 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 72 of file aacdec.c.

Referenced by aac_static_table_init(), and imdct_and_windowing_960().

◆ ff_aac_decoder

const FFCodec ff_aac_decoder
Initial value:
= {
.p.name = "aac",
CODEC_LONG_NAME("AAC (Advanced Audio Coding)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(AACContext),
.close = aac_decode_close,
.p.sample_fmts = (const enum AVSampleFormat[]) {
},
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.ch_layouts = aac_ch_layout,
.flush = flush,
.p.priv_class = &aac_decoder_class,
}

Definition at line 553 of file aacdec.c.

◆ ff_aac_latm_decoder

const FFCodec ff_aac_latm_decoder
Initial value:
= {
.p.name = "aac_latm",
CODEC_LONG_NAME("AAC LATM (Advanced Audio Coding LATM syntax)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(struct LATMContext),
.close = aac_decode_close,
.p.sample_fmts = (const enum AVSampleFormat[]) {
},
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.ch_layouts = aac_ch_layout,
.flush = flush,
}

Definition at line 579 of file aacdec.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
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: codec_internal.h:42
aac_decode_init
static av_cold int aac_decode_init(AVCodecContext *avctx)
Definition: aacdec_template.c:1181
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:542
aac_decode_frame
static int aac_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: aacdec_template.c:3346
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
aac_decoder_class
static const AVClass aac_decoder_class
Definition: aacdec_template.c:3477
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
aac_ch_layout
static const AVChannelLayout aac_ch_layout[]
Definition: aacdectab.h:113
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
aac_decode_close
static av_cold int aac_decode_close(AVCodecContext *avctx)
Definition: aacdec_template.c:3409
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:103
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: codec_id.h:440
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:115
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
LATMContext
Definition: aacdec.c:264
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
latm_decode_frame
static int latm_decode_frame(AVCodecContext *avctx, AVFrame *out, int *got_frame_ptr, AVPacket *avpkt)
Definition: aacdec.c:481
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:367
AACContext
main AAC context
Definition: aac.h:296
AV_CODEC_ID_AAC_LATM
@ AV_CODEC_ID_AAC_LATM
Definition: codec_id.h:487