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 "kbdwin.h"
#include "sinewin_fixed_tablegen.h"
#include "aac.h"
#include "aacdec.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 (AACDecContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)
 Apply dependent channel coupling (applied before IMDCT). More...
 
static void apply_independent_coupling_fixed (AACDecContext *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 ltp_coef_fixed [8]
 
static const int tns_tmp2_map_1_3 [4]
 
static const int tns_tmp2_map_0_3 [8]
 
static const int tns_tmp2_map_1_4 [8]
 
static const int tns_tmp2_map_0_4 [16]
 
static const int *const tns_tmp2_map_fixed [4]
 
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 135 of file aacdec_fixed.c.

◆ DEC_SPAIR()

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

Definition at line 153 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 161 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 171 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 179 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 197 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 211 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 242 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 283 of file aacdec_fixed.c.

Referenced by predict().

◆ flt16_even()

static av_always_inline SoftFloat flt16_even ( SoftFloat  pf)
static

Definition at line 297 of file aacdec_fixed.c.

Referenced by predict().

◆ flt16_trunc()

static av_always_inline SoftFloat flt16_trunc ( SoftFloat  pf)
static

Definition at line 311 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 325 of file aacdec_fixed.c.

◆ apply_dependent_coupling_fixed()

static void apply_dependent_coupling_fixed ( AACDecContext ac,
SingleChannelElement target,
ChannelElement cce,
int  index 
)
static

Apply dependent channel coupling (applied before IMDCT).

Parameters
indexindex into coupling gain array

Definition at line 400 of file aacdec_fixed.c.

◆ apply_independent_coupling_fixed()

static void apply_independent_coupling_fixed ( AACDecContext ac,
SingleChannelElement target,
ChannelElement cce,
int  index 
)
static

Apply independent channel coupling (applied after IMDCT).

Parameters
indexindex into coupling gain array

Definition at line 464 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.

◆ ltp_coef_fixed

const int ltp_coef_fixed[8]
static
Initial value:
= {
Q30(0.570829), Q30(0.696616), Q30(0.813004), Q30(0.911304),
Q30(0.984900), Q30(1.067894), Q30(1.194601), Q30(1.369533),
}

Definition at line 95 of file aacdec_fixed.c.

◆ tns_tmp2_map_1_3

const int tns_tmp2_map_1_3[4]
static
Initial value:
= {
Q31(0.00000000), Q31(-0.43388373), Q31(0.64278758), Q31(0.34202015),
}

Definition at line 106 of file aacdec_fixed.c.

◆ tns_tmp2_map_0_3

const int tns_tmp2_map_0_3[8]
static
Initial value:
= {
Q31(0.00000000), Q31(-0.43388373), Q31(-0.78183150), Q31(-0.97492790),
Q31(0.98480773), Q31( 0.86602539), Q31( 0.64278758), Q31( 0.34202015),
}

Definition at line 110 of file aacdec_fixed.c.

◆ tns_tmp2_map_1_4

const int tns_tmp2_map_1_4[8]
static
Initial value:
= {
Q31(0.00000000), Q31(-0.20791170), Q31(-0.40673664), Q31(-0.58778524),
Q31(0.67369562), Q31( 0.52643216), Q31( 0.36124167), Q31( 0.18374951),
}

Definition at line 115 of file aacdec_fixed.c.

◆ tns_tmp2_map_0_4

const int tns_tmp2_map_0_4[16]
static
Initial value:
= {
Q31( 0.00000000), Q31(-0.20791170), Q31(-0.40673664), Q31(-0.58778524),
Q31(-0.74314481), Q31(-0.86602539), Q31(-0.95105654), Q31(-0.99452192),
Q31( 0.99573416), Q31( 0.96182561), Q31( 0.89516330), Q31( 0.79801720),
Q31( 0.67369562), Q31( 0.52643216), Q31( 0.36124167), Q31( 0.18374951),
}

Definition at line 120 of file aacdec_fixed.c.

◆ tns_tmp2_map_fixed

const int* const tns_tmp2_map_fixed[4]
static
Initial value:

Definition at line 127 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 151 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 384 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(AACDecContext),
.close = aac_decode_close,
.p.sample_fmts = (const enum AVSampleFormat[]) {
},
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.ch_layouts = ff_aac_ch_layout,
.p.priv_class = &aac_decoder_class,
.flush = flush,
}

Definition at line 497 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:1149
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:65
tns_tmp2_map_0_3
static const int tns_tmp2_map_0_3[8]
Definition: aacdec_fixed.c:110
ff_aac_profiles
const AVProfile ff_aac_profiles[]
Definition: profiles.c:27
aac_decode_frame
static int aac_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: aacdec_template.c:3314
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
aac_decoder_class
static const AVClass aac_decoder_class
Definition: aacdec_template.c:3446
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
ff_aac_ch_layout
const AVChannelLayout ff_aac_ch_layout[]
Definition: aacdec_common.c:95
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:3377
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts.c:368
tns_tmp2_map_1_4
static const int tns_tmp2_map_1_4[8]
Definition: aacdec_fixed.c:115
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:442
tns_tmp2_map_0_4
static const int tns_tmp2_map_0_4[16]
Definition: aacdec_fixed.c:120
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:366
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:94
tns_tmp2_map_1_3
static const int tns_tmp2_map_1_3[4]
Definition: aacdec_fixed.c:106
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
AACDecContext
main AAC decoding context
Definition: aacdec.h:186
Q31
#define Q31(x)
Definition: aac_defines.h:98
Q30
#define Q30(x)
Definition: aac_defines.h:97