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
11 #include "./vp8_rtcd.h"
12 #include "vp8/common/mips/msa/vp8_macros_msa.h"
13
copy_8x4_msa(uint8_t * src,int32_t src_stride,uint8_t * dst,int32_t dst_stride)14 static void copy_8x4_msa(uint8_t *src, int32_t src_stride,
15 uint8_t *dst, int32_t dst_stride)
16 {
17 uint64_t src0, src1, src2, src3;
18
19 LD4(src, src_stride, src0, src1, src2, src3);
20 SD4(src0, src1, src2, src3, dst, dst_stride);
21 }
22
copy_8x8_msa(uint8_t * src,int32_t src_stride,uint8_t * dst,int32_t dst_stride)23 static void copy_8x8_msa(uint8_t *src, int32_t src_stride,
24 uint8_t *dst, int32_t dst_stride)
25 {
26 uint64_t src0, src1, src2, src3;
27
28 LD4(src, src_stride, src0, src1, src2, src3);
29 src += (4 * src_stride);
30 SD4(src0, src1, src2, src3, dst, dst_stride);
31 dst += (4 * dst_stride);
32
33 LD4(src, src_stride, src0, src1, src2, src3);
34 SD4(src0, src1, src2, src3, dst, dst_stride);
35 }
36
copy_16x16_msa(uint8_t * src,int32_t src_stride,uint8_t * dst,int32_t dst_stride)37 static void copy_16x16_msa(uint8_t *src, int32_t src_stride,
38 uint8_t *dst, int32_t dst_stride)
39 {
40 v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
41 v16u8 src8, src9, src10, src11, src12, src13, src14, src15;
42
43 LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
44 src += (8 * src_stride);
45 LD_UB8(src, src_stride, src8, src9, src10, src11, src12, src13, src14,
46 src15);
47
48 ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7, dst, dst_stride);
49 dst += (8 * dst_stride);
50 ST_UB8(src8, src9, src10, src11, src12, src13, src14, src15, dst,
51 dst_stride);
52 }
53
vp8_copy_mem16x16_msa(uint8_t * src,int32_t src_stride,uint8_t * dst,int32_t dst_stride)54 void vp8_copy_mem16x16_msa(uint8_t *src, int32_t src_stride,
55 uint8_t *dst, int32_t dst_stride)
56 {
57 copy_16x16_msa(src, src_stride, dst, dst_stride);
58 }
59
vp8_copy_mem8x8_msa(uint8_t * src,int32_t src_stride,uint8_t * dst,int32_t dst_stride)60 void vp8_copy_mem8x8_msa(uint8_t *src, int32_t src_stride,
61 uint8_t *dst, int32_t dst_stride)
62 {
63 copy_8x8_msa(src, src_stride, dst, dst_stride);
64 }
65
vp8_copy_mem8x4_msa(uint8_t * src,int32_t src_stride,uint8_t * dst,int32_t dst_stride)66 void vp8_copy_mem8x4_msa(uint8_t *src, int32_t src_stride,
67 uint8_t *dst, int32_t dst_stride)
68 {
69 copy_8x4_msa(src, src_stride, dst, dst_stride);
70 }
71