You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7KB

  1. /*
  2. * Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
  3. *
  4. * This file is part of Libav.
  5. *
  6. * Libav is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * Libav is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with Libav; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVCODEC_ARM_DCA_H
  21. #define AVCODEC_ARM_DCA_H
  22. #include <stdint.h>
  23. #include "config.h"
  24. #if HAVE_NEON && HAVE_INLINE_ASM && HAVE_ASM_MOD_Y
  25. #define int8x8_fmul_int32 int8x8_fmul_int32
  26. static inline void int8x8_fmul_int32(float *dst, const int8_t *src, int scale)
  27. {
  28. __asm__ ("vcvt.f32.s32 %2, %2, #4 \n"
  29. "vld1.8 {d0}, [%1,:64] \n"
  30. "vmovl.s8 q0, d0 \n"
  31. "vmovl.s16 q1, d1 \n"
  32. "vmovl.s16 q0, d0 \n"
  33. "vcvt.f32.s32 q0, q0 \n"
  34. "vcvt.f32.s32 q1, q1 \n"
  35. "vmul.f32 q0, q0, %y2 \n"
  36. "vmul.f32 q1, q1, %y2 \n"
  37. "vst1.32 {q0-q1}, [%m0,:128] \n"
  38. : "=Um"(*(float (*)[8])dst)
  39. : "r"(src), "x"(scale)
  40. : "d0", "d1", "d2", "d3");
  41. }
  42. #endif
  43. #endif /* AVCODEC_ARM_DCA_H */