FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
aacdec.c File Reference

AAC decoder. More...

#include "libavutil/float_dsp.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
#include "fft.h"
#include "imdct15.h"
#include "lpc.h"
#include "kbdwin.h"
#include "sinewin.h"
#include "aac.h"
#include "aactab.h"
#include "aacdectab.h"
#include "cbrt_tablegen.h"
#include "sbr.h"
#include "aacsbr.h"
#include "mpeg4audio.h"
#include "aacadtsdec.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

#define FFT_FLOAT   1

Definition at line 35 of file aacdec.c.

#define FFT_FIXED_32   0

Definition at line 36 of file aacdec.c.

#define USE_FIXED   0

Definition at line 37 of file aacdec.c.

#define LOAS_SYNC_WORD   0x2b7

11 bits LOAS sync word

Definition at line 262 of file aacdec.c.

Referenced by latm_decode_frame().

Function Documentation

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().

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().

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().

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().

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().

static av_always_inline float flt16_round ( float  pf)
static

Definition at line 150 of file aacdec.c.

Referenced by predict().

static av_always_inline float flt16_even ( float  pf)
static

Definition at line 158 of file aacdec.c.

Referenced by predict().

static av_always_inline float flt16_trunc ( float  pf)
static

Definition at line 166 of file aacdec.c.

Referenced by 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_line(), and encode_line().

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().

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().

static uint32_t latm_get_value ( GetBitContext b)
inlinestatic

Definition at line 274 of file aacdec.c.

Referenced by read_stream_mux_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().

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

Definition at line 340 of file aacdec.c.

Referenced by read_audio_mux_element().

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

Definition at line 420 of file aacdec.c.

Referenced by read_audio_mux_element().

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

Definition at line 441 of file aacdec.c.

Referenced by latm_decode_frame().

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

Definition at line 470 of file aacdec.c.

static av_cold int latm_decode_init ( AVCodecContext avctx)
static

Definition at line 531 of file aacdec.c.

Variable Documentation

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[]) {
},
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.channel_layouts = aac_channel_layout,
.flush = flush,
.priv_class = &aac_decoder_class,
}
float, planar
Definition: samplefmt.h:70
static void flush(AVCodecContext *avctx)
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
const AVProfile ff_aac_profiles[]
Definition: profiles.c:27
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: avcodec.h:915
#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
static av_cold int aac_decode_init(AVCodecContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const uint64_t aac_channel_layout[16]
Definition: aacdectab.h:57
static int aac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:59
static av_cold int aac_decode_close(AVCodecContext *avctx)
main AAC context
Definition: aac.h:293
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
Definition: ccaption_dec.c:572
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:701
static const AVClass aac_decoder_class
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:856

Definition at line 542 of file aacdec.c.

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[]) {
},
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.channel_layouts = aac_channel_layout,
.flush = flush,
}
float, planar
Definition: samplefmt.h:70
static void flush(AVCodecContext *avctx)
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
const AVProfile ff_aac_profiles[]
Definition: profiles.c:27
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: avcodec.h:915
#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
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static int latm_decode_frame(AVCodecContext *avctx, void *out, int *got_frame_ptr, AVPacket *avpkt)
Definition: aacdec.c:470
static const uint64_t aac_channel_layout[16]
Definition: aacdectab.h:57
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:59
static av_cold int aac_decode_close(AVCodecContext *avctx)
static av_cold int latm_decode_init(AVCodecContext *avctx)
Definition: aacdec.c:531
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:856

Definition at line 567 of file aacdec.c.