FFmpeg
Macros | Functions | Variables
aacdec_fixed.c File Reference
#include "libavutil/fixed_dsp.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
#include "fft.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 FFT_FLOAT   0
 
#define FFT_FIXED_32   1
 
#define USE_FIXED   1
 

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

◆ FFT_FLOAT

#define FFT_FLOAT   0

Definition at line 61 of file aacdec_fixed.c.

◆ FFT_FIXED_32

#define FFT_FIXED_32   1

Definition at line 62 of file aacdec_fixed.c.

◆ USE_FIXED

#define USE_FIXED   1

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

◆ ff_aac_kbd_short_128

int ff_aac_kbd_short_128[128]
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

AVCodec ff_aac_fixed_decoder
Initial value:
= {
.name = "aac_fixed",
.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,
}

Definition at line 454 of file aacdec_fixed.c.

aac_channel_layout
static const uint64_t aac_channel_layout[16]
Definition: aacdectab.h:75
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:41
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
aac_decode_frame
static int aac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: aacdec_template.c:3435
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:925
aac_decode_init
static av_cold int aac_decode_init(AVCodecContext *avctx)
Definition: aacdec_template.c:1259
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:68
ff_aac_profiles
const AVProfile ff_aac_profiles[]
Definition: profiles.c:26
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
flush
static void flush(AVCodecContext *avctx)
Definition: aacdec_template.c:592
aac_decode_close
static av_cold int aac_decode_close(AVCodecContext *avctx)
Definition: aacdec_template.c:3498
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:104
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: codec_id.h:426
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
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:49
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
AACContext
main AAC context
Definition: aac.h:294
Q30
#define Q30(x)
Definition: aac_defines.h:97