vp8dsp_mips.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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. #ifndef AVCODEC_MIPS_VP8DSP_MIPS_H
  22. #define AVCODEC_MIPS_VP8DSP_MIPS_H
  23. #include "libavutil/mem.h"
  24. #include "libavcodec/vp8dsp.h"
  25. #include "libavcodec/mathops.h"
  26. #include "constants.h"
  27. void ff_put_vp8_pixels4_msa(uint8_t *dst, ptrdiff_t dststride,
  28. uint8_t *src, ptrdiff_t srcstride,
  29. int h, int x, int y);
  30. void ff_put_vp8_pixels8_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_pixels16_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_epel16_h4_msa(uint8_t *dst, ptrdiff_t dststride,
  37. uint8_t *src, ptrdiff_t srcstride,
  38. int h, int mx, int my);
  39. void ff_put_vp8_epel16_h6_msa(uint8_t *dst, ptrdiff_t dststride,
  40. uint8_t *src, ptrdiff_t srcstride,
  41. int h, int mx, int my);
  42. void ff_put_vp8_epel16_v4_msa(uint8_t *dst, ptrdiff_t dststride,
  43. uint8_t *src, ptrdiff_t srcstride,
  44. int h, int mx, int my);
  45. void ff_put_vp8_epel16_v6_msa(uint8_t *dst, ptrdiff_t dststride,
  46. uint8_t *src, ptrdiff_t srcstride,
  47. int h, int mx, int my);
  48. void ff_put_vp8_epel16_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
  49. uint8_t *src, ptrdiff_t srcstride,
  50. int h, int mx, int my);
  51. void ff_put_vp8_epel16_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
  52. uint8_t *src, ptrdiff_t srcstride,
  53. int h, int mx, int my);
  54. void ff_put_vp8_epel16_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
  55. uint8_t *src, ptrdiff_t srcstride,
  56. int h, int mx, int my);
  57. void ff_put_vp8_epel16_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
  58. uint8_t *src, ptrdiff_t srcstride,
  59. int h, int mx, int my);
  60. void ff_put_vp8_epel8_h4_msa(uint8_t *dst, ptrdiff_t dststride,
  61. uint8_t *src, ptrdiff_t srcstride,
  62. int h, int mx, int my);
  63. void ff_put_vp8_epel8_h6_msa(uint8_t *dst, ptrdiff_t dststride,
  64. uint8_t *src, ptrdiff_t srcstride,
  65. int h, int mx, int my);
  66. void ff_put_vp8_epel8_v4_msa(uint8_t *dst, ptrdiff_t dststride,
  67. uint8_t *src, ptrdiff_t srcstride,
  68. int h, int mx, int my);
  69. void ff_put_vp8_epel8_v6_msa(uint8_t *dst, ptrdiff_t dststride,
  70. uint8_t *src, ptrdiff_t srcstride,
  71. int h, int mx, int my);
  72. void ff_put_vp8_epel8_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
  73. uint8_t *src, ptrdiff_t srcstride,
  74. int h, int mx, int my);
  75. void ff_put_vp8_epel8_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
  76. uint8_t *src, ptrdiff_t srcstride,
  77. int h, int mx, int my);
  78. void ff_put_vp8_epel8_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
  79. uint8_t *src, ptrdiff_t srcstride,
  80. int h, int mx, int my);
  81. void ff_put_vp8_epel8_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
  82. uint8_t *src, ptrdiff_t srcstride,
  83. int h, int mx, int my);
  84. void ff_put_vp8_epel4_h4_msa(uint8_t *dst, ptrdiff_t dststride,
  85. uint8_t *src, ptrdiff_t srcstride,
  86. int h, int mx, int my);
  87. void ff_put_vp8_epel4_h6_msa(uint8_t *dst, ptrdiff_t dststride,
  88. uint8_t *src, ptrdiff_t srcstride,
  89. int h, int mx, int my);
  90. void ff_put_vp8_epel4_v4_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_v6_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_h4v4_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_h6v4_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_h4v6_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_h6v6_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_bilinear16_h_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_bilinear16_v_msa(uint8_t *dst, ptrdiff_t dststride,
  112. uint8_t *src, ptrdiff_t srcstride,
  113. int h, int mx, int my);
  114. void ff_put_vp8_bilinear16_hv_msa(uint8_t *dst, ptrdiff_t dststride,
  115. uint8_t *src, ptrdiff_t srcstride,
  116. int h, int mx, int my);
  117. void ff_put_vp8_bilinear8_h_msa(uint8_t *dst, ptrdiff_t dststride,
  118. uint8_t *src, ptrdiff_t srcstride,
  119. int h, int mx, int my);
  120. void ff_put_vp8_bilinear8_v_msa(uint8_t *dst, ptrdiff_t dststride,
  121. uint8_t *src, ptrdiff_t srcstride,
  122. int h, int mx, int my);
  123. void ff_put_vp8_bilinear8_hv_msa(uint8_t *dst, ptrdiff_t dststride,
  124. uint8_t *src, ptrdiff_t srcstride,
  125. int h, int mx, int my);
  126. void ff_put_vp8_bilinear4_h_msa(uint8_t *dst, ptrdiff_t dststride,
  127. uint8_t *src, ptrdiff_t srcstride,
  128. int h, int mx, int my);
  129. void ff_put_vp8_bilinear4_v_msa(uint8_t *dst, ptrdiff_t dststride,
  130. uint8_t *src, ptrdiff_t srcstride,
  131. int h, int mx, int my);
  132. void ff_put_vp8_bilinear4_hv_msa(uint8_t *dst, ptrdiff_t dststride,
  133. uint8_t *src, ptrdiff_t srcstride,
  134. int h, int mx, int my);
  135. /* loop filter */
  136. void ff_vp8_h_loop_filter16_inner_msa(uint8_t *dst, ptrdiff_t stride,
  137. int32_t e, int32_t i, int32_t h);
  138. void ff_vp8_v_loop_filter16_inner_msa(uint8_t *dst, ptrdiff_t stride,
  139. int32_t e, int32_t i, int32_t h);
  140. void ff_vp8_h_loop_filter8uv_inner_msa(uint8_t *dst_u, uint8_t *dst_v,
  141. ptrdiff_t stride,
  142. int flim_e, int flim_i, int hev_thresh);
  143. void ff_vp8_v_loop_filter8uv_inner_msa(uint8_t *dst_u, uint8_t *dst_v,
  144. ptrdiff_t stride,
  145. int flim_e, int flim_i, int hev_thresh);
  146. void ff_vp8_h_loop_filter16_msa(uint8_t *dst, ptrdiff_t stride,
  147. int flim_e, int flim_i, int hev_thresh);
  148. void ff_vp8_v_loop_filter16_msa(uint8_t *dst, ptrdiff_t stride,
  149. int flim_e, int flim_i, int hev_thresh);
  150. void ff_vp8_h_loop_filter8uv_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_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_filter_simple_msa(uint8_t *dst, ptrdiff_t stride, int flim);
  157. void ff_vp8_v_loop_filter_simple_msa(uint8_t *dst, ptrdiff_t stride, int flim);
  158. /* Idct functions */
  159. void ff_vp8_luma_dc_wht_msa(int16_t block[4][4][16], int16_t dc[16]);
  160. void ff_vp8_idct_add_msa(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
  161. void ff_vp8_idct_dc_add_msa(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
  162. void ff_vp8_idct_dc_add4uv_msa(uint8_t *dst, int16_t block[4][16],
  163. ptrdiff_t stride);
  164. void ff_vp8_idct_dc_add4y_msa(uint8_t *dst, int16_t block[4][16],
  165. ptrdiff_t stride);
  166. void ff_vp8_luma_dc_wht_mmi(int16_t block[4][4][16], int16_t dc[16]);
  167. void ff_vp8_luma_dc_wht_dc_mmi(int16_t block[4][4][16], int16_t dc[16]);
  168. void ff_vp8_idct_add_mmi(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
  169. void ff_vp8_idct_dc_add_mmi(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
  170. void ff_vp8_idct_dc_add4y_mmi(uint8_t *dst, int16_t block[4][16],
  171. ptrdiff_t stride);
  172. void ff_vp8_idct_dc_add4uv_mmi(uint8_t *dst, int16_t block[4][16],
  173. ptrdiff_t stride);
  174. void ff_put_vp8_pixels4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
  175. ptrdiff_t srcstride, int h, int x, int y);
  176. void ff_put_vp8_pixels8_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
  177. ptrdiff_t srcstride, int h, int x, int y);
  178. void ff_put_vp8_pixels16_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
  179. ptrdiff_t srcstride, int h, int x, int y);
  180. void ff_put_vp8_epel16_h4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
  181. ptrdiff_t srcstride, int h, int mx, int my);
  182. void ff_put_vp8_epel16_h6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
  183. ptrdiff_t srcstride, int h, int mx, int my);
  184. void ff_put_vp8_epel16_v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
  185. ptrdiff_t srcstride, int h, int mx, int my);
  186. void ff_put_vp8_epel16_v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
  187. ptrdiff_t srcstride, int h, int mx, int my);
  188. void ff_put_vp8_epel16_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride,
  189. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  190. void ff_put_vp8_epel16_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride,
  191. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  192. void ff_put_vp8_epel16_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride,
  193. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  194. void ff_put_vp8_epel16_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride,
  195. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  196. void ff_put_vp8_epel8_h4_mmi(uint8_t *dst, ptrdiff_t dststride,
  197. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  198. void ff_put_vp8_epel8_h6_mmi(uint8_t *dst, ptrdiff_t dststride,
  199. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  200. void ff_put_vp8_epel8_v4_mmi(uint8_t *dst, ptrdiff_t dststride,
  201. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  202. void ff_put_vp8_epel8_v6_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_epel8_h4v4_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_epel8_h6v4_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_epel8_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride,
  209. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  210. void ff_put_vp8_epel8_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride,
  211. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  212. void ff_put_vp8_epel4_h4_mmi(uint8_t *dst, ptrdiff_t dststride,
  213. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  214. void ff_put_vp8_epel4_h6_mmi(uint8_t *dst, ptrdiff_t dststride,
  215. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  216. void ff_put_vp8_epel4_v4_mmi(uint8_t *dst, ptrdiff_t dststride,
  217. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  218. void ff_put_vp8_epel4_v6_mmi(uint8_t *dst, ptrdiff_t dststride,
  219. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  220. void ff_put_vp8_epel4_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride,
  221. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  222. void ff_put_vp8_epel4_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride,
  223. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  224. void ff_put_vp8_epel4_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride,
  225. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  226. void ff_put_vp8_epel4_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride,
  227. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  228. void ff_put_vp8_bilinear16_h_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_bilinear16_v_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_bilinear16_hv_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_bilinear8_h_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_bilinear8_v_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_bilinear8_hv_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_bilinear4_h_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_bilinear4_v_mmi(uint8_t *dst, ptrdiff_t dststride,
  243. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  244. void ff_put_vp8_bilinear4_hv_mmi(uint8_t *dst, ptrdiff_t dststride,
  245. uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
  246. // loop filter applied to edges between macroblocks
  247. void ff_vp8_v_loop_filter16_mmi(uint8_t *dst, ptrdiff_t stride, int flim_E,
  248. int flim_I, int hev_thresh);
  249. void ff_vp8_h_loop_filter16_mmi(uint8_t *dst, ptrdiff_t stride, int flim_E,
  250. int flim_I, int hev_thresh);
  251. void ff_vp8_v_loop_filter8uv_mmi(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride,
  252. int flim_E, int flim_I, int hev_thresh);
  253. void ff_vp8_h_loop_filter8uv_mmi(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride,
  254. int flim_E, int flim_I, int hev_thresh);
  255. // loop filter applied to inner macroblock edges
  256. void ff_vp8_v_loop_filter16_inner_mmi(uint8_t *dst, ptrdiff_t stride,
  257. int flim_E, int flim_I, int hev_thresh);
  258. void ff_vp8_h_loop_filter16_inner_mmi(uint8_t *dst, ptrdiff_t stride,
  259. int flim_E, int flim_I, int hev_thresh);
  260. void ff_vp8_v_loop_filter8uv_inner_mmi(uint8_t *dstU, uint8_t *dstV,
  261. ptrdiff_t stride, int flim_E, int flim_I, int hev_thresh);
  262. void ff_vp8_h_loop_filter8uv_inner_mmi(uint8_t *dstU, uint8_t *dstV,
  263. ptrdiff_t stride, int flim_E, int flim_I, int hev_thresh);
  264. void ff_vp8_v_loop_filter_simple_mmi(uint8_t *dst, ptrdiff_t stride, int flim);
  265. void ff_vp8_h_loop_filter_simple_mmi(uint8_t *dst, ptrdiff_t stride, int flim);
  266. #endif // #ifndef AVCODEC_MIPS_VP8DSP_MIPS_H