copymem_neon.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #include <arm_neon.h>
  11. void vp8_copy_mem8x4_neon(
  12. unsigned char *src,
  13. int src_stride,
  14. unsigned char *dst,
  15. int dst_stride) {
  16. uint8x8_t vtmp;
  17. int r;
  18. for (r = 0; r < 4; r++) {
  19. vtmp = vld1_u8(src);
  20. vst1_u8(dst, vtmp);
  21. src += src_stride;
  22. dst += dst_stride;
  23. }
  24. }
  25. void vp8_copy_mem8x8_neon(
  26. unsigned char *src,
  27. int src_stride,
  28. unsigned char *dst,
  29. int dst_stride) {
  30. uint8x8_t vtmp;
  31. int r;
  32. for (r = 0; r < 8; r++) {
  33. vtmp = vld1_u8(src);
  34. vst1_u8(dst, vtmp);
  35. src += src_stride;
  36. dst += dst_stride;
  37. }
  38. }
  39. void vp8_copy_mem16x16_neon(
  40. unsigned char *src,
  41. int src_stride,
  42. unsigned char *dst,
  43. int dst_stride) {
  44. int r;
  45. uint8x16_t qtmp;
  46. for (r = 0; r < 16; r++) {
  47. qtmp = vld1q_u8(src);
  48. vst1q_u8(dst, qtmp);
  49. src += src_stride;
  50. dst += dst_stride;
  51. }
  52. }