Go to the documentation of this file.
19 #ifndef AVUTIL_TX_PRIV_H
20 #define AVUTIL_TX_PRIV_H
31 #define TX_NAME(x) x ## _float
32 #define SCALE_TYPE float
35 #elif defined(TX_DOUBLE)
36 #define TX_NAME(x) x ## _double
37 #define SCALE_TYPE double
40 #elif defined(TX_INT32)
41 #define TX_NAME(x) x ## _int32
42 #define SCALE_TYPE float
49 #if defined(TX_FLOAT) || defined(TX_DOUBLE)
51 #define CMUL(dre, dim, are, aim, bre, bim) do { \
52 (dre) = (are) * (bre) - (aim) * (bim); \
53 (dim) = (are) * (bim) + (aim) * (bre); \
56 #define SMUL(dre, dim, are, aim, bre, bim) do { \
57 (dre) = (are) * (bre) - (aim) * (bim); \
58 (dim) = (are) * (bim) - (aim) * (bre); \
61 #define UNSCALE(x) (x)
62 #define RESCALE(x) (x)
64 #define FOLD(a, b) ((a) + (b))
66 #elif defined(TX_INT32)
69 #define CMUL(dre, dim, are, aim, bre, bim) do { \
71 (accu) = (int64_t)(bre) * (are); \
72 (accu) -= (int64_t)(bim) * (aim); \
73 (dre) = (int)(((accu) + 0x40000000) >> 31); \
74 (accu) = (int64_t)(bim) * (are); \
75 (accu) += (int64_t)(bre) * (aim); \
76 (dim) = (int)(((accu) + 0x40000000) >> 31); \
79 #define SMUL(dre, dim, are, aim, bre, bim) do { \
81 (accu) = (int64_t)(bre) * (are); \
82 (accu) -= (int64_t)(bim) * (aim); \
83 (dre) = (int)(((accu) + 0x40000000) >> 31); \
84 (accu) = (int64_t)(bim) * (are); \
85 (accu) -= (int64_t)(bre) * (aim); \
86 (dim) = (int)(((accu) + 0x40000000) >> 31); \
89 #define UNSCALE(x) ((double)x/2147483648.0)
90 #define RESCALE(x) (av_clip64(lrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX))
92 #define FOLD(x, y) ((int)((x) + (unsigned)(y) + 32) >> 6)
96 #define BF(x, y, a, b) do { \
101 #define CMUL3(c, a, b) \
102 CMUL((c).re, (c).im, (a).re, (a).im, (b).re, (b).im)
104 #define COSTABLE(size) \
105 DECLARE_ALIGNED(32, FFTSample, TX_NAME(ff_cos_##size))[size/2]
148 const void *scale, uint64_t
flags);
151 const void *scale, uint64_t
flags);
154 const void *scale, uint64_t
flags);
int ff_tx_type_is_mdct(enum AVTXType type)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
int ff_tx_init_mdct_fft_double(AVTXContext *s, av_tx_fn *tx, enum AVTXType type, int inv, int len, const void *scale, uint64_t flags)
int ff_tx_init_mdct_fft_float(AVTXContext *s, av_tx_fn *tx, enum AVTXType type, int inv, int len, const void *scale, uint64_t flags)
int ff_tx_init_mdct_fft_int32(AVTXContext *s, av_tx_fn *tx, enum AVTXType type, int inv, int len, const void *scale, uint64_t flags)
int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup)
int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s)
int ff_tx_gen_compound_mapping(AVTXContext *s)
static uint32_t inverse(uint32_t v)
find multiplicative inverse modulo 2 ^ 32
#define flags(name, subs,...)
static int split_radix_permutation(int i, int n, int inverse)