FFmpeg
Macros | Functions | Variables
tx_template.c File Reference

Go to the source code of this file.

Macros

#define INIT_FF_COS_TABS_FUNC(index, size)
 
#define DECL_FFT5(NAME, D0, D1, D2, D3, D4)
 
#define BUTTERFLIES(a0, a1, a2, a3)
 
#define TRANSFORM(a0, a1, a2, a3, wre, wim)
 
#define DECL_FFT(n, n2, n4)
 
#define DECL_COMP_FFT(N)
 
#define DECL_COMP_IMDCT(N)
 
#define DECL_COMP_MDCT(N)
 
#define CHECK_FACTOR(DST, FACTOR, SRC)
 

Functions

 COSTABLE (16)
 
 COSTABLE (32)
 
 COSTABLE (64)
 
 COSTABLE (128)
 
 COSTABLE (256)
 
 COSTABLE (512)
 
 COSTABLE (1024)
 
 COSTABLE (2048)
 
 COSTABLE (4096)
 
 COSTABLE (8192)
 
 COSTABLE (16384)
 
 COSTABLE (32768)
 
 COSTABLE (65536)
 
 COSTABLE (131072)
 
FFTComplex TX_NAME (ff_cos_53)[4]
 
FFTComplex TX_NAME (ff_cos_7)[3]
 
FFTComplex TX_NAME (ff_cos_9)[4]
 
static av_always_inline void init_cos_tabs_idx (int index)
 
static av_cold void ff_init_53_tabs (void)
 
static av_cold void ff_init_7_tabs (void)
 
static av_cold void ff_init_9_tabs (void)
 
static av_cold void init_cos_tabs (int index)
 
static av_always_inline void fft3 (FFTComplex *out, FFTComplex *in, ptrdiff_t stride)
 
static av_always_inline void fft7 (FFTComplex *out, FFTComplex *in, ptrdiff_t stride)
 
static av_always_inline void fft9 (FFTComplex *out, FFTComplex *in, ptrdiff_t stride)
 
static av_always_inline void fft15 (FFTComplex *out, FFTComplex *in, ptrdiff_t stride)
 
static void split_radix_combine (FFTComplex *z, const FFTSample *cos, int n)
 
static void fft2 (FFTComplex *z)
 
static void fft4 (FFTComplex *z)
 
static void fft8 (FFTComplex *z)
 
static void fft16 (FFTComplex *z)
 
static void split_radix_fft (AVTXContext *s, void *_out, void *_in, ptrdiff_t stride)
 
static void naive_fft (AVTXContext *s, void *_out, void *_in, ptrdiff_t stride)
 
static void monolithic_imdct (AVTXContext *s, void *_dst, void *_src, ptrdiff_t stride)
 
static void monolithic_mdct (AVTXContext *s, void *_dst, void *_src, ptrdiff_t stride)
 
static void naive_imdct (AVTXContext *s, void *_dst, void *_src, ptrdiff_t stride)
 
static void naive_mdct (AVTXContext *s, void *_dst, void *_src, ptrdiff_t stride)
 
static void full_imdct_wrapper_fn (AVTXContext *s, void *_dst, void *_src, ptrdiff_t stride)
 
static int gen_mdct_exptab (AVTXContext *s, int len4, double scale)
 
int TX_NAME() ff_tx_init_mdct_fft (AVTXContext *s, av_tx_fn *tx, enum AVTXType type, int inv, int len, const void *scale, uint64_t flags)
 

Variables

static FFTSample *const cos_tabs [18]
 
static CosTabsInitOnce cos_tabs_init_once []
 
static void(*const fft_dispatch [])(FFTComplex *)
 

Macro Definition Documentation

◆ INIT_FF_COS_TABS_FUNC

#define INIT_FF_COS_TABS_FUNC (   index,
  size 
)
Value:
static av_cold void init_cos_tabs_ ## size (void) \
{ \
init_cos_tabs_idx(index); \
}

Definition at line 79 of file tx_template.c.

◆ DECL_FFT5

#define DECL_FFT5 (   NAME,
  D0,
  D1,
  D2,
  D3,
  D4 
)

Definition at line 186 of file tx_template.c.

◆ BUTTERFLIES

