fft_arm.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Copyright (c) 2015 Xiph.Org Foundation
  2. Written by Viswanath Puttagunta */
  3. /**
  4. @file fft_arm.h
  5. @brief ARM Neon Intrinsic optimizations for fft using NE10 library
  6. */
  7. /*
  8. Redistribution and use in source and binary forms, with or without
  9. modification, are permitted provided that the following conditions
  10. are met:
  11. - Redistributions of source code must retain the above copyright
  12. notice, this list of conditions and the following disclaimer.
  13. - Redistributions in binary form must reproduce the above copyright
  14. notice, this list of conditions and the following disclaimer in the
  15. documentation and/or other materials provided with the distribution.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  18. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  19. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
  20. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  21. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  23. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  24. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  25. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  26. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. */
  28. #if !defined(FFT_ARM_H)
  29. #define FFT_ARM_H
  30. #include "kiss_fft.h"
  31. #if defined(HAVE_ARM_NE10)
  32. int opus_fft_alloc_arm_neon(kiss_fft_state *st);
  33. void opus_fft_free_arm_neon(kiss_fft_state *st);
  34. void opus_fft_neon(const kiss_fft_state *st,
  35. const kiss_fft_cpx *fin,
  36. kiss_fft_cpx *fout);
  37. void opus_ifft_neon(const kiss_fft_state *st,
  38. const kiss_fft_cpx *fin,
  39. kiss_fft_cpx *fout);
  40. #if !defined(OPUS_HAVE_RTCD)
  41. #define OVERRIDE_OPUS_FFT (1)
  42. #define opus_fft_alloc_arch(_st, arch) \
  43. ((void)(arch), opus_fft_alloc_arm_neon(_st))
  44. #define opus_fft_free_arch(_st, arch) \
  45. ((void)(arch), opus_fft_free_arm_neon(_st))
  46. #define opus_fft(_st, _fin, _fout, arch) \
  47. ((void)(arch), opus_fft_neon(_st, _fin, _fout))
  48. #define opus_ifft(_st, _fin, _fout, arch) \
  49. ((void)(arch), opus_ifft_neon(_st, _fin, _fout))
  50. #endif /* OPUS_HAVE_RTCD */
  51. #endif /* HAVE_ARM_NE10 */
  52. #endif