shithub: opus

Download patch

ref: bae854501fa55ce2cdc1dd8f81e5e9c19c6ed2ff
parent: ba8713ccb5fd1ee893630d2d1bcd86aacfc3aeea
author: Viswanath Puttagunta <[email protected]>
date: Fri May 15 08:42:26 EDT 2015

armv7: Enable NE10's fixed-point FFT for the MDCT

Extends usage of NEON optimized fixed-point FFT optimizations
in libNE10 to clt_mdct_forward and clt_mdct_backward.

Signed-off-by: Timothy B. Terriberry <[email protected]>

--- a/celt/arm/arm_celt_map.c
+++ b/celt/arm/arm_celt_map.c
@@ -91,7 +91,6 @@
    opus_ifft_neon                 /* Neon with NE10 */
 };
 
-#   if !defined(FIXED_POINT)
 void (*const CLT_MDCT_FORWARD_IMPL[OPUS_ARCHMASK+1])(const mdct_lookup *l,
                                                      kiss_fft_scalar *in,
                                                      kiss_fft_scalar * OPUS_RESTRICT out,
@@ -101,7 +100,7 @@
    clt_mdct_forward_c,           /* ARMv4 */
    clt_mdct_forward_c,           /* EDSP */
    clt_mdct_forward_c,           /* Media */
-   clt_mdct_forward_float_neon   /* Neon with NE10 */
+   clt_mdct_forward_neon         /* Neon with NE10 */
 };
 
 void (*const CLT_MDCT_BACKWARD_IMPL[OPUS_ARCHMASK+1])(const mdct_lookup *l,
@@ -113,10 +112,9 @@
    clt_mdct_backward_c,           /* ARMv4 */
    clt_mdct_backward_c,           /* EDSP */
    clt_mdct_backward_c,           /* Media */
-   clt_mdct_backward_float_neon   /* Neon with NE10 */
+   clt_mdct_backward_neon         /* Neon with NE10 */
 };
 
-#   endif /* !FIXED_POINT */
 #  endif /* HAVE_ARM_NE10 */
 # endif /* OPUS_ARM_MAY_HAVE_NEON_INTR */
 
--- a/celt/arm/celt_ne10_mdct.c
+++ b/celt/arm/celt_ne10_mdct.c
@@ -41,13 +41,11 @@
 #include "mdct.h"
 #include "stack_alloc.h"
 
-#if !defined(FIXED_POINT)
-
-void clt_mdct_forward_float_neon(const mdct_lookup *l,
-                                 kiss_fft_scalar *in,
-                                 kiss_fft_scalar * OPUS_RESTRICT out,
-                                 const opus_val16 *window,
-                                 int overlap, int shift, int stride, int arch)
+void clt_mdct_forward_neon(const mdct_lookup *l,
+                           kiss_fft_scalar *in,
+                           kiss_fft_scalar * OPUS_RESTRICT out,
+                           const opus_val16 *window,
+                           int overlap, int shift, int stride, int arch)
 {
    int i;
    int N, N2, N4;
@@ -157,11 +155,11 @@
    RESTORE_STACK;
 }
 
-void clt_mdct_backward_float_neon(const mdct_lookup *l,
-                                  kiss_fft_scalar *in,
-                                  kiss_fft_scalar * OPUS_RESTRICT out,
-                                  const opus_val16 * OPUS_RESTRICT window,
-                                  int overlap, int shift, int stride, int arch)
+void clt_mdct_backward_neon(const mdct_lookup *l,
+                            kiss_fft_scalar *in,
+                            kiss_fft_scalar * OPUS_RESTRICT out,
+                            const opus_val16 * OPUS_RESTRICT window,
+                            int overlap, int shift, int stride, int arch)
 {
    int i;
    int N, N2, N4;
@@ -258,4 +256,3 @@
    }
    RESTORE_STACK;
 }
-#endif /* !defined(FIXED_POINT) */
--- a/celt/arm/mdct_arm.h
+++ b/celt/arm/mdct_arm.h
@@ -36,25 +36,25 @@
 #include "config.h"
 #include "mdct.h"
 
