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.

451 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 FFmpeg.
  7. *
  8. * FFmpeg 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. * FFmpeg 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 FFmpeg; 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/mem.h"
  24. #include "libavutil/x86/asm.h"
  25. #include "libavcodec/vp8dsp.h"
  26. #if HAVE_YASM
  27. /*
  28. * MC functions
  29. */
  30. extern void ff_put_vp8_epel4_h4_mmx2 (uint8_t *dst, ptrdiff_t dststride,
  31. uint8_t *src, ptrdiff_t srcstride,
  32. int height, int mx, int my);
  33. extern void ff_put_vp8_epel4_h6_mmx2 (uint8_t *dst, ptrdiff_t dststride,
  34. uint8_t *src, ptrdiff_t srcstride,
  35. int height, int mx, int my);
  36. extern void ff_put_vp8_epel4_v4_mmx2 (uint8_t *dst, ptrdiff_t dststride,
  37. uint8_t *src, ptrdiff_t srcstride,
  38. int height, int mx, int my);
  39. extern void ff_put_vp8_epel4_v6_mmx2 (uint8_t *dst, ptrdiff_t dststride,
  40. uint8_t *src, ptrdiff_t srcstride,
  41. int height, int mx, int my);
  42. extern void ff_put_vp8_epel8_h4_sse2 (uint8_t *dst, ptrdiff_t dststride,
  43. uint8_t *src, ptrdiff_t srcstride,
  44. int height, int mx, int my);
  45. extern void ff_put_vp8_epel8_h6_sse2 (uint8_t *dst, ptrdiff_t dststride,
  46. uint8_t *src, ptrdiff_t srcstride,
  47. int height, int mx, int my);
  48. extern void ff_put_vp8_epel8_v4_sse2 (uint8_t *dst, ptrdiff_t dststride,
  49. uint8_t *src, ptrdiff_t srcstride,
  50. int height, int mx, int my);
  51. extern void ff_put_vp8_epel8_v6_sse2 (uint8_t *dst, ptrdiff_t dststride,
  52. uint8_t *src, ptrdiff_t srcstride,
  53. int height, int mx, int my);
  54. extern void ff_put_vp8_epel4_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  55. uint8_t *src, ptrdiff_t srcstride,
  56. int height, int mx, int my);
  57. extern void ff_put_vp8_epel4_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  58. uint8_t *src, ptrdiff_t srcstride,
  59. int height, int mx, int my);
  60. extern void ff_put_vp8_epel4_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  61. uint8_t *src, ptrdiff_t srcstride,
  62. int height, int mx, int my);
  63. extern void ff_put_vp8_epel4_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  64. uint8_t *src, ptrdiff_t srcstride,
  65. int height, int mx, int my);
  66. extern void ff_put_vp8_epel8_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  67. uint8_t *src, ptrdiff_t srcstride,
  68. int height, int mx, int my);
  69. extern void ff_put_vp8_epel8_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  70. uint8_t *src, ptrdiff_t srcstride,
  71. int height, int mx, int my);
  72. extern void ff_put_vp8_epel8_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  73. uint8_t *src, ptrdiff_t srcstride,
  74. int height, int mx, int my);
  75. extern void ff_put_vp8_epel8_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  76. uint8_t *src, ptrdiff_t srcstride,
  77. int height, int mx, int my);
  78. extern void ff_put_vp8_bilinear4_h_mmx2 (uint8_t *dst, ptrdiff_t dststride,
  79. uint8_t *src, ptrdiff_t srcstride,
  80. int height, int mx, int my);
  81. extern void ff_put_vp8_bilinear8_h_sse2 (uint8_t *dst, ptrdiff_t dststride,
  82. uint8_t *src, ptrdiff_t srcstride,
  83. int height, int mx, int my);
  84. extern void ff_put_vp8_bilinear4_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  85. uint8_t *src, ptrdiff_t srcstride,
  86. int height, int mx, int my);
  87. extern void ff_put_vp8_bilinear8_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  88. uint8_t *src, ptrdiff_t srcstride,
  89. int height, int mx, int my);
  90. extern void ff_put_vp8_bilinear4_v_mmx2 (uint8_t *dst, ptrdiff_t dststride,
  91. uint8_t *src, ptrdiff_t srcstride,
  92. int height, int mx, int my);
  93. extern void ff_put_vp8_bilinear8_v_sse2 (uint8_t *dst, ptrdiff_t dststride,
  94. uint8_t *src, ptrdiff_t srcstride,
  95. int height, int mx, int my);
  96. extern void ff_put_vp8_bilinear4_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  97. uint8_t *src, ptrdiff_t srcstride,
  98. int height, int mx, int my);
  99. extern void ff_put_vp8_bilinear8_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  100. uint8_t *src, ptrdiff_t srcstride,
  101. int height, int mx, int my);
  102. extern void ff_put_vp8_pixels8_mmx (uint8_t *dst, ptrdiff_t dststride,
  103. uint8_t *src, ptrdiff_t srcstride,
  104. int height, int mx, int my);
  105. extern void ff_put_vp8_pixels16_mmx(uint8_t *dst, ptrdiff_t dststride,
  106. uint8_t *src, ptrdiff_t srcstride,
  107. int height, int mx, int my);
  108. extern void ff_put_vp8_pixels16_sse(uint8_t *dst, ptrdiff_t dststride,
  109. uint8_t *src, ptrdiff_t srcstride,
  110. int height, int mx, int my);
  111. #define TAP_W16(OPT, FILTERTYPE, TAPTYPE) \
  112. static void ff_put_vp8_ ## FILTERTYPE ## 16_ ## TAPTYPE ## _ ## OPT( \
  113. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  114. ptrdiff_t srcstride, int height, int mx, int my) \
  115. { \
  116. ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
  117. dst, dststride, src, srcstride, height, mx, my); \
  118. ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
  119. dst + 8, dststride, src + 8, srcstride, height, mx, my); \
  120. }
  121. #define TAP_W8(OPT, FILTERTYPE, TAPTYPE) \
  122. static void ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
  123. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  124. ptrdiff_t srcstride, int height, int mx, int my) \
  125. { \
  126. ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
  127. dst, dststride, src, srcstride, height, mx, my); \
  128. ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
  129. dst + 4, dststride, src + 4, srcstride, height, mx, my); \
  130. }
  131. #if ARCH_X86_32
  132. TAP_W8 (mmx2, epel, h4)
  133. TAP_W8 (mmx2, epel, h6)
  134. TAP_W16(mmx2, epel, h6)
  135. TAP_W8 (mmx2, epel, v4)
  136. TAP_W8 (mmx2, epel, v6)
  137. TAP_W16(mmx2, epel, v6)
  138. TAP_W8 (mmx2, bilinear, h)
  139. TAP_W16(mmx2, bilinear, h)
  140. TAP_W8 (mmx2, bilinear, v)
  141. TAP_W16(mmx2, bilinear, v)
  142. #endif
  143. TAP_W16(sse2, epel, h6)
  144. TAP_W16(sse2, epel, v6)
  145. TAP_W16(sse2, bilinear, h)
  146. TAP_W16(sse2, bilinear, v)
  147. TAP_W16(ssse3, epel, h6)
  148. TAP_W16(ssse3, epel, v6)
  149. TAP_W16(ssse3, bilinear, h)
  150. TAP_W16(ssse3, bilinear, v)
  151. #define HVTAP(OPT, ALIGN, TAPNUMX, TAPNUMY, SIZE, MAXHEIGHT) \
  152. static void ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## v ## TAPNUMY ## _ ## OPT( \
  153. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  154. ptrdiff_t srcstride, int height, int mx, int my) \
  155. { \
  156. DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + TAPNUMY - 1)]; \
  157. uint8_t *tmpptr = tmp + SIZE * (TAPNUMY / 2 - 1); \
  158. src -= srcstride * (TAPNUMY / 2 - 1); \
  159. ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## _ ## OPT( \
  160. tmp, SIZE, src, srcstride, height + TAPNUMY - 1, mx, my); \
  161. ff_put_vp8_epel ## SIZE ## _v ## TAPNUMY ## _ ## OPT( \
  162. dst, dststride, tmpptr, SIZE, height, mx, my); \
  163. }
  164. #if ARCH_X86_32
  165. #define HVTAPMMX(x, y) \
  166. HVTAP(mmx2, 8, x, y, 4, 8) \
  167. HVTAP(mmx2, 8, x, y, 8, 16)
  168. HVTAP(mmx2, 8, 6, 6, 16, 16)
  169. #else
  170. #define HVTAPMMX(x, y) \
  171. HVTAP(mmx2, 8, x, y, 4, 8)
  172. #endif
  173. HVTAPMMX(4, 4)
  174. HVTAPMMX(4, 6)
  175. HVTAPMMX(6, 4)
  176. HVTAPMMX(6, 6)
  177. #define HVTAPSSE2(x, y, w) \
  178. HVTAP(sse2, 16, x, y, w, 16) \
  179. HVTAP(ssse3, 16, x, y, w, 16)
  180. HVTAPSSE2(4, 4, 8)
  181. HVTAPSSE2(4, 6, 8)
  182. HVTAPSSE2(6, 4, 8)
  183. HVTAPSSE2(6, 6, 8)
  184. HVTAPSSE2(6, 6, 16)
  185. HVTAP(ssse3, 16, 4, 4, 4, 8)
  186. HVTAP(ssse3, 16, 4, 6, 4, 8)
  187. HVTAP(ssse3, 16, 6, 4, 4, 8)
  188. HVTAP(ssse3, 16, 6, 6, 4, 8)
  189. #define HVBILIN(OPT, ALIGN, SIZE, MAXHEIGHT) \
  190. static void ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT( \
  191. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  192. ptrdiff_t srcstride, int height, int mx, int my) \
  193. { \
  194. DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + 2)]; \
  195. ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT( \
  196. tmp, SIZE, src, srcstride, height + 1, mx, my); \
  197. ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT( \
  198. dst, dststride, tmp, SIZE, height, mx, my); \
  199. }
  200. HVBILIN(mmx2, 8, 4, 8)
  201. #if ARCH_X86_32
  202. HVBILIN(mmx2, 8, 8, 16)
  203. HVBILIN(mmx2, 8, 16, 16)
  204. #endif
  205. HVBILIN(sse2, 8, 8, 16)
  206. HVBILIN(sse2, 8, 16, 16)
  207. HVBILIN(ssse3, 8, 4, 8)
  208. HVBILIN(ssse3, 8, 8, 16)
  209. HVBILIN(ssse3, 8, 16, 16)
  210. extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, DCTELEM block[16],
  211. ptrdiff_t stride);
  212. extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, DCTELEM block[16],
  213. ptrdiff_t stride);
  214. extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, DCTELEM block[4][16],
  215. ptrdiff_t stride);
  216. extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, DCTELEM block[4][16],
  217. ptrdiff_t stride);
  218. extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, DCTELEM block[2][16],
  219. ptrdiff_t stride);
  220. extern void ff_vp8_luma_dc_wht_mmx(DCTELEM block[4][4][16], DCTELEM dc[16]);
  221. extern void ff_vp8_luma_dc_wht_sse(DCTELEM block[4][4][16], DCTELEM dc[16]);
  222. extern void ff_vp8_idct_add_mmx(uint8_t *dst, DCTELEM block[16],
  223. ptrdiff_t stride);
  224. extern void ff_vp8_idct_add_sse(uint8_t *dst, DCTELEM block[16],
  225. ptrdiff_t stride);
  226. #define DECLARE_LOOP_FILTER(NAME)\
  227. extern void ff_vp8_v_loop_filter_simple_ ## NAME(uint8_t *dst, \
  228. ptrdiff_t stride, \
  229. int flim);\
  230. extern void ff_vp8_h_loop_filter_simple_ ## NAME(uint8_t *dst, \
  231. ptrdiff_t stride, \
  232. int flim);\
  233. extern void ff_vp8_v_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
  234. ptrdiff_t stride,\
  235. int e, int i, int hvt);\
  236. extern void ff_vp8_h_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
  237. ptrdiff_t stride,\
  238. int e, int i, int hvt);\
  239. extern void ff_vp8_v_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
  240. uint8_t *dstV,\
  241. ptrdiff_t s, \
  242. int e, int i, int hvt);\
  243. extern void ff_vp8_h_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
  244. uint8_t *dstV,\
  245. ptrdiff_t s, \
  246. int e, int i, int hvt);\
  247. extern void ff_vp8_v_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
  248. ptrdiff_t stride,\
  249. int e, int i, int hvt);\
  250. extern void ff_vp8_h_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
  251. ptrdiff_t stride,\
  252. int e, int i, int hvt);\
  253. extern void ff_vp8_v_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
  254. uint8_t *dstV,\
  255. ptrdiff_t s, \
  256. int e, int i, int hvt);\
  257. extern void ff_vp8_h_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
  258. uint8_t *dstV,\
  259. ptrdiff_t s, \
  260. int e, int i, int hvt);
  261. DECLARE_LOOP_FILTER(mmx)
  262. DECLARE_LOOP_FILTER(mmx2)
  263. DECLARE_LOOP_FILTER(sse2)
  264. DECLARE_LOOP_FILTER(ssse3)
  265. DECLARE_LOOP_FILTER(sse4)
  266. #endif
  267. #define VP8_LUMA_MC_FUNC(IDX, SIZE, OPT) \
  268. c->put_vp8_epel_pixels_tab[IDX][0][2] = ff_put_vp8_epel ## SIZE ## _h6_ ## OPT; \
  269. c->put_vp8_epel_pixels_tab[IDX][2][0] = ff_put_vp8_epel ## SIZE ## _v6_ ## OPT; \
  270. c->put_vp8_epel_pixels_tab[IDX][2][2] = ff_put_vp8_epel ## SIZE ## _h6v6_ ## OPT
  271. #define VP8_MC_FUNC(IDX, SIZE, OPT) \
  272. c->put_vp8_epel_pixels_tab[IDX][0][1] = ff_put_vp8_epel ## SIZE ## _h4_ ## OPT; \
  273. c->put_vp8_epel_pixels_tab[IDX][1][0] = ff_put_vp8_epel ## SIZE ## _v4_ ## OPT; \
  274. c->put_vp8_epel_pixels_tab[IDX][1][1] = ff_put_vp8_epel ## SIZE ## _h4v4_ ## OPT; \
  275. c->put_vp8_epel_pixels_tab[IDX][1][2] = ff_put_vp8_epel ## SIZE ## _h6v4_ ## OPT; \
  276. c->put_vp8_epel_pixels_tab[IDX][2][1] = ff_put_vp8_epel ## SIZE ## _h4v6_ ## OPT; \
  277. VP8_LUMA_MC_FUNC(IDX, SIZE, OPT)
  278. #define VP8_BILINEAR_MC_FUNC(IDX, SIZE, OPT) \
  279. c->put_vp8_bilinear_pixels_tab[IDX][0][1] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
  280. c->put_vp8_bilinear_pixels_tab[IDX][0][2] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
  281. c->put_vp8_bilinear_pixels_tab[IDX][1][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
  282. c->put_vp8_bilinear_pixels_tab[IDX][1][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  283. c->put_vp8_bilinear_pixels_tab[IDX][1][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  284. c->put_vp8_bilinear_pixels_tab[IDX][2][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
  285. c->put_vp8_bilinear_pixels_tab[IDX][2][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  286. c->put_vp8_bilinear_pixels_tab[IDX][2][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT
  287. av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
  288. {
  289. #if HAVE_YASM
  290. int mm_flags = av_get_cpu_flags();
  291. if (mm_flags & AV_CPU_FLAG_MMX) {
  292. c->vp8_idct_dc_add = ff_vp8_idct_dc_add_mmx;
  293. c->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmx;
  294. #if ARCH_X86_32
  295. c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_mmx;
  296. c->vp8_idct_add = ff_vp8_idct_add_mmx;
  297. c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_mmx;
  298. c->put_vp8_epel_pixels_tab[0][0][0] =
  299. c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmx;
  300. #endif
  301. c->put_vp8_epel_pixels_tab[1][0][0] =
  302. c->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmx;
  303. #if ARCH_X86_32
  304. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx;
  305. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx;
  306. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx;
  307. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx;
  308. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx;
  309. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx;
  310. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmx;
  311. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmx;
  312. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmx;
  313. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmx;
  314. #endif
  315. }
  316. /* note that 4-tap width=16 functions are missing because w=16
  317. * is only used for luma, and luma is always a copy or sixtap. */
  318. if (mm_flags & AV_CPU_FLAG_MMXEXT) {
  319. VP8_MC_FUNC(2, 4, mmx2);
  320. VP8_BILINEAR_MC_FUNC(2, 4, mmx2);
  321. #if ARCH_X86_32
  322. VP8_LUMA_MC_FUNC(0, 16, mmx2);
  323. VP8_MC_FUNC(1, 8, mmx2);
  324. VP8_BILINEAR_MC_FUNC(0, 16, mmx2);
  325. VP8_BILINEAR_MC_FUNC(1, 8, mmx2);
  326. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx2;
  327. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx2;
  328. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx2;
  329. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx2;
  330. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx2;
  331. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx2;
  332. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmx2;
  333. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmx2;
  334. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmx2;
  335. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmx2;
  336. #endif
  337. }
  338. if (mm_flags & AV_CPU_FLAG_SSE) {
  339. c->vp8_idct_add = ff_vp8_idct_add_sse;
  340. c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_sse;
  341. c->put_vp8_epel_pixels_tab[0][0][0] =
  342. c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse;
  343. }
  344. if (mm_flags & (AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW)) {
  345. VP8_LUMA_MC_FUNC(0, 16, sse2);
  346. VP8_MC_FUNC(1, 8, sse2);
  347. VP8_BILINEAR_MC_FUNC(0, 16, sse2);
  348. VP8_BILINEAR_MC_FUNC(1, 8, sse2);
  349. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_sse2;
  350. #if ARCH_X86_64 || HAVE_ALIGNED_STACK
  351. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2;
  352. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_sse2;
  353. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_sse2;
  354. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_sse2;
  355. #endif
  356. }
  357. if (mm_flags & AV_CPU_FLAG_SSE2) {
  358. c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_sse2;
  359. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2;
  360. #if ARCH_X86_64 || HAVE_ALIGNED_STACK
  361. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_sse2;
  362. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_sse2;
  363. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse2;
  364. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse2;
  365. #endif
  366. }
  367. if (mm_flags & AV_CPU_FLAG_SSSE3) {
  368. VP8_LUMA_MC_FUNC(0, 16, ssse3);
  369. VP8_MC_FUNC(1, 8, ssse3);
  370. VP8_MC_FUNC(2, 4, ssse3);
  371. VP8_BILINEAR_MC_FUNC(0, 16, ssse3);
  372. VP8_BILINEAR_MC_FUNC(1, 8, ssse3);
  373. VP8_BILINEAR_MC_FUNC(2, 4, ssse3);
  374. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_ssse3;
  375. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_ssse3;
  376. #if ARCH_X86_64 || HAVE_ALIGNED_STACK
  377. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_ssse3;
  378. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_ssse3;
  379. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_ssse3;
  380. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_ssse3;
  381. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_ssse3;
  382. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_ssse3;
  383. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_ssse3;
  384. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_ssse3;
  385. #endif
  386. }
  387. if (mm_flags & AV_CPU_FLAG_SSE4) {
  388. c->vp8_idct_dc_add = ff_vp8_idct_dc_add_sse4;
  389. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse4;
  390. #if ARCH_X86_64 || HAVE_ALIGNED_STACK
  391. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse4;
  392. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse4;
  393. #endif
  394. }
  395. #endif
  396. }