copymem_msa.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2015 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 "./vp8_rtcd.h"
  11. #include "vp8/common/mips/msa/vp8_macros_msa.h"
  12. static void copy_8x4_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
  13. int32_t dst_stride) {
  14. uint64_t src0, src1, src2, src3;
  15. LD4(src, src_stride, src0, src1, src2, src3);
  16. SD4(src0, src1, src2, src3, dst, dst_stride);
  17. }
  18. static void copy_8x8_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
  19. int32_t dst_stride) {
  20. uint64_t src0, src1, src2, src3;
  21. LD4(src, src_stride, src0, src1, src2, src3);
  22. src += (4 * src_stride);
  23. SD4(src0, src1, src2, src3, dst, dst_stride);
  24. dst += (4 * dst_stride);
  25. LD4(src, src_stride, src0, src1, src2, src3);
  26. SD4(src0, src1, src2, src3, dst, dst_stride);
  27. }
  28. static void copy_16x16_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
  29. int32_t dst_stride) {
  30. v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
  31. v16u8 src8, src9, src10, src11, src12, src13, src14, src15;
  32. LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
  33. src += (8 * src_stride);
  34. LD_UB8(src, src_stride, src8, src9, src10, src11, src12, src13, src14, src15);
  35. ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7, dst, dst_stride);
  36. dst += (8 * dst_stride);
  37. ST_UB8(src8, src9, src10, src11, src12, src13, src14, src15, dst, dst_stride);
  38. }
  39. void vp8_copy_mem16x16_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
  40. int32_t dst_stride) {
  41. copy_16x16_msa(src, src_stride, dst, dst_stride);
  42. }
  43. void vp8_copy_mem8x8_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
  44. int32_t dst_stride) {
  45. copy_8x8_msa(src, src_stride, dst, dst_stride);
  46. }
  47. void vp8_copy_mem8x4_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
  48. int32_t dst_stride) {
  49. copy_8x4_msa(src, src_stride, dst, dst_stride);
  50. }