You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

426 lines
20KB

  1. /*
  2. * VP8 DSP functions x86-optimized
  3. * Copyright (c) 2010 Ronald S. Bultje <rsbultje@gmail.com>
  4. * Copyright (c) 2010 Jason Garrett-Glaser <darkshikari@gmail.com>
  5. *
  6. * This file is part of Libav.
  7. *
  8. * Libav is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * Libav is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with Libav; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #include "libavutil/cpu.h"
  23. #include "libavutil/x86_cpu.h"
  24. #include "libavcodec/vp8dsp.h"
  25. #if HAVE_YASM
  26. /*
  27. * MC functions
  28. */
  29. extern void ff_put_vp8_epel4_h4_mmxext(uint8_t *dst, ptrdiff_t dststride,
  30. uint8_t *src, ptrdiff_t srcstride,
  31. int height, int mx, int my);
  32. extern void ff_put_vp8_epel4_h6_mmxext(uint8_t *dst, ptrdiff_t dststride,
  33. uint8_t *src, ptrdiff_t srcstride,
  34. int height, int mx, int my);
  35. extern void ff_put_vp8_epel4_v4_mmxext(uint8_t *dst, ptrdiff_t dststride,
  36. uint8_t *src, ptrdiff_t srcstride,
  37. int height, int mx, int my);
  38. extern void ff_put_vp8_epel4_v6_mmxext(uint8_t *dst, ptrdiff_t dststride,
  39. uint8_t *src, ptrdiff_t srcstride,
  40. int height, int mx, int my);
  41. extern void ff_put_vp8_epel8_h4_sse2 (uint8_t *dst, ptrdiff_t dststride,
  42. uint8_t *src, ptrdiff_t srcstride,
  43. int height, int mx, int my);
  44. extern void ff_put_vp8_epel8_h6_sse2 (uint8_t *dst, ptrdiff_t dststride,
  45. uint8_t *src, ptrdiff_t srcstride,
  46. int height, int mx, int my);
  47. extern void ff_put_vp8_epel8_v4_sse2 (uint8_t *dst, ptrdiff_t dststride,
  48. uint8_t *src, ptrdiff_t srcstride,
  49. int height, int mx, int my);
  50. extern void ff_put_vp8_epel8_v6_sse2 (uint8_t *dst, ptrdiff_t dststride,
  51. uint8_t *src, ptrdiff_t srcstride,
  52. int height, int mx, int my);
  53. extern void ff_put_vp8_epel4_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  54. uint8_t *src, ptrdiff_t srcstride,
  55. int height, int mx, int my);
  56. extern void ff_put_vp8_epel4_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  57. uint8_t *src, ptrdiff_t srcstride,
  58. int height, int mx, int my);
  59. extern void ff_put_vp8_epel4_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  60. uint8_t *src, ptrdiff_t srcstride,
  61. int height, int mx, int my);
  62. extern void ff_put_vp8_epel4_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  63. uint8_t *src, ptrdiff_t srcstride,
  64. int height, int mx, int my);
  65. extern void ff_put_vp8_epel8_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  66. uint8_t *src, ptrdiff_t srcstride,
  67. int height, int mx, int my);
  68. extern void ff_put_vp8_epel8_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  69. uint8_t *src, ptrdiff_t srcstride,
  70. int height, int mx, int my);
  71. extern void ff_put_vp8_epel8_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  72. uint8_t *src, ptrdiff_t srcstride,
  73. int height, int mx, int my);
  74. extern void ff_put_vp8_epel8_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  75. uint8_t *src, ptrdiff_t srcstride,
  76. int height, int mx, int my);
  77. extern void ff_put_vp8_bilinear4_h_mmxext(uint8_t *dst, ptrdiff_t dststride,
  78. uint8_t *src, ptrdiff_t srcstride,
  79. int height, int mx, int my);
  80. extern void ff_put_vp8_bilinear8_h_sse2 (uint8_t *dst, ptrdiff_t dststride,
  81. uint8_t *src, ptrdiff_t srcstride,
  82. int height, int mx, int my);
  83. extern void ff_put_vp8_bilinear4_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  84. uint8_t *src, ptrdiff_t srcstride,
  85. int height, int mx, int my);
  86. extern void ff_put_vp8_bilinear8_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  87. uint8_t *src, ptrdiff_t srcstride,
  88. int height, int mx, int my);
  89. extern void ff_put_vp8_bilinear4_v_mmxext(uint8_t *dst, ptrdiff_t dststride,
  90. uint8_t *src, ptrdiff_t srcstride,
  91. int height, int mx, int my);
  92. extern void ff_put_vp8_bilinear8_v_sse2 (uint8_t *dst, ptrdiff_t dststride,
  93. uint8_t *src, ptrdiff_t srcstride,
  94. int height, int mx, int my);
  95. extern void ff_put_vp8_bilinear4_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  96. uint8_t *src, ptrdiff_t srcstride,
  97. int height, int mx, int my);
  98. extern void ff_put_vp8_bilinear8_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  99. uint8_t *src, ptrdiff_t srcstride,
  100. int height, int mx, int my);
  101. extern void ff_put_vp8_pixels8_mmx (uint8_t *dst, ptrdiff_t dststride,
  102. uint8_t *src, ptrdiff_t srcstride,
  103. int height, int mx, int my);
  104. extern void ff_put_vp8_pixels16_mmx(uint8_t *dst, ptrdiff_t dststride,
  105. uint8_t *src, ptrdiff_t srcstride,
  106. int height, int mx, int my);
  107. extern void ff_put_vp8_pixels16_sse(uint8_t *dst, ptrdiff_t dststride,
  108. uint8_t *src, ptrdiff_t srcstride,
  109. int height, int mx, int my);
  110. #define TAP_W16(OPT, FILTERTYPE, TAPTYPE) \
  111. static void ff_put_vp8_ ## FILTERTYPE ## 16_ ## TAPTYPE ## _ ## OPT( \
  112. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  113. ptrdiff_t srcstride, int height, int mx, int my) \
  114. { \
  115. ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
  116. dst, dststride, src, srcstride, height, mx, my); \
  117. ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
  118. dst + 8, dststride, src + 8, srcstride, height, mx, my); \
  119. }
  120. #define TAP_W8(OPT, FILTERTYPE, TAPTYPE) \
  121. static void ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
  122. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  123. ptrdiff_t srcstride, int height, int mx, int my) \
  124. { \
  125. ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
  126. dst, dststride, src, srcstride, height, mx, my); \
  127. ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
  128. dst + 4, dststride, src + 4, srcstride, height, mx, my); \
  129. }
  130. TAP_W8 (mmxext, epel, h4)
  131. TAP_W8 (mmxext, epel, h6)
  132. TAP_W16(mmxext, epel, h6)
  133. TAP_W8 (mmxext, epel, v4)
  134. TAP_W8 (mmxext, epel, v6)
  135. TAP_W16(mmxext, epel, v6)
  136. TAP_W8 (mmxext, bilinear, h)
  137. TAP_W16(mmxext, bilinear, h)
  138. TAP_W8 (mmxext, bilinear, v)
  139. TAP_W16(mmxext, bilinear, v)
  140. TAP_W16(sse2, epel, h6)
  141. TAP_W16(sse2, epel, v6)
  142. TAP_W16(sse2, bilinear, h)
  143. TAP_W16(sse2, bilinear, v)
  144. TAP_W16(ssse3, epel, h6)
  145. TAP_W16(ssse3, epel, v6)
  146. TAP_W16(ssse3, bilinear, h)
  147. TAP_W16(ssse3, bilinear, v)
  148. #define HVTAP(OPT, ALIGN, TAPNUMX, TAPNUMY, SIZE, MAXHEIGHT) \
  149. static void ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## v ## TAPNUMY ## _ ## OPT( \
  150. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  151. ptrdiff_t srcstride, int height, int mx, int my) \
  152. { \
  153. DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + TAPNUMY - 1)]; \
  154. uint8_t *tmpptr = tmp + SIZE * (TAPNUMY / 2 - 1); \
  155. src -= srcstride * (TAPNUMY / 2 - 1); \
  156. ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## _ ## OPT( \
  157. tmp, SIZE, src, srcstride, height + TAPNUMY - 1, mx, my); \
  158. ff_put_vp8_epel ## SIZE ## _v ## TAPNUMY ## _ ## OPT( \
  159. dst, dststride, tmpptr, SIZE, height, mx, my); \
  160. }
  161. #define HVTAPMMX(x, y) \
  162. HVTAP(mmxext, 8, x, y, 4, 8) \
  163. HVTAP(mmxext, 8, x, y, 8, 16)
  164. HVTAPMMX(4, 4)
  165. HVTAPMMX(4, 6)
  166. HVTAPMMX(6, 4)
  167. HVTAPMMX(6, 6)
  168. HVTAP(mmxext, 8, 6, 6, 16, 16)
  169. #define HVTAPSSE2(x, y, w) \
  170. HVTAP(sse2, 16, x, y, w, 16) \
  171. HVTAP(ssse3, 16, x, y, w, 16)
  172. HVTAPSSE2(4, 4, 8)
  173. HVTAPSSE2(4, 6, 8)
  174. HVTAPSSE2(6, 4, 8)
  175. HVTAPSSE2(6, 6, 8)
  176. HVTAPSSE2(6, 6, 16)
  177. HVTAP(ssse3, 16, 4, 4, 4, 8)
  178. HVTAP(ssse3, 16, 4, 6, 4, 8)
  179. HVTAP(ssse3, 16, 6, 4, 4, 8)
  180. HVTAP(ssse3, 16, 6, 6, 4, 8)
  181. #define HVBILIN(OPT, ALIGN, SIZE, MAXHEIGHT) \
  182. static void ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT( \
  183. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  184. ptrdiff_t srcstride, int height, int mx, int my) \
  185. { \
  186. DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + 2)]; \
  187. ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT( \
  188. tmp, SIZE, src, srcstride, height + 1, mx, my); \
  189. ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT( \
  190. dst, dststride, tmp, SIZE, height, mx, my); \
  191. }
  192. HVBILIN(mmxext, 8, 4, 8)
  193. HVBILIN(mmxext, 8, 8, 16)
  194. HVBILIN(mmxext, 8, 16, 16)
  195. HVBILIN(sse2, 8, 8, 16)
  196. HVBILIN(sse2, 8, 16, 16)
  197. HVBILIN(ssse3, 8, 4, 8)
  198. HVBILIN(ssse3, 8, 8, 16)
  199. HVBILIN(ssse3, 8, 16, 16)
  200. extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, DCTELEM block[16],
  201. ptrdiff_t stride);
  202. extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, DCTELEM block[16],
  203. ptrdiff_t stride);
  204. extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, DCTELEM block[4][16],
  205. ptrdiff_t stride);
  206. extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, DCTELEM block[4][16],
  207. ptrdiff_t stride);
  208. extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, DCTELEM block[2][16],
  209. ptrdiff_t stride);
  210. extern void ff_vp8_luma_dc_wht_mmx(DCTELEM block[4][4][16], DCTELEM dc[16]);
  211. extern void ff_vp8_luma_dc_wht_sse(DCTELEM block[4][4][16], DCTELEM dc[16]);
  212. extern void ff_vp8_idct_add_mmx(uint8_t *dst, DCTELEM block[16],
  213. ptrdiff_t stride);
  214. extern void ff_vp8_idct_add_sse(uint8_t *dst, DCTELEM block[16],
  215. ptrdiff_t stride);
  216. #define DECLARE_LOOP_FILTER(NAME)\
  217. extern void ff_vp8_v_loop_filter_simple_ ## NAME(uint8_t *dst, \
  218. ptrdiff_t stride, \
  219. int flim);\
  220. extern void ff_vp8_h_loop_filter_simple_ ## NAME(uint8_t *dst, \
  221. ptrdiff_t stride, \
  222. int flim);\
  223. extern void ff_vp8_v_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
  224. ptrdiff_t stride,\
  225. int e, int i, int hvt);\
  226. extern void ff_vp8_h_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
  227. ptrdiff_t stride,\
  228. int e, int i, int hvt);\
  229. extern void ff_vp8_v_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
  230. uint8_t *dstV,\
  231. ptrdiff_t s, \
  232. int e, int i, int hvt);\
  233. extern void ff_vp8_h_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
  234. uint8_t *dstV,\
  235. ptrdiff_t s, \
  236. int e, int i, int hvt);\
  237. extern void ff_vp8_v_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
  238. ptrdiff_t stride,\
  239. int e, int i, int hvt);\
  240. extern void ff_vp8_h_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
  241. ptrdiff_t stride,\
  242. int e, int i, int hvt);\
  243. extern void ff_vp8_v_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
  244. uint8_t *dstV,\
  245. ptrdiff_t s, \
  246. int e, int i, int hvt);\
  247. extern void ff_vp8_h_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
  248. uint8_t *dstV,\
  249. ptrdiff_t s, \
  250. int e, int i, int hvt);
  251. DECLARE_LOOP_FILTER(mmx)
  252. DECLARE_LOOP_FILTER(mmxext)
  253. DECLARE_LOOP_FILTER(sse2)
  254. DECLARE_LOOP_FILTER(ssse3)
  255. DECLARE_LOOP_FILTER(sse4)
  256. #endif
  257. #define VP8_LUMA_MC_FUNC(IDX, SIZE, OPT) \
  258. c->put_vp8_epel_pixels_tab[IDX][0][2] = ff_put_vp8_epel ## SIZE ## _h6_ ## OPT; \
  259. c->put_vp8_epel_pixels_tab[IDX][2][0] = ff_put_vp8_epel ## SIZE ## _v6_ ## OPT; \
  260. c->put_vp8_epel_pixels_tab[IDX][2][2] = ff_put_vp8_epel ## SIZE ## _h6v6_ ## OPT
  261. #define VP8_MC_FUNC(IDX, SIZE, OPT) \
  262. c->put_vp8_epel_pixels_tab[IDX][0][1] = ff_put_vp8_epel ## SIZE ## _h4_ ## OPT; \
  263. c->put_vp8_epel_pixels_tab[IDX][1][0] = ff_put_vp8_epel ## SIZE ## _v4_ ## OPT; \
  264. c->put_vp8_epel_pixels_tab[IDX][1][1] = ff_put_vp8_epel ## SIZE ## _h4v4_ ## OPT; \
  265. c->put_vp8_epel_pixels_tab[IDX][1][2] = ff_put_vp8_epel ## SIZE ## _h6v4_ ## OPT; \
  266. c->put_vp8_epel_pixels_tab[IDX][2][1] = ff_put_vp8_epel ## SIZE ## _h4v6_ ## OPT; \
  267. VP8_LUMA_MC_FUNC(IDX, SIZE, OPT)
  268. #define VP8_BILINEAR_MC_FUNC(IDX, SIZE, OPT) \
  269. c->put_vp8_bilinear_pixels_tab[IDX][0][1] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
  270. c->put_vp8_bilinear_pixels_tab[IDX][0][2] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
  271. c->put_vp8_bilinear_pixels_tab[IDX][1][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
  272. c->put_vp8_bilinear_pixels_tab[IDX][1][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  273. c->put_vp8_bilinear_pixels_tab[IDX][1][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  274. c->put_vp8_bilinear_pixels_tab[IDX][2][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
  275. c->put_vp8_bilinear_pixels_tab[IDX][2][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  276. c->put_vp8_bilinear_pixels_tab[IDX][2][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT
  277. av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
  278. {
  279. #if HAVE_YASM
  280. int mm_flags = av_get_cpu_flags();
  281. if (mm_flags & AV_CPU_FLAG_MMX) {
  282. c->vp8_idct_dc_add = ff_vp8_idct_dc_add_mmx;
  283. c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_mmx;
  284. c->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmx;
  285. c->vp8_idct_add = ff_vp8_idct_add_mmx;
  286. c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_mmx;
  287. c->put_vp8_epel_pixels_tab[0][0][0] =
  288. c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmx;
  289. c->put_vp8_epel_pixels_tab[1][0][0] =
  290. c->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmx;
  291. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx;
  292. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx;
  293. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx;
  294. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx;
  295. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx;
  296. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx;
  297. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmx;
  298. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmx;
  299. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmx;
  300. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmx;
  301. }
  302. /* note that 4-tap width=16 functions are missing because w=16
  303. * is only used for luma, and luma is always a copy or sixtap. */
  304. if (mm_flags & AV_CPU_FLAG_MMX2) {
  305. VP8_LUMA_MC_FUNC(0, 16, mmxext);
  306. VP8_MC_FUNC(1, 8, mmxext);
  307. VP8_MC_FUNC(2, 4, mmxext);
  308. VP8_BILINEAR_MC_FUNC(0, 16, mmxext);
  309. VP8_BILINEAR_MC_FUNC(1, 8, mmxext);
  310. VP8_BILINEAR_MC_FUNC(2, 4, mmxext);
  311. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmxext;
  312. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmxext;
  313. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmxext;
  314. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmxext;
  315. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmxext;
  316. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmxext;
  317. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmxext;
  318. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmxext;
  319. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmxext;
  320. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmxext;
  321. }
  322. if (mm_flags & AV_CPU_FLAG_SSE) {
  323. c->vp8_idct_add = ff_vp8_idct_add_sse;
  324. c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_sse;
  325. c->put_vp8_epel_pixels_tab[0][0][0] =
  326. c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse;
  327. }
  328. if (mm_flags & (AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW)) {
  329. VP8_LUMA_MC_FUNC(0, 16, sse2);
  330. VP8_MC_FUNC(1, 8, sse2);
  331. VP8_BILINEAR_MC_FUNC(0, 16, sse2);
  332. VP8_BILINEAR_MC_FUNC(1, 8, sse2);
  333. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_sse2;
  334. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2;
  335. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_sse2;
  336. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_sse2;
  337. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_sse2;
  338. }
  339. if (mm_flags & AV_CPU_FLAG_SSE2) {
  340. c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_sse2;
  341. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2;
  342. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_sse2;
  343. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_sse2;
  344. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse2;
  345. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse2;
  346. }
  347. if (mm_flags & AV_CPU_FLAG_SSSE3) {
  348. VP8_LUMA_MC_FUNC(0, 16, ssse3);
  349. VP8_MC_FUNC(1, 8, ssse3);
  350. VP8_MC_FUNC(2, 4, ssse3);
  351. VP8_BILINEAR_MC_FUNC(0, 16, ssse3);
  352. VP8_BILINEAR_MC_FUNC(1, 8, ssse3);
  353. VP8_BILINEAR_MC_FUNC(2, 4, ssse3);
  354. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_ssse3;
  355. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_ssse3;
  356. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_ssse3;
  357. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_ssse3;
  358. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_ssse3;
  359. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_ssse3;
  360. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_ssse3;
  361. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_ssse3;
  362. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_ssse3;
  363. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_ssse3;
  364. }
  365. if (mm_flags & AV_CPU_FLAG_SSE4) {
  366. c->vp8_idct_dc_add = ff_vp8_idct_dc_add_sse4;
  367. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse4;
  368. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse4;
  369. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse4;
  370. }
  371. #endif
  372. }