diff options
author | Lynne <dev@lynne.ee> | 2021-01-12 08:11:47 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2021-01-13 17:34:13 +0100 |
commit | 06a8596825e069a2e26810be40871e7d98a00f67 (patch) | |
tree | 0568da7a5e99bc662816008ba678a33b5401793f /libavutil/tx_priv.h | |
parent | ca21cb1e36ccae2ee71d4299d477fa9284c1f551 (diff) |
lavu: support arbitrary-point FFTs and all even (i)MDCT transforms
This patch adds support for arbitrary-point FFTs and all even MDCT
transforms.
Odd MDCTs are not supported yet as they're based on the DCT-II and DCT-III
and they're very niche.
With this we can now write tests.
Diffstat (limited to 'libavutil/tx_priv.h')
-rw-r--r-- | libavutil/tx_priv.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h index 0ace3e90dc..18a07c312c 100644 --- a/libavutil/tx_priv.h +++ b/libavutil/tx_priv.h @@ -58,6 +58,7 @@ typedef void FFTComplex; (dim) = (are) * (bim) - (aim) * (bre); \ } while (0) +#define UNSCALE(x) (x) #define RESCALE(x) (x) #define FOLD(a, b) ((a) + (b)) @@ -85,6 +86,7 @@ typedef void FFTComplex; (dim) = (int)(((accu) + 0x40000000) >> 31); \ } while (0) +#define UNSCALE(x) ((double)x/2147483648.0) #define RESCALE(x) (av_clip64(lrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX)) #define FOLD(x, y) ((int)((x) + (unsigned)(y) + 32) >> 6) @@ -108,6 +110,7 @@ struct AVTXContext { int m; /* Ptwo part */ int inv; /* Is inverted */ int type; /* Type */ + double scale; /* Scale */ FFTComplex *exptab; /* MDCT exptab */ FFTComplex *tmp; /* Temporary buffer needed for all compound transforms */ |