#define BUTTERFLIES (   a0,
  a1,
  a2,
  a3 
)
Value:
do { \
r0=a0.re; \
i0=a0.im; \
r1=a1.re; \
i1=a1.im; \
BF(t3, t5, t5, t1); \
BF(a2.re, a0.re, r0, t5); \
BF(a3.im, a1.im, i1, t3); \
BF(t4, t6, t2, t6); \
BF(a3.re, a1.re, r1, t4); \
BF(a2.im, a0.im, i0, t6); \
} while (0)

Definition at line 449 of file tx_template.c.

◆ TRANSFORM

#define TRANSFORM (   a0,
  a1,
  a2,
  a3,
  wre,
  wim 
)
Value:
do { \
CMUL(t1, t2, a2.re, a2.im, wre, -wim); \
CMUL(t5, t6, a3.re, a3.im, wre, wim); \
BUTTERFLIES(a0, a1, a2, a3); \
} while (0)

Definition at line 463 of file tx_template.c.

◆ DECL_FFT

#define DECL_FFT (   n,
  n2,
  n4 
)
Value:
static void fft##n(FFTComplex *z) \
{ \
fft##n2(z); \
fft##n4(z + n4*2); \
fft##n4(z + n4*3); \
split_radix_combine(z, TX_NAME(ff_cos_##n), n4/2); \
}

Definition at line 496 of file tx_template.c.

◆ DECL_COMP_FFT

#define DECL_COMP_FFT (   N)
Value:
static void compound_fft_##N##xM(AVTXContext *s, void *_out, \
void *_in, ptrdiff_t stride) \
{ \
const int m = s->m, *in_map = s->pfatab, *out_map = in_map + N*m; \
FFTComplex *in = _in; \
FFTComplex *out = _out; \
FFTComplex fft##N##in[N]; \
void (*fftp)(FFTComplex *z) = fft_dispatch[av_log2(m)]; \
for (int i = 0; i < m; i++) { \
for (int j = 0; j < N; j++) \
fft##N##in[j] = in[in_map[i*N + j]]; \
fft##N(s->tmp + s->revtab_c[i], fft##N##in, m); \
} \
for (int i = 0; i < N; i++) \
fftp(s->tmp + m*i); \
for (int i = 0; i < N*m; i++) \
out[i] = s->tmp[out_map[i]]; \
}

Definition at line 583 of file tx_template.c.

◆ DECL_COMP_IMDCT

#define DECL_COMP_IMDCT (   N)

Definition at line 667 of file tx_template.c.

◆ DECL_COMP_MDCT

#define DECL_COMP_MDCT (   N)

Definition at line 711 of file tx_template.c.

◆ CHECK_FACTOR

#define CHECK_FACTOR (   DST,
  FACTOR,
  SRC 
)
Value:
if (DST == 1 && !(SRC % FACTOR)) { \
DST = FACTOR; \
SRC /= FACTOR; \
}

Function Documentation

◆ COSTABLE() [1/14]

COSTABLE ( 16  )

◆ COSTABLE() [2/14]

COSTABLE ( 32  )

◆ COSTABLE() [3/14]

COSTABLE ( 64  )

◆ COSTABLE() [4/14]

COSTABLE ( 128  )

◆ COSTABLE() [5/14]

COSTABLE ( 256  )

◆ COSTABLE() [6/14]

COSTABLE ( 512  )

◆ COSTABLE() [7/14]

COSTABLE ( 1024  )

◆ COSTABLE() [8/14]

COSTABLE ( 2048  )

◆ COSTABLE() [9/14]

COSTABLE ( 4096  )

◆ COSTABLE() [10/14]

COSTABLE ( 8192  )

◆ COSTABLE() [11/14]

COSTABLE ( 16384  )

◆ COSTABLE() [12/14]

COSTABLE ( 32768  )

◆ COSTABLE() [13/14]

COSTABLE ( 65536  )

◆ COSTABLE() [14/14]

COSTABLE ( 131072  )

◆ TX_NAME() [1/3]

FFTComplex TX_NAME ( ff_cos_53  )

◆ TX_NAME() [2/3]

FFTComplex TX_NAME ( ff_cos_7  )

◆ TX_NAME() [3/3]

FFTComplex TX_NAME ( ff_cos_9  )

◆ init_cos_tabs_idx()

static av_always_inline void init_cos_tabs_idx ( int  index)
static

Definition at line 67 of file tx_template.c.

◆ ff_init_53_tabs()

static av_cold void ff_init_53_tabs ( void  )
static

Definition at line 100 of file tx_template.c.

◆ ff_init_7_tabs()

static av_cold void ff_init_7_tabs ( void  )
static

Definition at line 108 of file tx_template.c.

