From 42e2319ba9b75c3ca55be7f18a0322ecb498ea97 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 27 Jul 2019 18:54:20 +0100 Subject: lavu/tx: add support for double precision FFT and MDCT Simply moves and templates the actual transforms to support an additional data type. Unlike the float version, which is equal or better than libfftw3f, double precision output is bit identical with libfftw3. --- libavutil/tx.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libavutil/tx.h') diff --git a/libavutil/tx.h b/libavutil/tx.h index b1f2d96353..d6cdfdf9f2 100644 --- a/libavutil/tx.h +++ b/libavutil/tx.h @@ -28,6 +28,10 @@ typedef struct AVComplexFloat { float re, im; } AVComplexFloat; +typedef struct AVComplexDouble { + double re, im; +} AVComplexDouble; + enum AVTXType { /** * Standard complex to complex FFT with sample data type AVComplexFloat. @@ -39,6 +43,14 @@ enum AVTXType { * float. Length is the frame size, not the window size (which is 2x frame) */ AV_TX_FLOAT_MDCT = 1, + /** + * Same as AV_TX_FLOAT_FFT with a data type of AVComplexDouble. + */ + AV_TX_DOUBLE_FFT = 2, + /** + * Same as AV_TX_FLOAT_MDCT with data and scale type of double. + */ + AV_TX_DOUBLE_MDCT = 3, }; /** -- cgit v1.2.3