summaryrefslogtreecommitdiff
path: root/celt/kiss_fft.h
diff options
context:
space:
mode:
Diffstat (limited to 'celt/kiss_fft.h')
-rw-r--r--celt/kiss_fft.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/celt/kiss_fft.h b/celt/kiss_fft.h
index 390b54d9..af62f75b 100644
--- a/celt/kiss_fft.h
+++ b/celt/kiss_fft.h
@@ -114,6 +114,34 @@ typedef struct kiss_fft_state{
* buffer size in *lenmem.
* */
+
+#define S_MUL_ADD(a, b, c, d) (S_MUL(a,b)+S_MUL(c,d))
+#define S_MUL_SUB(a, b, c, d) (S_MUL(a,b)-S_MUL(c,d))
+
+#undef S_MUL_ADD
+static inline int S_MUL_ADD(int a, int b, int c, int d) {
+ int m;
+ long long ac1 = ((long long)a * (long long)b);
+ long long ac2 = ((long long)c * (long long)d);
+ ac1 += ac2;
+ ac1 = ac1>>15;
+ m = (int )(ac1);
+ return m;
+}
+
+
+#undef S_MUL_SUB
+static inline int S_MUL_SUB(int a, int b, int c, int d) {
+ int m;
+ long long ac1 = ((long long)a * (long long)b);
+ long long ac2 = ((long long)c * (long long)d);
+ ac1 -= ac2;
+ ac1 = ac1>>15;
+ m = (int )(ac1);
+ return m;
+}
+
+
kiss_fft_state *opus_fft_alloc_twiddles(int nfft,void * mem,size_t * lenmem, const kiss_fft_state *base);
kiss_fft_state *opus_fft_alloc(int nfft,void * mem,size_t * lenmem);