◆ ff_init_9_tabs()

static av_cold void ff_init_9_tabs ( void  )
static

Definition at line 115 of file tx_template.c.

◆ init_cos_tabs()

static av_cold void init_cos_tabs ( int  index)
static

Definition at line 145 of file tx_template.c.

Referenced by ff_tx_init_mdct_fft().

◆ fft3()

static av_always_inline void fft3 ( FFTComplex out,
FFTComplex in,
ptrdiff_t  stride 
)
static

Definition at line 151 of file tx_template.c.

Referenced by fft15().

◆ fft7()

static av_always_inline void fft7 ( FFTComplex out,
FFTComplex in,
ptrdiff_t  stride 
)
static

Definition at line 225 of file tx_template.c.

◆ fft9()

static av_always_inline void fft9 ( FFTComplex out,
FFTComplex in,
ptrdiff_t  stride 
)
static

Definition at line 312 of file tx_template.c.

◆ fft15()

static av_always_inline void fft15 ( FFTComplex out,
FFTComplex in,
ptrdiff_t  stride 
)
static

Definition at line 436 of file tx_template.c.

◆ split_radix_combine()

static void split_radix_combine ( FFTComplex z,
const FFTSample cos,
int  n 
)
static

Definition at line 471 of file tx_template.c.

◆ fft2()

static void fft2 ( FFTComplex z)
static

Definition at line 505 of file tx_template.c.

◆ fft4()

static void fft4 ( FFTComplex z)
static

Definition at line 513 of file tx_template.c.

Referenced by fft16(), and fft8().

◆ fft8()

static void fft8 ( FFTComplex z)
static

Definition at line 527 of file tx_template.c.

Referenced by fft16().

◆ fft16()

static void fft16 ( FFTComplex z)
static

Definition at line 542 of file tx_template.c.

◆ split_radix_fft()

static void split_radix_fft ( AVTXContext s,
void *  _out,
void *  _in,
ptrdiff_t  stride 
)
static

Definition at line 612 of file tx_template.c.

Referenced by ff_tx_init_mdct_fft().

◆ naive_fft()

static void naive_fft ( AVTXContext s,
void *  _out,
void *  _in,
ptrdiff_t  stride 
)
static

Definition at line 642 of file tx_template.c.

Referenced by ff_tx_init_mdct_fft().

◆ monolithic_imdct()

static void monolithic_imdct ( AVTXContext s,
void *  _dst,
void *  _src,
ptrdiff_t  stride 
)
static

Definition at line 761 of file tx_template.c.

Referenced by ff_tx_init_mdct_fft().

◆ monolithic_mdct()

static void monolithic_mdct ( AVTXContext s,
void *  _dst,
void *  _src,
ptrdiff_t  stride 
)
static

Definition at line 790 of file tx_template.c.

Referenced by ff_tx_init_mdct_fft().

◆ naive_imdct()

static void naive_imdct ( AVTXContext s,
void *  _dst,
void *  _src,
ptrdiff_t  stride 
)
static

Definition at line 827 of file tx_template.c.

Referenced by ff_tx_init_mdct_fft().

◆ naive_mdct()

static void naive_mdct ( AVTXContext s,
void *  _dst,
void *  _src,
ptrdiff_t  stride 
)
static

Definition at line 857 of file tx_template.c.

Referenced by ff_tx_init_mdct_fft().

◆ full_imdct_wrapper_fn()

static void full_imdct_wrapper_fn ( AVTXContext s,
void *  _dst,
void *  _src,
ptrdiff_t  stride 
)
static

Definition at line 878 of file tx_template.c.

Referenced by ff_tx_init_mdct_fft().

◆ gen_mdct_exptab()

static int gen_mdct_exptab ( AVTXContext s,
int  len4,
double  scale 
)
static

Definition at line 896 of file tx_template.c.

Referenced by ff_tx_init_mdct_fft().

◆ ff_tx_init_mdct_fft()

int TX_NAME() ff_tx_init_mdct_fft ( AVTXContext s,
av_tx_fn tx,
enum AVTXType  type,
int  inv,
int  len,
const void *  scale,
uint64_t  flags 
)

Definition at line 913 of file tx_template.c.

Variable Documentation

◆ cos_tabs

