armv7: Enable NE10's fixed-point FFT for the MDCT
authorViswanath Puttagunta <viswanath.puttagunta@linaro.org>
Fri, 15 May 2015 17:42:26 +0000 (12:42 -0500)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Wed, 7 Oct 2015 22:09:20 +0000 (18:09 -0400)
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 <tterribe@xiph.org>
celt/arm/arm_celt_map.c
celt/arm/celt_ne10_mdct.c
celt/arm/mdct_arm.h
celt/mdct.h

index b5bd44d..ee6c244 100644 (file)
@@ -91,7 +91,6 @@ void (*const OPUS_IFFT[OPUS_ARCHMASK+1])(const kiss_fft_state *cfg,
    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 @@ void (*const CLT_MDCT_FORWARD_IMPL[OPUS_ARCHMASK+1])(const mdct_lookup *l,
    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 @@ void (*const CLT_MDCT_BACKWARD_IMPL[OPUS_ARCHMASK+1])(const mdct_lookup *l,
    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 */
 
index a68264e..293c3ef 100644 (file)
 #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 @@ void clt_mdct_forward_float_neon(const mdct_lookup *l,
    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 @@ void clt_mdct_backward_float_neon(const mdct_lookup *l,
    }
    RESTORE_STACK;
 }
-#endif /* !defined(FIXED_POINT) */
index db32efe..49cbb44 100644 (file)
 #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
index 2400de1..160ae4e 100644 (file)
@@ -53,7 +53,7 @@ typedef struct {
    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 @@ void clt_mdct_backward_c(const mdct_lookup *l, kiss_fft_scalar *in,
 
 #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 @@ extern void (*const CLT_MDCT_BACKWARD_IMPL[OPUS_ARCHMASK+1])(
                                                    _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)