-#if !defined(FIXED_POINT) && defined(HAVE_ARM_NE10)
+#if defined(HAVE_ARM_NE10)
 /** Compute a forward MDCT and scale by 4/N, trashes the input array */
-void clt_mdct_forward_float_neon(const mdct_lookup *l, kiss_fft_scalar *in,
-                                 kiss_fft_scalar * OPUS_RESTRICT out,
-                                 const opus_val16 *window, int overlap,
-                                 int shift, int stride, int arch);
+void clt_mdct_forward_neon(const mdct_lookup *l, kiss_fft_scalar *in,
+                           kiss_fft_scalar * OPUS_RESTRICT out,
+                           const opus_val16 *window, int overlap,
+                           int shift, int stride, int arch);
 
-void clt_mdct_backward_float_neon(const mdct_lookup *l, kiss_fft_scalar *in,
-                                  kiss_fft_scalar * OPUS_RESTRICT out,
-                                  const opus_val16 *window, int overlap,
-                                  int shift, int stride, int arch);
+void clt_mdct_backward_neon(const mdct_lookup *l, kiss_fft_scalar *in,
+                            kiss_fft_scalar * OPUS_RESTRICT out,
+                            const opus_val16 *window, int overlap,
+                            int shift, int stride, int arch);
 
 #if !defined(OPUS_HAVE_RTCD)
 #define OVERRIDE_OPUS_MDCT (1)
 #define clt_mdct_forward(_l, _in, _out, _window, _int, _shift, _stride, _arch) \
-      clt_mdct_forward_float_neon(_l, _in, _out, _window, _int, _shift, _stride, _arch)
+      clt_mdct_forward_neon(_l, _in, _out, _window, _int, _shift, _stride, _arch)
 #define clt_mdct_backward(_l, _in, _out, _window, _int, _shift, _stride, _arch) \
-      clt_mdct_backward_float_neon(_l, _in, _out, _window, _int, _shift, _stride, _arch)
+      clt_mdct_backward_neon(_l, _in, _out, _window, _int, _shift, _stride, _arch)
 #endif /* OPUS_HAVE_RTCD */
-#endif /* !defined(FIXED_POINT) && defined(HAVE_ARM_NE10) */
+#endif /* HAVE_ARM_NE10 */
 
 #endif
--- a/celt/mdct.h
+++ b/celt/mdct.h
@@ -53,7 +53,7 @@
    const kiss_twiddle_scalar * OPUS_RESTRICT trig;
 } mdct_lookup;
 
-#if !defined(FIXED_POINT) && defined(HAVE_ARM_NE10)
+#if defined(HAVE_ARM_NE10)
 #include "arm/mdct_arm.h"
 #endif
 
@@ -76,7 +76,7 @@
 
 #if !defined(OVERRIDE_OPUS_MDCT)
 /* Is run-time CPU detection enabled on this platform? */
-#if defined(OPUS_HAVE_RTCD) && defined(HAVE_ARM_NE10) && !defined(FIXED_POINT)
+#if defined(OPUS_HAVE_RTCD) && defined(HAVE_ARM_NE10)
 
 extern void (*const CLT_MDCT_FORWARD_IMPL[OPUS_ARCHMASK+1])(
       const mdct_lookup *l, kiss_fft_scalar *in,
@@ -98,7 +98,7 @@
                                                    _window, _overlap, _shift, \
                                                    _stride, _arch)
 
-#else /* if defined(OPUS_HAVE_RTCD) && defined(HAVE_ARM_NE10) && !defined(FIXED_POINT) */
+#else /* if defined(OPUS_HAVE_RTCD) && defined(HAVE_ARM_NE10) */
 
 #define clt_mdct_forward(_l, _in, _out, _window, _overlap, _shift, _stride, _arch) \
    clt_mdct_forward_c(_l, _in, _out, _window, _overlap, _shift, _stride, _arch)