pitch_arm.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* Copyright (c) 2010 Xiph.Org Foundation
  2. * Copyright (c) 2013 Parrot */
  3. /*
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions
  6. are met:
  7. - Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. - Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in the
  11. documentation and/or other materials provided with the distribution.
  12. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  13. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  14. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
  16. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  17. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  18. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  19. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  20. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  21. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  22. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. */
  24. #if !defined(PITCH_ARM_H)
  25. # define PITCH_ARM_H
  26. # include "armcpu.h"
  27. # if defined(FIXED_POINT)
  28. # if defined(OPUS_ARM_MAY_HAVE_NEON)
  29. opus_val32 celt_pitch_xcorr_neon(const opus_val16 *_x, const opus_val16 *_y,
  30. opus_val32 *xcorr, int len, int max_pitch);
  31. # endif
  32. # if defined(OPUS_ARM_MAY_HAVE_MEDIA)
  33. # define celt_pitch_xcorr_media MAY_HAVE_EDSP(celt_pitch_xcorr)
  34. # endif
  35. # if defined(OPUS_ARM_MAY_HAVE_EDSP)
  36. opus_val32 celt_pitch_xcorr_edsp(const opus_val16 *_x, const opus_val16 *_y,
  37. opus_val32 *xcorr, int len, int max_pitch);
  38. # endif
  39. # if !defined(OPUS_HAVE_RTCD)
  40. # define OVERRIDE_PITCH_XCORR (1)
  41. # define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \
  42. ((void)(arch),PRESUME_NEON(celt_pitch_xcorr)(_x, _y, xcorr, len, max_pitch))
  43. # endif
  44. #else /* Start !FIXED_POINT */
  45. /* Float case */
  46. #if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
  47. void celt_pitch_xcorr_float_neon(const opus_val16 *_x, const opus_val16 *_y,
  48. opus_val32 *xcorr, int len, int max_pitch);
  49. #if !defined(OPUS_HAVE_RTCD) || defined(OPUS_ARM_PRESUME_NEON_INTR)
  50. #define OVERRIDE_PITCH_XCORR (1)
  51. # define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \
  52. ((void)(arch),celt_pitch_xcorr_float_neon(_x, _y, xcorr, len, max_pitch))
  53. #endif
  54. #endif
  55. #endif /* end !FIXED_POINT */
  56. #endif