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.

450 lines
21KB

  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_mmx2 (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_mmx2 (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_mmx2 (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_mmx2 (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_mmx2 (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_mmx2 (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. #if ARCH_X86_32
  131. TAP_W8 (mmx2, epel, h4)
  132. TAP_W8 (mmx2, epel, h6)
  133. TAP_W16(mmx2, epel, h6)
  134. TAP_W8 (mmx2, epel, v4)
  135. TAP_W8 (mmx2, epel, v6)
  136. TAP_W16(mmx2, epel, v6)
  137. TAP_W8 (mmx2, bilinear, h)
  138. TAP_W16(mmx2, bilinear, h)
  139. TAP_W8 (mmx2, bilinear, v)
  140. TAP_W16(mmx2, bilinear, v)
  141. #endif
  142. TAP_W16(sse2, epel, h6)
  143. TAP_W16(sse2, epel, v6)
  144. TAP_W16(sse2, bilinear, h)
  145. TAP_W16(sse2, bilinear, v)
  146. TAP_W16(ssse3, epel, h6)
  147. TAP_W16(ssse3, epel, v6)
  148. TAP_W16(ssse3, bilinear, h)
  149. TAP_W16(ssse3, bilinear, v)
  150. #define HVTAP(OPT, ALIGN, TAPNUMX, TAPNUMY, SIZE, MAXHEIGHT) \
  151. static void ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## v ## TAPNUMY ## _ ## OPT( \
  152. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  153. ptrdiff_t srcstride, int height, int mx, int my) \
  154. { \
  155. DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + TAPNUMY - 1)]; \
  156. uint8_t *tmpptr = tmp + SIZE * (TAPNUMY / 2 - 1); \
  157. src -= srcstride * (TAPNUMY / 2 - 1); \
  158. ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## _ ## OPT( \
  159. tmp, SIZE, src, srcstride, height + TAPNUMY - 1, mx, my); \
  160. ff_put_vp8_epel ## SIZE ## _v ## TAPNUMY ## _ ## OPT( \
  161. dst, dststride, tmpptr, SIZE, height, mx, my); \
  162. }
  163. #if ARCH_X86_32
  164. #define HVTAPMMX(x, y) \
  165. HVTAP(mmx2, 8, x, y, 4, 8) \
  166. HVTAP(mmx2, 8, x, y, 8, 16)
  167. HVTAP(mmx2, 8, 6, 6, 16, 16)
  168. #else
  169. #define HVTAPMMX(x, y) \
  170. HVTAP(mmx2, 8, x, y, 4, 8)
  171. #endif
  172. HVTAPMMX(4, 4)
  173. HVTAPMMX(4, 6)
  174. HVTAPMMX(6, 4)
  175. HVTAPMMX(6, 6)
  176. #define HVTAPSSE2(x, y, w) \
  177. HVTAP(sse2, 16, x, y, w, 16) \
  178. HVTAP(ssse3, 16, x, y, w, 16)
  179. HVTAPSSE2(4, 4, 8)
  180. HVTAPSSE2(4, 6, 8)
  181. HVTAPSSE2(6, 4, 8)
  182. HVTAPSSE2(6, 6, 8)
  183. HVTAPSSE2(6, 6, 16)
  184. HVTAP(ssse3, 16, 4, 4, 4, 8)
  185. HVTAP(ssse3, 16, 4, 6, 4, 8)
  186. HVTAP(ssse3, 16, 6, 4, 4, 8)
  187. HVTAP(ssse3, 16, 6, 6, 4, 8)
  188. #define HVBILIN(OPT, ALIGN, SIZE, MAXHEIGHT) \
  189. static void ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT( \
  190. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  191. ptrdiff_t srcstride, int height, int mx, int my) \
  192. { \
  193. DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + 2)]; \
  194. ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT( \
  195. tmp, SIZE, src, srcstride, height + 1, mx, my); \
  196. ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT( \
  197. dst, dststride, tmp, SIZE, height, mx, my); \
  198. }
  199. HVBILIN(mmx2, 8, 4, 8)
  200. #if ARCH_X86_32
  201. HVBILIN(mmx2, 8, 8, 16)
  202. HVBILIN(mmx2, 8, 16, 16)
  203. #endif
  204. HVBILIN(sse2, 8, 8, 16)
  205. HVBILIN(sse2, 8, 16, 16)
  206. HVBILIN(ssse3, 8, 4, 8)
  207. HVBILIN(ssse3, 8, 8, 16)
  208. HVBILIN(ssse3, 8, 16, 16)
  209. extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, DCTELEM block[16],
  210. ptrdiff_t stride);
  211. extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, DCTELEM block[16],
  212. ptrdiff_t stride);
  213. extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, DCTELEM block[4][16],
  214. ptrdiff_t stride);
  215. extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, DCTELEM block[4][16],
  216. ptrdiff_t stride);
  217. extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, DCTELEM block[2][16],
  218. ptrdiff_t stride);
  219. extern void ff_vp8_luma_dc_wht_mmx(DCTELEM block[4][4][16], DCTELEM dc[16]);
  220. extern void ff_vp8_luma_dc_wht_sse(DCTELEM block[4][4][16], DCTELEM dc[16]);
  221. extern void ff_vp8_idct_add_mmx(uint8_t *dst, DCTELEM block[16],
  222. ptrdiff_t stride);
  223. extern void ff_vp8_idct_add_sse(uint8_t *dst, DCTELEM block[16],
  224. ptrdiff_t stride);
  225. #define DECLARE_LOOP_FILTER(NAME)\
  226. extern void ff_vp8_v_loop_filter_simple_ ## NAME(uint8_t *dst, \
  227. ptrdiff_t stride, \
  228. int flim);\
  229. extern void ff_vp8_h_loop_filter_simple_ ## NAME(uint8_t *dst, \
  230. ptrdiff_t stride, \
  231. int flim);\
  232. extern void ff_vp8_v_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
  233. ptrdiff_t stride,\
  234. int e, int i, int hvt);\
  235. extern void ff_vp8_h_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
  236. ptrdiff_t stride,\
  237. int e, int i, int hvt);\
  238. extern void ff_vp8_v_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
  239. uint8_t *dstV,\
  240. ptrdiff_t s, \
  241. int e, int i, int hvt);\
  242. extern void ff_vp8_h_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
  243. uint8_t *dstV,\
  244. ptrdiff_t s, \
  245. int e, int i, int hvt);\
  246. extern void ff_vp8_v_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
  247. ptrdiff_t stride,\
  248. int e, int i, int hvt);\
  249. extern void ff_vp8_h_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
  250. ptrdiff_t stride,\
  251. int e, int i, int hvt);\
  252. extern void ff_vp8_v_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
  253. uint8_t *dstV,\
  254. ptrdiff_t s, \
  255. int e, int i, int hvt);\
  256. extern void ff_vp8_h_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
  257. uint8_t *dstV,\
  258. ptrdiff_t s, \
  259. int e, int i, int hvt);
  260. DECLARE_LOOP_FILTER(mmx)
  261. DECLARE_LOOP_FILTER(mmx2)
  262. DECLARE_LOOP_FILTER(sse2)
  263. DECLARE_LOOP_FILTER(ssse3)
  264. DECLARE_LOOP_FILTER(sse4)
  265. #endif
  266. #define VP8_LUMA_MC_FUNC(IDX, SIZE, OPT) \
  267. c->put_vp8_epel_pixels_tab[IDX][0][2] = ff_put_vp8_epel ## SIZE ## _h6_ ## OPT; \
  268. c->put_vp8_epel_pixels_tab[IDX][2][0] = ff_put_vp8_epel ## SIZE ## _v6_ ## OPT; \
  269. c->put_vp8_epel_pixels_tab[IDX][2][2] = ff_put_vp8_epel ## SIZE ## _h6v6_ ## OPT
  270. #define VP8_MC_FUNC(IDX, SIZE, OPT) \
  271. c->put_vp8_epel_pixels_tab[IDX][0][1] = ff_put_vp8_epel ## SIZE ## _h4_ ## OPT; \
  272. c->put_vp8_epel_pixels_tab[IDX][1][0] = ff_put_vp8_epel ## SIZE ## _v4_ ## OPT; \
  273. c->put_vp8_epel_pixels_tab[IDX][1][1] = ff_put_vp8_epel ## SIZE ## _h4v4_ ## OPT; \
  274. c->put_vp8_epel_pixels_tab[IDX][1][2] = ff_put_vp8_epel ## SIZE ## _h6v4_ ## OPT; \
  275. c->put_vp8_epel_pixels_tab[IDX][2][1] = ff_put_vp8_epel ## SIZE ## _h4v6_ ## OPT; \
  276. VP8_LUMA_MC_FUNC(IDX, SIZE, OPT)
  277. #define VP8_BILINEAR_MC_FUNC(IDX, SIZE, OPT) \
  278. c->put_vp8_bilinear_pixels_tab[IDX][0][1] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
  279. c->put_vp8_bilinear_pixels_tab[IDX][0][2] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
  280. c->put_vp8_bilinear_pixels_tab[IDX][1][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
  281. c->put_vp8_bilinear_pixels_tab[IDX][1][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  282. c->put_vp8_bilinear_pixels_tab[IDX][1][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  283. c->put_vp8_bilinear_pixels_tab[IDX][2][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
  284. c->put_vp8_bilinear_pixels_tab[IDX][2][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  285. c->put_vp8_bilinear_pixels_tab[IDX][2][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT
  286. av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
  287. {
  288. #if HAVE_YASM
  289. int mm_flags = av_get_cpu_flags();
  290. if (mm_flags & AV_CPU_FLAG_MMX) {
  291. c->vp8_idct_dc_add = ff_vp8_idct_dc_add_mmx;
  292. c->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmx;
  293. #if ARCH_X86_32
  294. c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_mmx;
  295. c->vp8_idct_add = ff_vp8_idct_add_mmx;
  296. c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_mmx;
  297. c->put_vp8_epel_pixels_tab[0][0][0] =
  298. c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmx;
  299. #endif
  300. c->put_vp8_epel_pixels_tab[1][0][0] =
  301. c->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmx;
  302. #if ARCH_X86_32
  303. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx;
  304. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx;
  305. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx;
  306. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx;
  307. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx;
  308. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx;
  309. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmx;
  310. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmx;
  311. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmx;
  312. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmx;
  313. #endif
  314. }
  315. /* note that 4-tap width=16 functions are missing because w=16
  316. * is only used for luma, and luma is always a copy or sixtap. */
  317. if (mm_flags & AV_CPU_FLAG_MMX2) {
  318. VP8_MC_FUNC(2, 4, mmx2);
  319. VP8_BILINEAR_MC_FUNC(2, 4, mmx2);
  320. #if ARCH_X86_32
  321. VP8_LUMA_MC_FUNC(0, 16, mmx2);
  322. VP8_MC_FUNC(1, 8, mmx2);
  323. VP8_BILINEAR_MC_FUNC(0, 16, mmx2);
  324. VP8_BILINEAR_MC_FUNC(1, 8, mmx2);
  325. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx2;
  326. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx2;
  327. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx2;
  328. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx2;
  329. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx2;
  330. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx2;
  331. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmx2;
  332. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmx2;
  333. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmx2;
  334. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmx2;
  335. #endif
  336. }
  337. if (mm_flags & AV_CPU_FLAG_SSE) {
  338. c->vp8_idct_add = ff_vp8_idct_add_sse;
  339. c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_sse;
  340. c->put_vp8_epel_pixels_tab[0][0][0] =
  341. c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse;
  342. }
  343. if (mm_flags & (AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW)) {
  344. VP8_LUMA_MC_FUNC(0, 16, sse2);
  345. VP8_MC_FUNC(1, 8, sse2);
  346. VP8_BILINEAR_MC_FUNC(0, 16, sse2);
  347. VP8_BILINEAR_MC_FUNC(1, 8, sse2);
  348. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_sse2;
  349. #if ARCH_X86_64 || HAVE_ALIGNED_STACK
  350. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2;
  351. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_sse2;
  352. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_sse2;
  353. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_sse2;
  354. #endif
  355. }
  356. if (mm_flags & AV_CPU_FLAG_SSE2) {
  357. c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_sse2;
  358. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2;
  359. #if ARCH_X86_64 || HAVE_ALIGNED_STACK
  360. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_sse2;
  361. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_sse2;
  362. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse2;
  363. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse2;
  364. #endif
  365. }
  366. if (mm_flags & AV_CPU_FLAG_SSSE3) {
  367. VP8_LUMA_MC_FUNC(0, 16, ssse3);
  368. VP8_MC_FUNC(1, 8, ssse3);
  369. VP8_MC_FUNC(2, 4, ssse3);
  370. VP8_BILINEAR_MC_FUNC(0, 16, ssse3);
  371. VP8_BILINEAR_MC_FUNC(1, 8, ssse3);
  372. VP8_BILINEAR_MC_FUNC(2, 4, ssse3);
  373. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_ssse3;
  374. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_ssse3;
  375. #if ARCH_X86_64 || HAVE_ALIGNED_STACK
  376. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_ssse3;
  377. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_ssse3;
  378. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_ssse3;
  379. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_ssse3;
  380. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_ssse3;
  381. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_ssse3;
  382. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_ssse3;
  383. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_ssse3;
  384. #endif
  385. }
  386. if (mm_flags & AV_CPU_FLAG_SSE4) {
  387. c->vp8_idct_dc_add = ff_vp8_idct_dc_add_sse4;
  388. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse4;
  389. #if ARCH_X86_64 || HAVE_ALIGNED_STACK
  390. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse4;
  391. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse4;
  392. #endif
  393. }
  394. #endif
  395. }