OSDN Git Service

avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for HEVC bi mc functions
[android-x86/external-ffmpeg.git] / libavcodec / mips / hevcdsp_mips.h
1 /*
2  * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg 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  * FFmpeg 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 FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20
21 #include "libavcodec/hevcdsp.h"
22
23 #define MC(PEL, DIR, WIDTH)                                                 \
24 void ff_hevc_put_hevc_##PEL##_##DIR####WIDTH##_8_msa(int16_t *dst,          \
25                                                      uint8_t *src,          \
26                                                      ptrdiff_t src_stride,  \
27                                                      int height,            \
28                                                      intptr_t mx,           \
29                                                      intptr_t my,           \
30                                                      int width)
31
32 MC(pel, pixels, 4);
33 MC(pel, pixels, 6);
34 MC(pel, pixels, 8);
35 MC(pel, pixels, 12);
36 MC(pel, pixels, 16);
37 MC(pel, pixels, 24);
38 MC(pel, pixels, 32);
39 MC(pel, pixels, 48);
40 MC(pel, pixels, 64);
41
42 MC(qpel, h, 4);
43 MC(qpel, h, 8);
44 MC(qpel, h, 12);
45 MC(qpel, h, 16);
46 MC(qpel, h, 24);
47 MC(qpel, h, 32);
48 MC(qpel, h, 48);
49 MC(qpel, h, 64);
50
51 MC(qpel, v, 4);
52 MC(qpel, v, 8);
53 MC(qpel, v, 12);
54 MC(qpel, v, 16);
55 MC(qpel, v, 24);
56 MC(qpel, v, 32);
57 MC(qpel, v, 48);
58 MC(qpel, v, 64);
59
60 MC(qpel, hv, 4);
61 MC(qpel, hv, 8);
62 MC(qpel, hv, 12);
63 MC(qpel, hv, 16);
64 MC(qpel, hv, 24);
65 MC(qpel, hv, 32);
66 MC(qpel, hv, 48);
67 MC(qpel, hv, 64);
68
69 #undef MC
70
71 #define UNI_MC(PEL, DIR, WIDTH)                                                \
72 void ff_hevc_put_hevc_uni_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst,         \
73                                                          ptrdiff_t dst_stride, \
74                                                          uint8_t *src,         \
75                                                          ptrdiff_t src_stride, \
76                                                          int height,           \
77                                                          intptr_t mx,          \
78                                                          intptr_t my,          \
79                                                          int width)
80
81 UNI_MC(pel, pixels, 4);
82 UNI_MC(pel, pixels, 6);
83 UNI_MC(pel, pixels, 8);
84 UNI_MC(pel, pixels, 12);
85 UNI_MC(pel, pixels, 16);
86 UNI_MC(pel, pixels, 24);
87 UNI_MC(pel, pixels, 32);
88 UNI_MC(pel, pixels, 48);
89 UNI_MC(pel, pixels, 64);
90
91 UNI_MC(qpel, h, 4);
92 UNI_MC(qpel, h, 8);
93 UNI_MC(qpel, h, 12);
94 UNI_MC(qpel, h, 16);
95 UNI_MC(qpel, h, 24);
96 UNI_MC(qpel, h, 32);
97 UNI_MC(qpel, h, 48);
98 UNI_MC(qpel, h, 64);
99
100 UNI_MC(qpel, v, 4);
101 UNI_MC(qpel, v, 8);
102 UNI_MC(qpel, v, 12);
103 UNI_MC(qpel, v, 16);
104 UNI_MC(qpel, v, 24);
105 UNI_MC(qpel, v, 32);
106 UNI_MC(qpel, v, 48);
107 UNI_MC(qpel, v, 64);
108
109 UNI_MC(qpel, hv, 4);
110 UNI_MC(qpel, hv, 8);
111 UNI_MC(qpel, hv, 12);
112 UNI_MC(qpel, hv, 16);
113 UNI_MC(qpel, hv, 24);
114 UNI_MC(qpel, hv, 32);
115 UNI_MC(qpel, hv, 48);
116 UNI_MC(qpel, hv, 64);
117
118 #undef UNI_MC
119
120 #define BI_MC(PEL, DIR, WIDTH)                                                 \
121 void ff_hevc_put_hevc_bi_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst,          \
122                                                         ptrdiff_t dst_stride,  \
123                                                         uint8_t *src,          \
124                                                         ptrdiff_t src_stride,  \
125                                                         int16_t *src_16bit,    \
126                                                         int height,            \
127                                                         intptr_t mx,           \
128                                                         intptr_t my,           \
129                                                         int width)
130
131 BI_MC(pel, pixels, 4);
132 BI_MC(pel, pixels, 6);
133 BI_MC(pel, pixels, 8);
134 BI_MC(pel, pixels, 12);
135 BI_MC(pel, pixels, 16);
136 BI_MC(pel, pixels, 24);
137 BI_MC(pel, pixels, 32);
138 BI_MC(pel, pixels, 48);
139 BI_MC(pel, pixels, 64);
140
141 BI_MC(qpel, h, 4);
142 BI_MC(qpel, h, 8);
143 BI_MC(qpel, h, 12);
144 BI_MC(qpel, h, 16);
145 BI_MC(qpel, h, 24);
146 BI_MC(qpel, h, 32);
147 BI_MC(qpel, h, 48);
148 BI_MC(qpel, h, 64);
149
150 BI_MC(qpel, v, 4);
151 BI_MC(qpel, v, 8);
152 BI_MC(qpel, v, 12);
153 BI_MC(qpel, v, 16);
154 BI_MC(qpel, v, 24);
155 BI_MC(qpel, v, 32);
156 BI_MC(qpel, v, 48);
157 BI_MC(qpel, v, 64);
158
159 BI_MC(qpel, hv, 4);
160 BI_MC(qpel, hv, 8);
161 BI_MC(qpel, hv, 12);
162 BI_MC(qpel, hv, 16);
163 BI_MC(qpel, hv, 24);
164 BI_MC(qpel, hv, 32);
165 BI_MC(qpel, hv, 48);
166 BI_MC(qpel, hv, 64);
167
168 BI_MC(epel, h, 4);
169 BI_MC(epel, h, 6);
170 BI_MC(epel, h, 8);
171 BI_MC(epel, h, 12);
172 BI_MC(epel, h, 16);
173 BI_MC(epel, h, 24);
174 BI_MC(epel, h, 32);
175 BI_MC(epel, h, 48);
176 BI_MC(epel, h, 64);
177
178 BI_MC(epel, v, 4);
179 BI_MC(epel, v, 6);
180 BI_MC(epel, v, 8);
181 BI_MC(epel, v, 12);
182 BI_MC(epel, v, 16);
183 BI_MC(epel, v, 24);
184 BI_MC(epel, v, 32);
185 BI_MC(epel, v, 48);
186 BI_MC(epel, v, 64);
187
188 BI_MC(epel, hv, 4);
189 BI_MC(epel, hv, 6);
190 BI_MC(epel, hv, 8);
191 BI_MC(epel, hv, 12);
192 BI_MC(epel, hv, 16);
193 BI_MC(epel, hv, 24);
194 BI_MC(epel, hv, 32);
195 BI_MC(epel, hv, 48);
196 BI_MC(epel, hv, 64);
197
198 #undef BI_MC