summaryrefslogtreecommitdiff
path: root/libavcodec/dsputil.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/dsputil.h')
-rw-r--r--libavcodec/dsputil.h49
1 files changed, 48 insertions, 1 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index a8285c80b6..096dc288c6 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -221,5 +221,52 @@ struct unaligned_32 { uint32_t l; } __attribute__((packed));
void get_psnr(UINT8 *orig_image[3], UINT8 *coded_image[3],
int orig_linesize[3], int coded_linesize,
AVCodecContext *avctx);
-
+
+/* FFT computation */
+
+/* NOTE: soon integer code will be added, so you must use the
+ FFTSample type */
+typedef float FFTSample;
+
+typedef struct FFTComplex {
+ FFTSample re, im;
+} FFTComplex;
+
+typedef struct FFTContext {
+ int nbits;
+ int inverse;
+ uint16_t *revtab;
+ FFTComplex *exptab;
+ FFTComplex *exptab1; /* only used by SSE code */
+ void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
+} FFTContext;
+
+int fft_init(FFTContext *s, int nbits, int inverse);
+void fft_permute(FFTContext *s, FFTComplex *z);
+void fft_calc_c(FFTContext *s, FFTComplex *z);
+void fft_calc_sse(FFTContext *s, FFTComplex *z);
+static inline void fft_calc(FFTContext *s, FFTComplex *z)
+{
+ s->fft_calc(s, z);
+}
+void fft_end(FFTContext *s);
+
+/* MDCT computation */
+
+typedef struct MDCTContext {
+ int n; /* size of MDCT (i.e. number of input data * 2) */
+ int nbits; /* n = 2^nbits */
+ /* pre/post rotation tables */
+ FFTSample *tcos;
+ FFTSample *tsin;
+ FFTContext fft;
+} MDCTContext;
+
+int mdct_init(MDCTContext *s, int nbits, int inverse);
+void imdct_calc(MDCTContext *s, FFTSample *output,
+ const FFTSample *input, FFTSample *tmp);
+void mdct_calc(MDCTContext *s, FFTSample *out,
+ const FFTSample *input, FFTSample *tmp);
+void mdct_end(MDCTContext *s);
+
#endif