2 * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
4 * This file is part of FFmpeg.
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.
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.
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
21 #ifndef AVCODEC_MIPS_HEVCDSP_MIPS_H
22 #define AVCODEC_MIPS_HEVCDSP_MIPS_H
24 #include "libavcodec/hevcdsp.h"
26 #define MC(PEL, DIR, WIDTH) \
27 void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_msa(int16_t *dst, \
29 ptrdiff_t src_stride, \
104 #define UNI_MC(PEL, DIR, WIDTH) \
105 void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
106 ptrdiff_t dst_stride, \
108 ptrdiff_t src_stride, \
114 UNI_MC(pel, pixels, 4);
115 UNI_MC(pel, pixels, 6);
116 UNI_MC(pel, pixels, 8);
117 UNI_MC(pel, pixels, 12);
118 UNI_MC(pel, pixels, 16);
119 UNI_MC(pel, pixels, 24);
120 UNI_MC(pel, pixels, 32);
121 UNI_MC(pel, pixels, 48);
122 UNI_MC(pel, pixels, 64);
144 UNI_MC(qpel, hv, 12);
145 UNI_MC(qpel, hv, 16);
146 UNI_MC(qpel, hv, 24);
147 UNI_MC(qpel, hv, 32);
148 UNI_MC(qpel, hv, 48);
149 UNI_MC(qpel, hv, 64);
174 UNI_MC(epel, hv, 12);
175 UNI_MC(epel, hv, 16);
176 UNI_MC(epel, hv, 24);
177 UNI_MC(epel, hv, 32);
178 UNI_MC(epel, hv, 48);
179 UNI_MC(epel, hv, 64);
183 #define UNI_W_MC(PEL, DIR, WIDTH) \
184 void ff_hevc_put_hevc_uni_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
198 UNI_W_MC(pel, pixels, 4);
199 UNI_W_MC(pel, pixels, 6);
200 UNI_W_MC(pel, pixels, 8);
201 UNI_W_MC(pel, pixels, 12);
202 UNI_W_MC(pel, pixels, 16);
203 UNI_W_MC(pel, pixels, 24);
204 UNI_W_MC(pel, pixels, 32);
205 UNI_W_MC(pel, pixels, 48);
206 UNI_W_MC(pel, pixels, 64);
208 UNI_W_MC(qpel, h, 4);
209 UNI_W_MC(qpel, h, 8);
210 UNI_W_MC(qpel, h, 12);
211 UNI_W_MC(qpel, h, 16);
212 UNI_W_MC(qpel, h, 24);
213 UNI_W_MC(qpel, h, 32);
214 UNI_W_MC(qpel, h, 48);
215 UNI_W_MC(qpel, h, 64);
217 UNI_W_MC(qpel, v, 4);
218 UNI_W_MC(qpel, v, 8);
219 UNI_W_MC(qpel, v, 12);
220 UNI_W_MC(qpel, v, 16);
221 UNI_W_MC(qpel, v, 24);
222 UNI_W_MC(qpel, v, 32);
223 UNI_W_MC(qpel, v, 48);
224 UNI_W_MC(qpel, v, 64);
226 UNI_W_MC(qpel, hv, 4);
227 UNI_W_MC(qpel, hv, 8);
228 UNI_W_MC(qpel, hv, 12);
229 UNI_W_MC(qpel, hv, 16);
230 UNI_W_MC(qpel, hv, 24);
231 UNI_W_MC(qpel, hv, 32);
232 UNI_W_MC(qpel, hv, 48);
233 UNI_W_MC(qpel, hv, 64);
235 UNI_W_MC(epel, h, 4);
236 UNI_W_MC(epel, h, 6);
237 UNI_W_MC(epel, h, 8);
238 UNI_W_MC(epel, h, 12);
239 UNI_W_MC(epel, h, 16);
240 UNI_W_MC(epel, h, 24);
241 UNI_W_MC(epel, h, 32);
242 UNI_W_MC(epel, h, 48);
243 UNI_W_MC(epel, h, 64);
245 UNI_W_MC(epel, v, 4);
246 UNI_W_MC(epel, v, 6);
247 UNI_W_MC(epel, v, 8);
248 UNI_W_MC(epel, v, 12);
249 UNI_W_MC(epel, v, 16);
250 UNI_W_MC(epel, v, 24);
251 UNI_W_MC(epel, v, 32);
252 UNI_W_MC(epel, v, 48);
253 UNI_W_MC(epel, v, 64);
255 UNI_W_MC(epel, hv, 4);
256 UNI_W_MC(epel, hv, 6);
257 UNI_W_MC(epel, hv, 8);
258 UNI_W_MC(epel, hv, 12);
259 UNI_W_MC(epel, hv, 16);
260 UNI_W_MC(epel, hv, 24);
261 UNI_W_MC(epel, hv, 32);
262 UNI_W_MC(epel, hv, 48);
263 UNI_W_MC(epel, hv, 64);
267 #define BI_MC(PEL, DIR, WIDTH) \
268 void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
269 ptrdiff_t dst_stride, \
271 ptrdiff_t src_stride, \
272 int16_t *src_16bit, \
278 BI_MC(pel, pixels, 4);
279 BI_MC(pel, pixels, 6);
280 BI_MC(pel, pixels, 8);
281 BI_MC(pel, pixels, 12);
282 BI_MC(pel, pixels, 16);
283 BI_MC(pel, pixels, 24);
284 BI_MC(pel, pixels, 32);
285 BI_MC(pel, pixels, 48);
286 BI_MC(pel, pixels, 64);
347 #define BI_W_MC(PEL, DIR, WIDTH) \
348 void ff_hevc_put_hevc_bi_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
354 int16_t *src_16bit, \
365 BI_W_MC(pel, pixels, 4);
366 BI_W_MC(pel, pixels, 6);
367 BI_W_MC(pel, pixels, 8);
368 BI_W_MC(pel, pixels, 12);
369 BI_W_MC(pel, pixels, 16);
370 BI_W_MC(pel, pixels, 24);
371 BI_W_MC(pel, pixels, 32);
372 BI_W_MC(pel, pixels, 48);
373 BI_W_MC(pel, pixels, 64);
377 BI_W_MC(qpel, h, 12);
378 BI_W_MC(qpel, h, 16);
379 BI_W_MC(qpel, h, 24);
380 BI_W_MC(qpel, h, 32);
381 BI_W_MC(qpel, h, 48);
382 BI_W_MC(qpel, h, 64);
386 BI_W_MC(qpel, v, 12);
387 BI_W_MC(qpel, v, 16);
388 BI_W_MC(qpel, v, 24);
389 BI_W_MC(qpel, v, 32);
390 BI_W_MC(qpel, v, 48);
391 BI_W_MC(qpel, v, 64);
393 BI_W_MC(qpel, hv, 4);
394 BI_W_MC(qpel, hv, 8);
395 BI_W_MC(qpel, hv, 12);
396 BI_W_MC(qpel, hv, 16);
397 BI_W_MC(qpel, hv, 24);
398 BI_W_MC(qpel, hv, 32);
399 BI_W_MC(qpel, hv, 48);
400 BI_W_MC(qpel, hv, 64);
405 BI_W_MC(epel, h, 12);
406 BI_W_MC(epel, h, 16);
407 BI_W_MC(epel, h, 24);
408 BI_W_MC(epel, h, 32);
409 BI_W_MC(epel, h, 48);
410 BI_W_MC(epel, h, 64);
415 BI_W_MC(epel, v, 12);
416 BI_W_MC(epel, v, 16);
417 BI_W_MC(epel, v, 24);
418 BI_W_MC(epel, v, 32);
419 BI_W_MC(epel, v, 48);
420 BI_W_MC(epel, v, 64);
422 BI_W_MC(epel, hv, 4);
423 BI_W_MC(epel, hv, 6);
424 BI_W_MC(epel, hv, 8);
425 BI_W_MC(epel, hv, 12);
426 BI_W_MC(epel, hv, 16);
427 BI_W_MC(epel, hv, 24);
428 BI_W_MC(epel, hv, 32);
429 BI_W_MC(epel, hv, 48);
430 BI_W_MC(epel, hv, 64);
434 void ff_hevc_loop_filter_luma_h_8_msa(uint8_t *src,
435 ptrdiff_t src_stride,
436 int32_t beta, int32_t *tc,
437 uint8_t *no_p, uint8_t *no_q);
439 void ff_hevc_loop_filter_luma_v_8_msa(uint8_t *src,
440 ptrdiff_t src_stride,
441 int32_t beta, int32_t *tc,
442 uint8_t *no_p, uint8_t *no_q);
444 void ff_hevc_loop_filter_chroma_h_8_msa(uint8_t *src,
445 ptrdiff_t src_stride,
446 int32_t *tc, uint8_t *no_p,
449 void ff_hevc_loop_filter_chroma_v_8_msa(uint8_t *src,
450 ptrdiff_t src_stride,
451 int32_t *tc, uint8_t *no_p,
454 void ff_hevc_sao_band_filter_0_8_msa(uint8_t *dst, uint8_t *src,
455 ptrdiff_t stride_dst, ptrdiff_t stride_src,
456 int16_t *sao_offset_val, int sao_left_class,
457 int width, int height);
459 void ff_hevc_sao_edge_filter_8_msa(uint8_t *dst, uint8_t *src,
460 ptrdiff_t stride_dst,
461 int16_t *sao_offset_val,
462 int eo, int width, int height);
464 void ff_hevc_idct_4x4_msa(int16_t *coeffs, int col_limit);
465 void ff_hevc_idct_8x8_msa(int16_t *coeffs, int col_limit);
466 void ff_hevc_idct_16x16_msa(int16_t *coeffs, int col_limit);
467 void ff_hevc_idct_32x32_msa(int16_t *coeffs, int col_limit);
468 void ff_hevc_idct_dc_4x4_msa(int16_t *coeffs);
469 void ff_hevc_idct_dc_8x8_msa(int16_t *coeffs);
470 void ff_hevc_idct_dc_16x16_msa(int16_t *coeffs);
471 void ff_hevc_idct_dc_32x32_msa(int16_t *coeffs);
472 void ff_hevc_addblk_4x4_msa(uint8_t *dst, int16_t *pi16Coeffs,
474 void ff_hevc_addblk_8x8_msa(uint8_t *dst, int16_t *pi16Coeffs,
476 void ff_hevc_addblk_16x16_msa(uint8_t *dst, int16_t *pi16Coeffs,
478 void ff_hevc_addblk_32x32_msa(uint8_t *dst, int16_t *pi16Coeffs,
480 void ff_hevc_idct_luma_4x4_msa(int16_t *pi16Coeffs);
482 #endif // #ifndef AVCODEC_MIPS_HEVCDSP_MIPS_H