Go to the documentation of this file.
19 #ifndef AVUTIL_TX_PRIV_H
20 #define AVUTIL_TX_PRIV_H
28 #define TX_NAME(x) x ## _float
29 #define SCALE_TYPE float
32 #elif defined(TX_DOUBLE)
33 #define TX_NAME(x) x ## _double
34 #define SCALE_TYPE double
37 #elif defined(TX_INT32)
38 #define TX_NAME(x) x ## _int32
39 #define SCALE_TYPE float
46 #if defined(TX_FLOAT) || defined(TX_DOUBLE)
48 #define CMUL(dre, dim, are, aim, bre, bim) \
50 (dre) = (are) * (bre) - (aim) * (bim); \
51 (dim) = (are) * (bim) + (aim) * (bre); \
54 #define SMUL(dre, dim, are, aim, bre, bim) \
56 (dre) = (are) * (bre) - (aim) * (bim); \
57 (dim) = (are) * (bim) - (aim) * (bre); \
60 #define UNSCALE(x) (x)
61 #define RESCALE(x) (x)
63 #define FOLD(a, b) ((a) + (b))
65 #elif defined(TX_INT32)
68 #define CMUL(dre, dim, are, aim, bre, bim) \
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) \
82 (accu) = (int64_t)(bre) * (are); \
83 (accu) -= (int64_t)(bim) * (aim); \
84 (dre) = (int)(((accu) + 0x40000000) >> 31); \
85 (accu) = (int64_t)(bim) * (are); \
86 (accu) -= (int64_t)(bre) * (aim); \
87 (dim) = (int)(((accu) + 0x40000000) >> 31); \
90 #define UNSCALE(x) ((double)x/2147483648.0)
91 #define RESCALE(x) (av_clip64(lrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX))
93 #define FOLD(x, y) ((int)((x) + (unsigned)(y) + 32) >> 6)
97 #define BF(x, y, a, b) \
103 #define CMUL3(c, a, b) \
104 CMUL((c).re, (c).im, (a).re, (a).im, (b).re, (b).im)
106 #define COSTABLE(size) \
107 DECLARE_ALIGNED(32, FFTSample, TX_NAME(ff_cos_##size))[size/4 + 1]
183 int basis,
int dual_stride);
static int16_t basis[64][64]
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
static av_always_inline float scale(float x, float s)
void ff_tx_init_float_x86(AVTXContext *s, av_tx_fn *tx)
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_inplace_revtab_idx(AVTXContext *s, int *revtab)
void ff_tx_gen_split_radix_parity_revtab(int *revtab, int len, int inv, int basis, int dual_stride)
int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup)
int ff_tx_gen_compound_mapping(AVTXContext *s)
#define flags(name, subs,...)