vp9dsp_mips.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. /*
  2. * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@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. #ifndef AVCODEC_MIPS_VP9DSP_MIPS_H
  21. #define AVCODEC_MIPS_VP9DSP_MIPS_H
  22. #define VP9_8TAP_MIPS_MSA_FUNC(SIZE, type, type_idx) \
  23. void ff_put_8tap_##type##_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride, \
  24. const uint8_t *src, \
  25. ptrdiff_t srcstride, \
  26. int h, int mx, int my); \
  27. \
  28. void ff_put_8tap_##type##_##SIZE##v_msa(uint8_t *dst, ptrdiff_t dststride, \
  29. const uint8_t *src, \
  30. ptrdiff_t srcstride, \
  31. int h, int mx, int my); \
  32. \
  33. void ff_put_8tap_##type##_##SIZE##hv_msa(uint8_t *dst, ptrdiff_t dststride, \
  34. const uint8_t *src, \
  35. ptrdiff_t srcstride, \
  36. int h, int mx, int my); \
  37. \
  38. void ff_avg_8tap_##type##_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride, \
  39. const uint8_t *src, \
  40. ptrdiff_t srcstride, \
  41. int h, int mx, int my); \
  42. \
  43. void ff_avg_8tap_##type##_##SIZE##v_msa(uint8_t *dst, ptrdiff_t dststride, \
  44. const uint8_t *src, \
  45. ptrdiff_t srcstride, \
  46. int h, int mx, int my); \
  47. \
  48. void ff_avg_8tap_##type##_##SIZE##hv_msa(uint8_t *dst, ptrdiff_t dststride, \
  49. const uint8_t *src, \
  50. ptrdiff_t srcstride, \
  51. int h, int mx, int my);
  52. #define VP9_BILINEAR_MIPS_MSA_FUNC(SIZE) \
  53. void ff_put_bilin_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride, \
  54. const uint8_t *src, ptrdiff_t srcstride, \
  55. int h, int mx, int my); \
  56. \
  57. void ff_put_bilin_##SIZE##v_msa(uint8_t *dst, ptrdiff_t dststride, \
  58. const uint8_t *src, ptrdiff_t srcstride, \
  59. int h, int mx, int my); \
  60. \
  61. void ff_put_bilin_##SIZE##hv_msa(uint8_t *dst, ptrdiff_t dststride, \
  62. const uint8_t *src, ptrdiff_t srcstride, \
  63. int h, int mx, int my); \
  64. \
  65. void ff_avg_bilin_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride, \
  66. const uint8_t *src, ptrdiff_t srcstride, \
  67. int h, int mx, int my); \
  68. \
  69. void ff_avg_bilin_##SIZE##v_msa(uint8_t *dst, ptrdiff_t dststride, \
  70. const uint8_t *src, ptrdiff_t srcstride, \
  71. int h, int mx, int my); \
  72. \
  73. void ff_avg_bilin_##SIZE##hv_msa(uint8_t *dst, ptrdiff_t dststride, \
  74. const uint8_t *src, ptrdiff_t srcstride, \
  75. int h, int mx, int my);
  76. #define VP9_COPY_AVG_MIPS_MSA_FUNC(SIZE) \
  77. void ff_copy##SIZE##_msa(uint8_t *dst, ptrdiff_t dststride, \
  78. const uint8_t *src, ptrdiff_t srcstride, \
  79. int h, int mx, int my); \
  80. \
  81. void ff_avg##SIZE##_msa(uint8_t *dst, ptrdiff_t dststride, \
  82. const uint8_t *src, ptrdiff_t srcstride, \
  83. int h, int mx, int my);
  84. VP9_8TAP_MIPS_MSA_FUNC(64, regular, FILTER_8TAP_REGULAR);
  85. VP9_8TAP_MIPS_MSA_FUNC(32, regular, FILTER_8TAP_REGULAR);
  86. VP9_8TAP_MIPS_MSA_FUNC(16, regular, FILTER_8TAP_REGULAR);
  87. VP9_8TAP_MIPS_MSA_FUNC(8, regular, FILTER_8TAP_REGULAR);
  88. VP9_8TAP_MIPS_MSA_FUNC(4, regular, FILTER_8TAP_REGULAR);
  89. VP9_8TAP_MIPS_MSA_FUNC(64, sharp, FILTER_8TAP_SHARP);
  90. VP9_8TAP_MIPS_MSA_FUNC(32, sharp, FILTER_8TAP_SHARP);
  91. VP9_8TAP_MIPS_MSA_FUNC(16, sharp, FILTER_8TAP_SHARP);
  92. VP9_8TAP_MIPS_MSA_FUNC(8, sharp, FILTER_8TAP_SHARP);
  93. VP9_8TAP_MIPS_MSA_FUNC(4, sharp, FILTER_8TAP_SHARP);
  94. VP9_8TAP_MIPS_MSA_FUNC(64, smooth, FILTER_8TAP_SMOOTH);
  95. VP9_8TAP_MIPS_MSA_FUNC(32, smooth, FILTER_8TAP_SMOOTH);
  96. VP9_8TAP_MIPS_MSA_FUNC(16, smooth, FILTER_8TAP_SMOOTH);
  97. VP9_8TAP_MIPS_MSA_FUNC(8, smooth, FILTER_8TAP_SMOOTH);
  98. VP9_8TAP_MIPS_MSA_FUNC(4, smooth, FILTER_8TAP_SMOOTH);
  99. VP9_BILINEAR_MIPS_MSA_FUNC(64);
  100. VP9_BILINEAR_MIPS_MSA_FUNC(32);
  101. VP9_BILINEAR_MIPS_MSA_FUNC(16);
  102. VP9_BILINEAR_MIPS_MSA_FUNC(8);
  103. VP9_BILINEAR_MIPS_MSA_FUNC(4);
  104. VP9_COPY_AVG_MIPS_MSA_FUNC(64);
  105. VP9_COPY_AVG_MIPS_MSA_FUNC(32);
  106. VP9_COPY_AVG_MIPS_MSA_FUNC(16);
  107. VP9_COPY_AVG_MIPS_MSA_FUNC(8);
  108. VP9_COPY_AVG_MIPS_MSA_FUNC(4);
  109. #undef VP9_8TAP_MIPS_MSA_FUNC
  110. #undef VP9_BILINEAR_MIPS_MSA_FUNC
  111. #undef VP9_COPY_AVG_MIPS_MSA_FUNC
  112. void ff_loop_filter_h_4_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  113. int32_t i, int32_t h);
  114. void ff_loop_filter_h_8_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  115. int32_t i, int32_t h);
  116. void ff_loop_filter_h_16_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  117. int32_t i, int32_t h);
  118. void ff_loop_filter_v_4_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  119. int32_t i, int32_t h);
  120. void ff_loop_filter_v_8_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  121. int32_t i, int32_t h);
  122. void ff_loop_filter_v_16_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  123. int32_t i, int32_t h);
  124. void ff_loop_filter_h_44_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  125. int32_t i, int32_t h);
  126. void ff_loop_filter_h_88_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  127. int32_t i, int32_t h);
  128. void ff_loop_filter_h_16_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  129. int32_t i, int32_t h);
  130. void ff_loop_filter_v_44_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  131. int32_t i, int32_t h);
  132. void ff_loop_filter_v_88_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  133. int32_t i, int32_t h);
  134. void ff_loop_filter_v_16_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  135. int32_t i, int32_t h);
  136. void ff_loop_filter_h_48_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  137. int32_t i, int32_t h);
  138. void ff_loop_filter_h_84_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  139. int32_t i, int32_t h);
  140. void ff_loop_filter_v_48_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  141. int32_t i, int32_t h);
  142. void ff_loop_filter_v_84_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
  143. int32_t i, int32_t h);
  144. void ff_idct_idct_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
  145. int16_t *block, int eob);
  146. void ff_idct_idct_8x8_add_msa(uint8_t *dst, ptrdiff_t stride,
  147. int16_t *block, int eob);
  148. void ff_idct_idct_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
  149. int16_t *block, int eob);
  150. void ff_idct_idct_32x32_add_msa(uint8_t *dst, ptrdiff_t stride,
  151. int16_t *block, int eob);
  152. void ff_iadst_iadst_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
  153. int16_t *block, int eob);
  154. void ff_iadst_iadst_8x8_add_msa(uint8_t *dst, ptrdiff_t stride,
  155. int16_t *block, int eob);
  156. void ff_iadst_iadst_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
  157. int16_t *block, int eob);
  158. void ff_iadst_idct_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
  159. int16_t *block, int eob);
  160. void ff_iadst_idct_8x8_add_msa(uint8_t *dst, ptrdiff_t stride,
  161. int16_t *block, int eob);
  162. void ff_iadst_idct_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
  163. int16_t *block, int eob);
  164. void ff_idct_iadst_4x4_add_msa(uint8_t *pu8Dest, ptrdiff_t stride,
  165. int16_t *block, int eob);
  166. void ff_idct_iadst_8x8_add_msa(uint8_t *pu8Dest, ptrdiff_t stride,
  167. int16_t *block, int eob);
  168. void ff_idct_iadst_16x16_add_msa(uint8_t *pu8Dest, ptrdiff_t stride,
  169. int16_t *block, int eob);
  170. void ff_iwht_iwht_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
  171. int16_t *block, int eob);
  172. void ff_vert_16x16_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  173. const uint8_t *top);
  174. void ff_vert_32x32_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  175. const uint8_t *top);
  176. void ff_hor_16x16_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  177. const uint8_t *top);
  178. void ff_hor_32x32_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  179. const uint8_t *top);
  180. void ff_dc_4x4_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  181. const uint8_t *top);
  182. void ff_dc_8x8_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  183. const uint8_t *top);
  184. void ff_dc_16x16_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  185. const uint8_t *top);
  186. void ff_dc_32x32_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  187. const uint8_t *top);
  188. void ff_dc_left_4x4_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  189. const uint8_t *top);
  190. void ff_dc_left_8x8_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  191. const uint8_t *top);
  192. void ff_dc_left_16x16_msa(uint8_t *dst, ptrdiff_t stride,
  193. const uint8_t *left, const uint8_t *top);
  194. void ff_dc_left_32x32_msa(uint8_t *dst, ptrdiff_t stride,
  195. const uint8_t *left, const uint8_t *top);
  196. void ff_dc_top_4x4_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  197. const uint8_t *top);
  198. void ff_dc_top_8x8_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  199. const uint8_t *top);
  200. void ff_dc_top_16x16_msa(uint8_t *dst, ptrdiff_t stride,
  201. const uint8_t *left, const uint8_t *top);
  202. void ff_dc_top_32x32_msa(uint8_t *dst, ptrdiff_t stride,
  203. const uint8_t *left, const uint8_t *top);
  204. void ff_dc_128_16x16_msa(uint8_t *dst, ptrdiff_t stride,
  205. const uint8_t *left, const uint8_t *top);
  206. void ff_dc_128_32x32_msa(uint8_t *dst, ptrdiff_t stride,
  207. const uint8_t *left, const uint8_t *top);
  208. void ff_dc_127_16x16_msa(uint8_t *dst, ptrdiff_t stride,
  209. const uint8_t *left, const uint8_t *top);
  210. void ff_dc_127_32x32_msa(uint8_t *dst, ptrdiff_t stride,
  211. const uint8_t *left, const uint8_t *top);
  212. void ff_dc_129_16x16_msa(uint8_t *dst, ptrdiff_t stride,
  213. const uint8_t *left, const uint8_t *top);
  214. void ff_dc_129_32x32_msa(uint8_t *dst, ptrdiff_t stride,
  215. const uint8_t *left, const uint8_t *top);
  216. void ff_tm_4x4_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  217. const uint8_t *top);
  218. void ff_tm_8x8_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  219. const uint8_t *top);
  220. void ff_tm_16x16_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  221. const uint8_t *top);
  222. void ff_tm_32x32_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
  223. const uint8_t *top);
  224. #define VP9_8TAP_MIPS_MMI_FUNC(SIZE, type, type_idx) \
  225. void ff_put_8tap_##type##_##SIZE##h_mmi(uint8_t *dst, ptrdiff_t dststride, \
  226. const uint8_t *src, \
  227. ptrdiff_t srcstride, \
  228. int h, int mx, int my); \
  229. \
  230. void ff_put_8tap_##type##_##SIZE##v_mmi(uint8_t *dst, ptrdiff_t dststride, \
  231. const uint8_t *src, \
  232. ptrdiff_t srcstride, \
  233. int h, int mx, int my); \
  234. \
  235. void ff_put_8tap_##type##_##SIZE##hv_mmi(uint8_t *dst, ptrdiff_t dststride, \
  236. const uint8_t *src, \
  237. ptrdiff_t srcstride, \
  238. int h, int mx, int my); \
  239. \
  240. void ff_avg_8tap_##type##_##SIZE##h_mmi(uint8_t *dst, ptrdiff_t dststride, \
  241. const uint8_t *src, \
  242. ptrdiff_t srcstride, \
  243. int h, int mx, int my); \
  244. \
  245. void ff_avg_8tap_##type##_##SIZE##v_mmi(uint8_t *dst, ptrdiff_t dststride, \
  246. const uint8_t *src, \
  247. ptrdiff_t srcstride, \
  248. int h, int mx, int my); \
  249. \
  250. void ff_avg_8tap_##type##_##SIZE##hv_mmi(uint8_t *dst, ptrdiff_t dststride, \
  251. const uint8_t *src, \
  252. ptrdiff_t srcstride, \
  253. int h, int mx, int my);
  254. VP9_8TAP_MIPS_MMI_FUNC(64, regular, FILTER_8TAP_REGULAR);
  255. VP9_8TAP_MIPS_MMI_FUNC(32, regular, FILTER_8TAP_REGULAR);
  256. VP9_8TAP_MIPS_MMI_FUNC(16, regular, FILTER_8TAP_REGULAR);
  257. VP9_8TAP_MIPS_MMI_FUNC(8, regular, FILTER_8TAP_REGULAR);
  258. VP9_8TAP_MIPS_MMI_FUNC(4, regular, FILTER_8TAP_REGULAR);
  259. VP9_8TAP_MIPS_MMI_FUNC(64, sharp, FILTER_8TAP_SHARP);
  260. VP9_8TAP_MIPS_MMI_FUNC(32, sharp, FILTER_8TAP_SHARP);
  261. VP9_8TAP_MIPS_MMI_FUNC(16, sharp, FILTER_8TAP_SHARP);
  262. VP9_8TAP_MIPS_MMI_FUNC(8, sharp, FILTER_8TAP_SHARP);
  263. VP9_8TAP_MIPS_MMI_FUNC(4, sharp, FILTER_8TAP_SHARP);
  264. VP9_8TAP_MIPS_MMI_FUNC(64, smooth, FILTER_8TAP_SMOOTH);
  265. VP9_8TAP_MIPS_MMI_FUNC(32, smooth, FILTER_8TAP_SMOOTH);
  266. VP9_8TAP_MIPS_MMI_FUNC(16, smooth, FILTER_8TAP_SMOOTH);
  267. VP9_8TAP_MIPS_MMI_FUNC(8, smooth, FILTER_8TAP_SMOOTH);
  268. VP9_8TAP_MIPS_MMI_FUNC(4, smooth, FILTER_8TAP_SMOOTH);
  269. #undef VP9_8TAP_MIPS_MMI_FUNC
  270. #endif // #ifndef AVCODEC_MIPS_VP9DSP_MIPS_H