FFmpeg
Functions | Variables
atrac.c File Reference
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "libavutil/thread.h"
#include "avcodec.h"
#include "atrac.h"

Go to the source code of this file.

Functions

static av_cold void atrac_generate_tables (void)
 
av_cold void ff_atrac_generate_tables (void)
 Generate common tables. More...
 
av_cold void ff_atrac_init_gain_compensation (AtracGCContext *gctx, int id2exp_offset, int loc_scale)
 Initialize gain compensation context. More...
 
void ff_atrac_gain_compensation (AtracGCContext *gctx, float *in, float *prev, AtracGainInfo *gc_now, AtracGainInfo *gc_next, int num_samples, float *out)
 Apply gain compensation and perform the MDCT overlapping part. More...
 
void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp)
 Quadrature mirror synthesis filter. More...
 

Variables

float ff_atrac_sf_table [64]
 
static float qmf_window [48]
 
static const float qmf_48tap_half [24]
 

Function Documentation

◆ atrac_generate_tables()

static av_cold void atrac_generate_tables ( void  )
static

Definition at line 50 of file atrac.c.

Referenced by ff_atrac_generate_tables().

◆ ff_atrac_generate_tables()

av_cold void ff_atrac_generate_tables ( void  )

Generate common tables.

Definition at line 63 of file atrac.c.

Referenced by atrac1_decode_init(), and atrac3_init_static_data().

◆ ff_atrac_init_gain_compensation()

av_cold void ff_atrac_init_gain_compensation ( AtracGCContext gctx,
int  id2exp_offset,
int  loc_scale 
)

Initialize gain compensation context.

Parameters
gctxpointer to gain compensation context to initialize
id2exp_offsetoffset for converting level index into level exponent
loc_scalelocation size factor

Definition at line 69 of file atrac.c.

Referenced by atrac3_decode_init(), and atrac3p_decode_init().

◆ ff_atrac_gain_compensation()

void ff_atrac_gain_compensation ( AtracGCContext gctx,
float *  in,
float *  prev,
AtracGainInfo gc_now,
AtracGainInfo gc_next,
int  num_samples,
float *  out 
)

Apply gain compensation and perform the MDCT overlapping part.

Parameters
gctxpointer to gain compensation context
ininput buffer
prevprevious buffer to perform overlap against
gc_nowgain control information for current frame
gc_nextgain control information for next frame
num_samplesnumber of samples to process
outoutput data goes here

Definition at line 87 of file atrac.c.

Referenced by decode_channel_sound_unit(), and reconstruct_frame().

◆ ff_atrac_iqmf()

void ff_atrac_iqmf ( float *  inlo,
float *  inhi,
unsigned int  nIn,
float *  pOut,
float *  delayBuf,
float *  temp 
)

Quadrature mirror synthesis filter.

Parameters
inlolower part of spectrum
inhihigher part of spectrum
nInsize of spectrum buffer
pOutout buffer
delayBufdelayBuf buffer
temptemp buffer

Definition at line 130 of file atrac.c.

Referenced by al_decode_frame(), at1_subband_synthesis(), and decode_frame().

Variable Documentation

◆ ff_atrac_sf_table

float ff_atrac_sf_table[64]

◆ qmf_window

float qmf_window[48]
static

Definition at line 39 of file atrac.c.

Referenced by atrac_generate_tables(), and ff_atrac_iqmf().

◆ qmf_48tap_half

const float qmf_48tap_half[24]
static
Initial value:
= {
-0.00001461907, -0.00009205479,-0.000056157569,0.00030117269,
0.0002422519, -0.00085293897,-0.0005205574, 0.0020340169,
0.00078333891, -0.0042153862, -0.00075614988, 0.0078402944,
-0.000061169922,-0.01344162, 0.0024626821, 0.021736089,
-0.007801671, -0.034090221, 0.01880949, 0.054326009,
-0.043596379, -0.099384367, 0.13207909, 0.46424159
}

Definition at line 41 of file atrac.c.

Referenced by atrac_generate_tables().