FFmpeg
Macros | Functions | Variables
aacdec_fixed.c File Reference
#include "libavutil/fixed_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_fixed_tablegen.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 <math.h>
#include <string.h>
#include "aacdec_template.c"

Go to the source code of this file.

Macros

#define USE_FIXED   1
 
#define TX_TYPE   AV_TX_INT32_MDCT
 

Functions

static av_always_inline void reset_predict_state (PredictorState *ps)
 
static intDEC_SPAIR (int *dst, unsigned idx)
 
static intDEC_SQUAD (int *dst, unsigned idx)
 
static intDEC_UPAIR (int *dst, unsigned idx, unsigned sign)
 
static intDEC_UQUAD (int *dst, unsigned idx, unsigned sign)
 
static void vector_pow43 (int *coefs, int len)
 
static void subband_scale (int *dst, int *src, int scale, int offset, int len, void *log_context)
 
static void noise_scale (int *coefs, int scale, int band_energy, int len)
 
static av_always_inline SoftFloat flt16_round (SoftFloat pf)
 
static av_always_inline SoftFloat flt16_even (SoftFloat pf)
 
static av_always_inline SoftFloat flt16_trunc (SoftFloat pf)
 
static av_always_inline void predict (PredictorState *ps, int *coef, int output_enable)
 
static void apply_dependent_coupling_fixed (AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)
 Apply dependent channel coupling (applied before IMDCT). More...
 
static void apply_independent_coupling_fixed (AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)
 Apply independent channel coupling (applied after IMDCT). More...
 

Variables

static int ff_aac_kbd_long_1024 [1024]
 
static int ff_aac_kbd_short_128 [128]
 
static int ff_aac_kbd_long_960 [960]
 
static int ff_aac_kbd_short_120 [120]
 
static const int exp2tab [4] = { Q31(1.0000000000/2), Q31(1.1892071150/2), Q31(1.4142135624/2), Q31(1.6817928305/2) }
 
static const int cce_scale_fixed [8]
 
const FFCodec ff_aac_fixed_decoder
 

Detailed Description

AAC decoder

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

Fixed point implementation

Author
Stanislav Ocovaj ( stanislav.ocovaj imgtec com )

Definition in file aacdec_fixed.c.

Macro Definition Documentation

◆ USE_FIXED

#define USE_FIXED   1

Definition at line 61 of file aacdec_fixed.c.

◆ TX_TYPE

#define TX_TYPE   AV_TX_INT32_MDCT

Definition at line 62 of file aacdec_fixed.c.

Function Documentation

◆ reset_predict_state()

static av_always_inline void reset_predict_state ( PredictorState ps)
static

Definition at line 92 of file aacdec_fixed.c.

◆ DEC_SPAIR()

static int* DEC_SPAIR ( int dst,
unsigned  idx 
)
inlinestatic

Definition at line 110 of file aacdec_fixed.c.

Referenced by decode_spectrum_and_dequant().

◆ DEC_SQUAD()

static int* DEC_SQUAD ( int dst,
unsigned  idx 
)
inlinestatic

Definition at line 118 of file aacdec_fixed.c.

Referenced by decode_spectrum_and_dequant().

◆ DEC_UPAIR()

static int* DEC_UPAIR ( int dst,
unsigned  idx,
unsigned  sign 
)
inlinestatic

Definition at line 128 of file aacdec_fixed.c.

Referenced by decode_spectrum_and_dequant().

◆ DEC_UQUAD()

static int* DEC_UQUAD ( int dst,
unsigned  idx,
unsigned  sign 
)
inlinestatic

Definition at line 136 of file aacdec_fixed.c.

Referenced by decode_spectrum_and_dequant().

◆ vector_pow43()

static void vector_pow43 ( int coefs,
int  len 
)
static

Definition at line 154 of file aacdec_fixed.c.

Referenced by aacdec_init().

◆ subband_scale()

static void subband_scale ( int dst,
int src,
int  scale,
int  offset,
int  len,
void *  log_context 
)
static

Definition at line 168 of file aacdec_fixed.c.

Referenced by aacdec_init().

◆ noise_scale()

static void noise_scale ( int coefs,
int  scale,
int  band_energy,
int  len 
)
static

Definition at line 199 of file aacdec_fixed.c.

Referenced by decode_spectrum_and_dequant().

◆ flt16_round()

static av_always_inline SoftFloat flt16_round ( SoftFloat  pf)
static

Definition at line 240 of file aacdec_fixed.c.

Referenced by predict().

◆ flt16_even()

static av_always_inline SoftFloat flt16_even ( SoftFloat  pf)
static

Definition at line 254 of file aacdec_fixed.c.

Referenced by predict().

◆ flt16_trunc()

static av_always_inline SoftFloat flt16_trunc ( SoftFloat  pf)
static

Definition at line 268 of file aacdec_fixed.c.

Referenced by predict().

◆ predict()

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

Definition at line 282 of file aacdec_fixed.c.

◆ apply_dependent_coupling_fixed()

static void apply_dependent_coupling_fixed ( 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 357 of file aacdec_fixed.c.

◆ apply_independent_coupling_fixed()

static void apply_independent_coupling_fixed ( 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 421 of file aacdec_fixed.c.

Variable Documentation

◆ ff_aac_kbd_long_1024

int ff_aac_kbd_long_1024[1024]
static

Definition at line 87 of file aacdec_fixed.c.

◆ ff_aac_kbd_short_128

int ff_aac_kbd_short_128[128]
static

Definition at line 88 of file aacdec_fixed.c.

◆ ff_aac_kbd_long_960

int ff_aac_kbd_long_960[960]
static

Definition at line 89 of file aacdec_fixed.c.

◆ ff_aac_kbd_short_120

int ff_aac_kbd_short_120[120]
static

Definition at line 90 of file aacdec_fixed.c.

◆ exp2tab

const int exp2tab[4] = { Q31(1.0000000000/2), Q31(1.1892071150/2), Q31(1.4142135624/2), Q31(1.6817928305/2) }
static

Definition at line 108 of file aacdec_fixed.c.

Referenced by noise_scale(), and subband_scale().

◆ cce_scale_fixed

const int cce_scale_fixed[8]
static
Initial value:
= {
Q30(1.0),
Q30(1.0905077327),
Q30(1.1892071150),
Q30(1.2968395547),
Q30(1.4142135624),
Q30(1.5422108254),
Q30(1.6817928305),
Q30(1.8340080864),
}

Definition at line 341 of file aacdec_fixed.c.

Referenced by apply_dependent_coupling_fixed(), and apply_independent_coupling_fixed().

◆ ff_aac_fixed_decoder

const FFCodec ff_aac_fixed_decoder
Initial value:
= {
.p.name = "aac_fixed",
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,
.p.priv_class = &aac_decoder_class,
.flush = flush,
}

Definition at line 454 of file aacdec_fixed.c.

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
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:65
ff_aac_profiles
const AVProfile ff_aac_profiles[]
Definition: profiles.c:26
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:106
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: codec_id.h:444
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:106
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:367
AACContext
main AAC context
Definition: aac.h:296
Q30
#define Q30(x)
Definition: aac_defines.h:91