• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
3  * Copyright (c) 2016 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef AVCODEC_MIPS_VP8DSP_MIPS_H
23 #define AVCODEC_MIPS_VP8DSP_MIPS_H
24 
25 #include "libavutil/mem.h"
26 #include "libavcodec/vp8dsp.h"
27 #include "libavcodec/mathops.h"
28 #include "constants.h"
29 
30 void ff_put_vp8_pixels4_msa(uint8_t *dst, ptrdiff_t dststride,
31                             uint8_t *src, ptrdiff_t srcstride,
32                             int h, int x, int y);
33 void ff_put_vp8_pixels8_msa(uint8_t *dst, ptrdiff_t dststride,
34                             uint8_t *src, ptrdiff_t srcstride,
35                             int h, int x, int y);
36 void ff_put_vp8_pixels16_msa(uint8_t *dst, ptrdiff_t dststride,
37                              uint8_t *src, ptrdiff_t srcstride,
38                              int h, int x, int y);
39 
40 void ff_put_vp8_epel16_h4_msa(uint8_t *dst, ptrdiff_t dststride,
41                               uint8_t *src, ptrdiff_t srcstride,
42                               int h, int mx, int my);
43 void ff_put_vp8_epel16_h6_msa(uint8_t *dst, ptrdiff_t dststride,
44                               uint8_t *src, ptrdiff_t srcstride,
45                               int h, int mx, int my);
46 void ff_put_vp8_epel16_v4_msa(uint8_t *dst, ptrdiff_t dststride,
47                               uint8_t *src, ptrdiff_t srcstride,
48                               int h, int mx, int my);
49 void ff_put_vp8_epel16_v6_msa(uint8_t *dst, ptrdiff_t dststride,
50                               uint8_t *src, ptrdiff_t srcstride,
51                               int h, int mx, int my);
52 void ff_put_vp8_epel16_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
53                                 uint8_t *src, ptrdiff_t srcstride,
54                                 int h, int mx, int my);
55 void ff_put_vp8_epel16_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
56                                 uint8_t *src, ptrdiff_t srcstride,
57                                 int h, int mx, int my);
58 void ff_put_vp8_epel16_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
59                                 uint8_t *src, ptrdiff_t srcstride,
60                                 int h, int mx, int my);
61 void ff_put_vp8_epel16_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
62                                 uint8_t *src, ptrdiff_t srcstride,
63                                 int h, int mx, int my);
64 
65 void ff_put_vp8_epel8_h4_msa(uint8_t *dst, ptrdiff_t dststride,
66                              uint8_t *src, ptrdiff_t srcstride,
67                              int h, int mx, int my);
68 void ff_put_vp8_epel8_h6_msa(uint8_t *dst, ptrdiff_t dststride,
69                              uint8_t *src, ptrdiff_t srcstride,
70                              int h, int mx, int my);
71 void ff_put_vp8_epel8_v4_msa(uint8_t *dst, ptrdiff_t dststride,
72                              uint8_t *src, ptrdiff_t srcstride,
73                              int h, int mx, int my);
74 void ff_put_vp8_epel8_v6_msa(uint8_t *dst, ptrdiff_t dststride,
75                              uint8_t *src, ptrdiff_t srcstride,
76                              int h, int mx, int my);
77 void ff_put_vp8_epel8_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
78                                uint8_t *src, ptrdiff_t srcstride,
79                                int h, int mx, int my);
80 void ff_put_vp8_epel8_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
81                                uint8_t *src, ptrdiff_t srcstride,
82                                int h, int mx, int my);
83 void ff_put_vp8_epel8_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
84                                uint8_t *src, ptrdiff_t srcstride,
85                                int h, int mx, int my);
86 void ff_put_vp8_epel8_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
87                                uint8_t *src, ptrdiff_t srcstride,
88                                int h, int mx, int my);
89 
90 void ff_put_vp8_epel4_h4_msa(uint8_t *dst, ptrdiff_t dststride,
91                              uint8_t *src, ptrdiff_t srcstride,
92                              int h, int mx, int my);
93 void ff_put_vp8_epel4_h6_msa(uint8_t *dst, ptrdiff_t dststride,
94                              uint8_t *src, ptrdiff_t srcstride,
95                              int h, int mx, int my);
96 void ff_put_vp8_epel4_v4_msa(uint8_t *dst, ptrdiff_t dststride,
97                              uint8_t *src, ptrdiff_t srcstride,
98                              int h, int mx, int my);
99 void ff_put_vp8_epel4_v6_msa(uint8_t *dst, ptrdiff_t dststride,
100                              uint8_t *src, ptrdiff_t srcstride,
101                              int h, int mx, int my);
102 void ff_put_vp8_epel4_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
103                                uint8_t *src, ptrdiff_t srcstride,
104                                int h, int mx, int my);
105 void ff_put_vp8_epel4_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
106                                uint8_t *src, ptrdiff_t srcstride,
107                                int h, int mx, int my);
108 void ff_put_vp8_epel4_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
109                                uint8_t *src, ptrdiff_t srcstride,
110                                int h, int mx, int my);
111 void ff_put_vp8_epel4_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
112                                uint8_t *src, ptrdiff_t srcstride,
113                                int h, int mx, int my);
114 
115 void ff_put_vp8_bilinear16_h_msa(uint8_t *dst, ptrdiff_t dststride,
116                                  uint8_t *src, ptrdiff_t srcstride,
117                                  int h, int mx, int my);
118 void ff_put_vp8_bilinear16_v_msa(uint8_t *dst, ptrdiff_t dststride,
119                                  uint8_t *src, ptrdiff_t srcstride,
120                                  int h, int mx, int my);
121 void ff_put_vp8_bilinear16_hv_msa(uint8_t *dst, ptrdiff_t dststride,
122                                   uint8_t *src, ptrdiff_t srcstride,
123                                   int h, int mx, int my);
124 
125 void ff_put_vp8_bilinear8_h_msa(uint8_t *dst, ptrdiff_t dststride,
126                                 uint8_t *src, ptrdiff_t srcstride,
127                                 int h, int mx, int my);
128 void ff_put_vp8_bilinear8_v_msa(uint8_t *dst, ptrdiff_t dststride,
129                                 uint8_t *src, ptrdiff_t srcstride,
130                                 int h, int mx, int my);
131 void ff_put_vp8_bilinear8_hv_msa(uint8_t *dst, ptrdiff_t dststride,
132                                  uint8_t *src, ptrdiff_t srcstride,
133                                  int h, int mx, int my);
134 
135 void ff_put_vp8_bilinear4_h_msa(uint8_t *dst, ptrdiff_t dststride,
136                                 uint8_t *src, ptrdiff_t srcstride,
137                                 int h, int mx, int my);
138 void ff_put_vp8_bilinear4_v_msa(uint8_t *dst, ptrdiff_t dststride,
139                                 uint8_t *src, ptrdiff_t srcstride,
140                                 int h, int mx, int my);
141 void ff_put_vp8_bilinear4_hv_msa(uint8_t *dst, ptrdiff_t dststride,
142                                  uint8_t *src, ptrdiff_t srcstride,
143                                  int h, int mx, int my);
144 
145 /* loop filter */
146 void ff_vp8_h_loop_filter16_inner_msa(uint8_t *dst, ptrdiff_t stride,
147                                       int32_t e, int32_t i, int32_t h);
148 void ff_vp8_v_loop_filter16_inner_msa(uint8_t *dst, ptrdiff_t stride,
149                                       int32_t e, int32_t i, int32_t h);
150 void ff_vp8_h_loop_filter8uv_inner_msa(uint8_t *dst_u, uint8_t *dst_v,
151                                        ptrdiff_t stride,
152                                        int flim_e, int flim_i, int hev_thresh);
153 void ff_vp8_v_loop_filter8uv_inner_msa(uint8_t *dst_u, uint8_t *dst_v,
154                                        ptrdiff_t stride,
155                                        int flim_e, int flim_i, int hev_thresh);
156 void ff_vp8_h_loop_filter16_msa(uint8_t *dst, ptrdiff_t stride,
157                                 int flim_e, int flim_i, int hev_thresh);
158 void ff_vp8_v_loop_filter16_msa(uint8_t *dst, ptrdiff_t stride,
159                                 int flim_e, int flim_i, int hev_thresh);
160 void ff_vp8_h_loop_filter8uv_msa(uint8_t *dst_u, uint8_t *dst_v,
161                                  ptrdiff_t stride,
162                                  int flim_e, int flim_i, int hev_thresh);
163 void ff_vp8_v_loop_filter8uv_msa(uint8_t *dst_u, uint8_t *dst_v,
164                                  ptrdiff_t stride,
165                                  int flim_e, int flim_i, int hev_thresh);
166 void ff_vp8_h_loop_filter_simple_msa(uint8_t *dst, ptrdiff_t stride, int flim);
167 void ff_vp8_v_loop_filter_simple_msa(uint8_t *dst, ptrdiff_t stride, int flim);
168 
169 /* Idct functions */
170 void ff_vp8_luma_dc_wht_msa(int16_t block[4][4][16], int16_t dc[16]);
171 void ff_vp8_idct_add_msa(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
172 void ff_vp8_idct_dc_add_msa(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
173 void ff_vp8_idct_dc_add4uv_msa(uint8_t *dst, int16_t block[4][16],
174                                ptrdiff_t stride);
175 void ff_vp8_idct_dc_add4y_msa(uint8_t *dst, int16_t block[4][16],
176                               ptrdiff_t stride);
177 
178 void ff_vp8_luma_dc_wht_mmi(int16_t block[4][4][16], int16_t dc[16]);
179 void ff_vp8_luma_dc_wht_dc_mmi(int16_t block[4][4][16], int16_t dc[16]);
180 void ff_vp8_idct_add_mmi(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
181 void ff_vp8_idct_dc_add_mmi(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
182 void ff_vp8_idct_dc_add4y_mmi(uint8_t *dst, int16_t block[4][16],
183         ptrdiff_t stride);
184 void ff_vp8_idct_dc_add4uv_mmi(uint8_t *dst, int16_t block[4][16],
185         ptrdiff_t stride);
186 
187 void ff_put_vp8_pixels4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
188         ptrdiff_t srcstride, int h, int x, int y);
189 void ff_put_vp8_pixels8_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
190         ptrdiff_t srcstride, int h, int x, int y);
191 void ff_put_vp8_pixels16_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
192         ptrdiff_t srcstride, int h, int x, int y);
193 
194 void ff_put_vp8_epel16_h4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
195         ptrdiff_t srcstride, int h, int mx, int my);
196 void ff_put_vp8_epel16_h6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
197         ptrdiff_t srcstride, int h, int mx, int my);
198 void ff_put_vp8_epel16_v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
199         ptrdiff_t srcstride, int h, int mx, int my);
200 void ff_put_vp8_epel16_v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
201         ptrdiff_t srcstride, int h, int mx, int my);
202 void ff_put_vp8_epel16_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride,
203         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
204 void ff_put_vp8_epel16_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride,
205         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
206 void ff_put_vp8_epel16_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride,
207         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
208 void ff_put_vp8_epel16_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride,
209         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
210 
211 void ff_put_vp8_epel8_h4_mmi(uint8_t *dst, ptrdiff_t dststride,
212         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
213 void ff_put_vp8_epel8_h6_mmi(uint8_t *dst, ptrdiff_t dststride,
214         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
215 void ff_put_vp8_epel8_v4_mmi(uint8_t *dst, ptrdiff_t dststride,
216         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
217 void ff_put_vp8_epel8_v6_mmi(uint8_t *dst, ptrdiff_t dststride,
218         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
219 void ff_put_vp8_epel8_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride,
220         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
221 void ff_put_vp8_epel8_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride,
222         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
223 void ff_put_vp8_epel8_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride,
224         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
225 void ff_put_vp8_epel8_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride,
226         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
227 
228 void ff_put_vp8_epel4_h4_mmi(uint8_t *dst, ptrdiff_t dststride,
229         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
230 void ff_put_vp8_epel4_h6_mmi(uint8_t *dst, ptrdiff_t dststride,
231         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
232 void ff_put_vp8_epel4_v4_mmi(uint8_t *dst, ptrdiff_t dststride,
233         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
234 void ff_put_vp8_epel4_v6_mmi(uint8_t *dst, ptrdiff_t dststride,
235         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
236 void ff_put_vp8_epel4_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride,
237         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
238 void ff_put_vp8_epel4_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride,
239         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
240 void ff_put_vp8_epel4_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride,
241         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
242 void ff_put_vp8_epel4_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride,
243         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
244 
245 void ff_put_vp8_bilinear16_h_mmi(uint8_t *dst, ptrdiff_t dststride,
246         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
247 void ff_put_vp8_bilinear16_v_mmi(uint8_t *dst, ptrdiff_t dststride,
248         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
249 void ff_put_vp8_bilinear16_hv_mmi(uint8_t *dst, ptrdiff_t dststride,
250         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
251 
252 void ff_put_vp8_bilinear8_h_mmi(uint8_t *dst, ptrdiff_t dststride,
253         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
254 void ff_put_vp8_bilinear8_v_mmi(uint8_t *dst, ptrdiff_t dststride,
255         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
256 void ff_put_vp8_bilinear8_hv_mmi(uint8_t *dst, ptrdiff_t dststride,
257         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
258 
259 void ff_put_vp8_bilinear4_h_mmi(uint8_t *dst, ptrdiff_t dststride,
260         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
261 void ff_put_vp8_bilinear4_v_mmi(uint8_t *dst, ptrdiff_t dststride,
262         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
263 void ff_put_vp8_bilinear4_hv_mmi(uint8_t *dst, ptrdiff_t dststride,
264         uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
265 
266 // loop filter applied to edges between macroblocks
267 void ff_vp8_v_loop_filter16_mmi(uint8_t *dst, ptrdiff_t stride, int flim_E,
268         int flim_I, int hev_thresh);
269 void ff_vp8_h_loop_filter16_mmi(uint8_t *dst, ptrdiff_t stride, int flim_E,
270         int flim_I, int hev_thresh);
271 void ff_vp8_v_loop_filter8uv_mmi(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride,
272         int flim_E, int flim_I, int hev_thresh);
273 void ff_vp8_h_loop_filter8uv_mmi(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride,
274         int flim_E, int flim_I, int hev_thresh);
275 
276 // loop filter applied to inner macroblock edges
277 void ff_vp8_v_loop_filter16_inner_mmi(uint8_t *dst, ptrdiff_t stride,
278         int flim_E, int flim_I, int hev_thresh);
279 void ff_vp8_h_loop_filter16_inner_mmi(uint8_t *dst, ptrdiff_t stride,
280         int flim_E, int flim_I, int hev_thresh);
281 void ff_vp8_v_loop_filter8uv_inner_mmi(uint8_t *dstU, uint8_t *dstV,
282         ptrdiff_t stride, int flim_E, int flim_I, int hev_thresh);
283 void ff_vp8_h_loop_filter8uv_inner_mmi(uint8_t *dstU, uint8_t *dstV,
284         ptrdiff_t stride, int flim_E, int flim_I, int hev_thresh);
285 
286 void ff_vp8_v_loop_filter_simple_mmi(uint8_t *dst, ptrdiff_t stride, int flim);
287 void ff_vp8_h_loop_filter_simple_mmi(uint8_t *dst, ptrdiff_t stride, int flim);
288 
289 #endif  // #ifndef AVCODEC_MIPS_VP8DSP_MIPS_H
290