FFTSample* const cos_tabs[18]
static
Initial value:
= {
TX_NAME(ff_cos_16),
TX_NAME(ff_cos_32),
TX_NAME(ff_cos_64),
TX_NAME(ff_cos_128),
TX_NAME(ff_cos_256),
TX_NAME(ff_cos_512),
TX_NAME(ff_cos_1024),
TX_NAME(ff_cos_2048),
TX_NAME(ff_cos_4096),
TX_NAME(ff_cos_8192),
TX_NAME(ff_cos_16384),
TX_NAME(ff_cos_32768),
TX_NAME(ff_cos_65536),
TX_NAME(ff_cos_131072),
}

Definition at line 46 of file tx_template.c.

Referenced by init_cos_tabs_idx().

◆ cos_tabs_init_once

CosTabsInitOnce cos_tabs_init_once[]
static
Initial value:
= {
{ NULL },
{ init_cos_tabs_16, AV_ONCE_INIT },
{ init_cos_tabs_32, AV_ONCE_INIT },
{ init_cos_tabs_64, AV_ONCE_INIT },
{ init_cos_tabs_128, AV_ONCE_INIT },
{ init_cos_tabs_256, AV_ONCE_INIT },
{ init_cos_tabs_512, AV_ONCE_INIT },
{ init_cos_tabs_1024, AV_ONCE_INIT },
{ init_cos_tabs_2048, AV_ONCE_INIT },
{ init_cos_tabs_4096, AV_ONCE_INIT },
{ init_cos_tabs_8192, AV_ONCE_INIT },
{ init_cos_tabs_16384, AV_ONCE_INIT },
{ init_cos_tabs_32768, AV_ONCE_INIT },
{ init_cos_tabs_65536, AV_ONCE_INIT },
{ init_cos_tabs_131072, AV_ONCE_INIT },
}

Definition at line 124 of file tx_template.c.

Referenced by init_cos_tabs().

◆ fft_dispatch

void(* const fft_dispatch[])(FFTComplex *)
static
Initial value:
= {
NULL, fft2, fft4, fft8, fft16, fft32, fft64, fft128, fft256, fft512,
fft1024, fft2048, fft4096, fft8192, fft16384, fft32768, fft65536, fft131072
}

Definition at line 578 of file tx_template.c.

Referenced by ff_tx_init_mdct_fft(), monolithic_imdct(), monolithic_mdct(), and split_radix_fft().

stride
int stride
Definition: mace.c:144
fft16
static void fft16(FFTComplex *z)
Definition: tx_template.c:542
out
FILE * out
Definition: movenc.c:54
AVTXContext
Definition: tx_priv.h:110
fft2
static void fft2(FFTComplex *z)
Definition: tx_template.c:505
index
fg index
Definition: ffmpeg_filter.c:167
t1
#define t1
Definition: regdef.h:29
fft4
static void fft4(FFTComplex *z)
Definition: tx_template.c:513
ff_init_9_tabs
static av_cold void ff_init_9_tabs(void)
Definition: tx_template.c:115
a1
#define a1
Definition: regdef.h:47
av_cold
#define av_cold
Definition: attributes.h:90
fft8
static void fft8(FFTComplex *z)
Definition: tx_template.c:527
s
#define s(width, name)
Definition: cbs_vp9.c:257
ff_init_53_tabs
static av_cold void ff_init_53_tabs(void)
Definition: tx_template.c:100
AV_ONCE_INIT
#define AV_ONCE_INIT
Definition: thread.h:173
NULL
#define NULL
Definition: coverity.c:32
t5
#define t5
Definition: regdef.h:33
t6
#define t6
Definition: regdef.h:34
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
size
int size
Definition: twinvq_data.h:10344
N
#define N
Definition: af_mcompand.c:53
a0
#define a0
Definition: regdef.h:46
SRC
#define SRC(x, y)
Definition: h264pred_template.c:847
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:271
t4
#define t4
Definition: regdef.h:32
t3
#define t3
Definition: regdef.h:31
a2
#define a2
Definition: regdef.h:48
fft_dispatch
static void(*const fft_dispatch[])(FFTComplex *)
Definition: tx_template.c:578
ff_init_7_tabs
static av_cold void ff_init_7_tabs(void)
Definition: tx_template.c:108
t2
#define t2
Definition: regdef.h:30
TX_NAME
FFTComplex TX_NAME(ff_cos_53)[4]
DST
#define DST(x, y)
Definition: vp9dsp_template.c:781
av_log2
int av_log2(unsigned v)
Definition: intmath.c:26
a3
#define a3
Definition: regdef.h:49
FFTComplex
Definition: avfft.h:37