mirror of
https://github.com/xiph/opus.git
synced 2025-05-15 16:08:30 +00:00
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 <tterribe@xiph.org>
This commit is contained in:
parent
ba8713ccb5
commit
bae854501f
4 changed files with 27 additions and 32 deletions
|
@ -91,7 +91,6 @@ void (*const OPUS_IFFT[OPUS_ARCHMASK+1])(const kiss_fft_state *cfg,
|
||||||
opus_ifft_neon /* Neon with NE10 */
|
opus_ifft_neon /* Neon with NE10 */
|
||||||
};
|
};
|
||||||
|
|
||||||
# if !defined(FIXED_POINT)
|
|
||||||
void (*const CLT_MDCT_FORWARD_IMPL[OPUS_ARCHMASK+1])(const mdct_lookup *l,
|
void (*const CLT_MDCT_FORWARD_IMPL[OPUS_ARCHMASK+1])(const mdct_lookup *l,
|
||||||
kiss_fft_scalar *in,
|
kiss_fft_scalar *in,
|
||||||
kiss_fft_scalar * OPUS_RESTRICT out,
|
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, /* ARMv4 */
|
||||||
clt_mdct_forward_c, /* EDSP */
|
clt_mdct_forward_c, /* EDSP */
|
||||||
clt_mdct_forward_c, /* Media */
|
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,
|
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, /* ARMv4 */
|
||||||
clt_mdct_backward_c, /* EDSP */
|
clt_mdct_backward_c, /* EDSP */
|
||||||
clt_mdct_backward_c, /* Media */
|
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 /* HAVE_ARM_NE10 */
|
||||||
# endif /* OPUS_ARM_MAY_HAVE_NEON_INTR */
|
# endif /* OPUS_ARM_MAY_HAVE_NEON_INTR */
|
||||||
|
|
||||||
|
|
|
@ -41,9 +41,7 @@
|
||||||
#include "mdct.h"
|
#include "mdct.h"
|
||||||
#include "stack_alloc.h"
|
#include "stack_alloc.h"
|
||||||
|
|
||||||
#if !defined(FIXED_POINT)
|
void clt_mdct_forward_neon(const mdct_lookup *l,
|
||||||
|
|
||||||
void clt_mdct_forward_float_neon(const mdct_lookup *l,
|
|
||||||
kiss_fft_scalar *in,
|
kiss_fft_scalar *in,
|
||||||
kiss_fft_scalar * OPUS_RESTRICT out,
|
kiss_fft_scalar * OPUS_RESTRICT out,
|
||||||
const opus_val16 *window,
|
const opus_val16 *window,
|
||||||
|
@ -157,7 +155,7 @@ void clt_mdct_forward_float_neon(const mdct_lookup *l,
|
||||||
RESTORE_STACK;
|
RESTORE_STACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clt_mdct_backward_float_neon(const mdct_lookup *l,
|
void clt_mdct_backward_neon(const mdct_lookup *l,
|
||||||
kiss_fft_scalar *in,
|
kiss_fft_scalar *in,
|
||||||
kiss_fft_scalar * OPUS_RESTRICT out,
|
kiss_fft_scalar * OPUS_RESTRICT out,
|
||||||
const opus_val16 * OPUS_RESTRICT window,
|
const opus_val16 * OPUS_RESTRICT window,
|
||||||
|
@ -258,4 +256,3 @@ void clt_mdct_backward_float_neon(const mdct_lookup *l,
|
||||||
}
|
}
|
||||||
RESTORE_STACK;
|
RESTORE_STACK;
|
||||||
}
|
}
|
||||||
#endif /* !defined(FIXED_POINT) */
|
|
||||||
|
|
|
@ -36,14 +36,14 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "mdct.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 */
|
/** 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,
|
void clt_mdct_forward_neon(const mdct_lookup *l, kiss_fft_scalar *in,
|
||||||
kiss_fft_scalar * OPUS_RESTRICT out,
|
kiss_fft_scalar * OPUS_RESTRICT out,
|
||||||
const opus_val16 *window, int overlap,
|
const opus_val16 *window, int overlap,
|
||||||
int shift, int stride, int arch);
|
int shift, int stride, int arch);
|
||||||
|
|
||||||
void clt_mdct_backward_float_neon(const mdct_lookup *l, kiss_fft_scalar *in,
|
void clt_mdct_backward_neon(const mdct_lookup *l, kiss_fft_scalar *in,
|
||||||
kiss_fft_scalar * OPUS_RESTRICT out,
|
kiss_fft_scalar * OPUS_RESTRICT out,
|
||||||
const opus_val16 *window, int overlap,
|
const opus_val16 *window, int overlap,
|
||||||
int shift, int stride, int arch);
|
int shift, int stride, int arch);
|
||||||
|
@ -51,10 +51,10 @@ void clt_mdct_backward_float_neon(const mdct_lookup *l, kiss_fft_scalar *in,
|
||||||
#if !defined(OPUS_HAVE_RTCD)
|
#if !defined(OPUS_HAVE_RTCD)
|
||||||
#define OVERRIDE_OPUS_MDCT (1)
|
#define OVERRIDE_OPUS_MDCT (1)
|
||||||
#define clt_mdct_forward(_l, _in, _out, _window, _int, _shift, _stride, _arch) \
|
#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) \
|
#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 /* OPUS_HAVE_RTCD */
|
||||||
#endif /* !defined(FIXED_POINT) && defined(HAVE_ARM_NE10) */
|
#endif /* HAVE_ARM_NE10 */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -53,7 +53,7 @@ typedef struct {
|
||||||
const kiss_twiddle_scalar * OPUS_RESTRICT trig;
|
const kiss_twiddle_scalar * OPUS_RESTRICT trig;
|
||||||
} mdct_lookup;
|
} mdct_lookup;
|
||||||
|
|
||||||
#if !defined(FIXED_POINT) && defined(HAVE_ARM_NE10)
|
#if defined(HAVE_ARM_NE10)
|
||||||
#include "arm/mdct_arm.h"
|
#include "arm/mdct_arm.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ void clt_mdct_backward_c(const mdct_lookup *l, kiss_fft_scalar *in,
|
||||||
|
|
||||||
#if !defined(OVERRIDE_OPUS_MDCT)
|
#if !defined(OVERRIDE_OPUS_MDCT)
|
||||||
/* Is run-time CPU detection enabled on this platform? */
|
/* 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])(
|
extern void (*const CLT_MDCT_FORWARD_IMPL[OPUS_ARCHMASK+1])(
|
||||||
const mdct_lookup *l, kiss_fft_scalar *in,
|
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, \
|
_window, _overlap, _shift, \
|
||||||
_stride, _arch)
|
_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) \
|
#define clt_mdct_forward(_l, _in, _out, _window, _overlap, _shift, _stride, _arch) \
|
||||||
clt_mdct_forward_c(_l, _in, _out, _window, _overlap, _shift, _stride, _arch)
|
clt_mdct_forward_c(_l, _in, _out, _window, _overlap, _shift, _stride, _arch)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue