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.

442 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 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 "libavutil/x86/cpu.h"
  26. #include "libavcodec/vp8dsp.h"
  27. #if HAVE_YASM
  28. /*
  29. * MC functions
  30. */
  31. void ff_put_vp8_epel4_h4_mmxext(uint8_t *dst, ptrdiff_t dststride,
  32. uint8_t *src, ptrdiff_t srcstride,
  33. int height, int mx, int my);
  34. void ff_put_vp8_epel4_h6_mmxext(uint8_t *dst, ptrdiff_t dststride,
  35. uint8_t *src, ptrdiff_t srcstride,
  36. int height, int mx, int my);
  37. void ff_put_vp8_epel4_v4_mmxext(uint8_t *dst, ptrdiff_t dststride,
  38. uint8_t *src, ptrdiff_t srcstride,
  39. int height, int mx, int my);
  40. void ff_put_vp8_epel4_v6_mmxext(uint8_t *dst, ptrdiff_t dststride,
  41. uint8_t *src, ptrdiff_t srcstride,
  42. int height, int mx, int my);
  43. void ff_put_vp8_epel8_h4_sse2 (uint8_t *dst, ptrdiff_t dststride,
  44. uint8_t *src, ptrdiff_t srcstride,
  45. int height, int mx, int my);
  46. void ff_put_vp8_epel8_h6_sse2 (uint8_t *dst, ptrdiff_t dststride,
  47. uint8_t *src, ptrdiff_t srcstride,
  48. int height, int mx, int my);
  49. void ff_put_vp8_epel8_v4_sse2 (uint8_t *dst, ptrdiff_t dststride,
  50. uint8_t *src, ptrdiff_t srcstride,
  51. int height, int mx, int my);
  52. void ff_put_vp8_epel8_v6_sse2 (uint8_t *dst, ptrdiff_t dststride,
  53. uint8_t *src, ptrdiff_t srcstride,
  54. int height, int mx, int my);
  55. void ff_put_vp8_epel4_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  56. uint8_t *src, ptrdiff_t srcstride,
  57. int height, int mx, int my);
  58. void ff_put_vp8_epel4_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  59. uint8_t *src, ptrdiff_t srcstride,
  60. int height, int mx, int my);
  61. void ff_put_vp8_epel4_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  62. uint8_t *src, ptrdiff_t srcstride,
  63. int height, int mx, int my);
  64. void ff_put_vp8_epel4_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  65. uint8_t *src, ptrdiff_t srcstride,
  66. int height, int mx, int my);
  67. void ff_put_vp8_epel8_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  68. uint8_t *src, ptrdiff_t srcstride,
  69. int height, int mx, int my);
  70. void ff_put_vp8_epel8_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  71. uint8_t *src, ptrdiff_t srcstride,
  72. int height, int mx, int my);
  73. void ff_put_vp8_epel8_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  74. uint8_t *src, ptrdiff_t srcstride,
  75. int height, int mx, int my);
  76. void ff_put_vp8_epel8_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  77. uint8_t *src, ptrdiff_t srcstride,
  78. int height, int mx, int my);
  79. void ff_put_vp8_bilinear4_h_mmxext(uint8_t *dst, ptrdiff_t dststride,
  80. uint8_t *src, ptrdiff_t srcstride,
  81. int height, int mx, int my);
  82. void ff_put_vp8_bilinear8_h_sse2 (uint8_t *dst, ptrdiff_t dststride,
  83. uint8_t *src, ptrdiff_t srcstride,
  84. int height, int mx, int my);
  85. void ff_put_vp8_bilinear4_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  86. uint8_t *src, ptrdiff_t srcstride,
  87. int height, int mx, int my);
  88. void ff_put_vp8_bilinear8_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  89. uint8_t *src, ptrdiff_t srcstride,
  90. int height, int mx, int my);
  91. void ff_put_vp8_bilinear4_v_mmxext(uint8_t *dst, ptrdiff_t dststride,
  92. uint8_t *src, ptrdiff_t srcstride,
  93. int height, int mx, int my);
  94. void ff_put_vp8_bilinear8_v_sse2 (uint8_t *dst, ptrdiff_t dststride,
  95. uint8_t *src, ptrdiff_t srcstride,
  96. int height, int mx, int my);
  97. void ff_put_vp8_bilinear4_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  98. uint8_t *src, ptrdiff_t srcstride,
  99. int height, int mx, int my);
  100. void ff_put_vp8_bilinear8_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
  101. uint8_t *src, ptrdiff_t srcstride,
  102. int height, int mx, int my);
  103. void ff_put_vp8_pixels8_mmx (uint8_t *dst, ptrdiff_t dststride,
  104. uint8_t *src, ptrdiff_t srcstride,
  105. int height, int mx, int my);
  106. void ff_put_vp8_pixels16_mmx(uint8_t *dst, ptrdiff_t dststride,
  107. uint8_t *src, ptrdiff_t srcstride,
  108. int height, int mx, int my);
  109. void ff_put_vp8_pixels16_sse(uint8_t *dst, ptrdiff_t dststride,
  110. uint8_t *src, ptrdiff_t srcstride,
  111. int height, int mx, int my);
  112. #define TAP_W16(OPT, FILTERTYPE, TAPTYPE) \
  113. static void ff_put_vp8_ ## FILTERTYPE ## 16_ ## TAPTYPE ## _ ## OPT( \
  114. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  115. ptrdiff_t srcstride, int height, int mx, int my) \
  116. { \
  117. ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
  118. dst, dststride, src, srcstride, height, mx, my); \
  119. ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
  120. dst + 8, dststride, src + 8, srcstride, height, mx, my); \
  121. }
  122. #define TAP_W8(OPT, FILTERTYPE, TAPTYPE) \
  123. static void ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
  124. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  125. ptrdiff_t srcstride, int height, int mx, int my) \
  126. { \
  127. ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
  128. dst, dststride, src, srcstride, height, mx, my); \
  129. ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
  130. dst + 4, dststride, src + 4, srcstride, height, mx, my); \
  131. }
  132. #if ARCH_X86_32
  133. TAP_W8 (mmxext, epel, h4)
  134. TAP_W8 (mmxext, epel, h6)
  135. TAP_W16(mmxext, epel, h6)
  136. TAP_W8 (mmxext, epel, v4)
  137. TAP_W8 (mmxext, epel, v6)
  138. TAP_W16(mmxext, epel, v6)
  139. TAP_W8 (mmxext, bilinear, h)
  140. TAP_W16(mmxext, bilinear, h)
  141. TAP_W8 (mmxext, bilinear, v)
  142. TAP_W16(mmxext, bilinear, v)
  143. #endif
  144. TAP_W16(sse2, epel, h6)
  145. TAP_W16(sse2, epel, v6)
  146. TAP_W16(sse2, bilinear, h)
  147. TAP_W16(sse2, bilinear, v)
  148. TAP_W16(ssse3, epel, h6)
  149. TAP_W16(ssse3, epel, v6)
  150. TAP_W16(ssse3, bilinear, h)
  151. TAP_W16(ssse3, bilinear, v)
  152. #define HVTAP(OPT, ALIGN, TAPNUMX, TAPNUMY, SIZE, MAXHEIGHT) \
  153. static void ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## v ## TAPNUMY ## _ ## OPT( \
  154. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  155. ptrdiff_t srcstride, int height, int mx, int my) \
  156. { \
  157. DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + TAPNUMY - 1)]; \
  158. uint8_t *tmpptr = tmp + SIZE * (TAPNUMY / 2 - 1); \
  159. src -= srcstride * (TAPNUMY / 2 - 1); \
  160. ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## _ ## OPT( \
  161. tmp, SIZE, src, srcstride, height + TAPNUMY - 1, mx, my); \
  162. ff_put_vp8_epel ## SIZE ## _v ## TAPNUMY ## _ ## OPT( \
  163. dst, dststride, tmpptr, SIZE, height, mx, my); \
  164. }
  165. #if ARCH_X86_32
  166. #define HVTAPMMX(x, y) \
  167. HVTAP(mmxext, 8, x, y, 4, 8) \
  168. HVTAP(mmxext, 8, x, y, 8, 16)
  169. HVTAP(mmxext, 8, 6, 6, 16, 16)
  170. #else
  171. #define HVTAPMMX(x, y) \
  172. HVTAP(mmxext, 8, x, y, 4, 8)
  173. #endif
  174. HVTAPMMX(4, 4)
  175. HVTAPMMX(4, 6)
  176. HVTAPMMX(6, 4)
  177. HVTAPMMX(6, 6)
  178. #define HVTAPSSE2(x, y, w) \
  179. HVTAP(sse2, 16, x, y, w, 16) \
  180. HVTAP(ssse3, 16, x, y, w, 16)
  181. HVTAPSSE2(4, 4, 8)
  182. HVTAPSSE2(4, 6, 8)
  183. HVTAPSSE2(6, 4, 8)
  184. HVTAPSSE2(6, 6, 8)
  185. HVTAPSSE2(6, 6, 16)
  186. HVTAP(ssse3, 16, 4, 4, 4, 8)
  187. HVTAP(ssse3, 16, 4, 6, 4, 8)
  188. HVTAP(ssse3, 16, 6, 4, 4, 8)
  189. HVTAP(ssse3, 16, 6, 6, 4, 8)
  190. #define HVBILIN(OPT, ALIGN, SIZE, MAXHEIGHT) \
  191. static void ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT( \
  192. uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
  193. ptrdiff_t srcstride, int height, int mx, int my) \
  194. { \
  195. DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + 2)]; \
  196. ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT( \
  197. tmp, SIZE, src, srcstride, height + 1, mx, my); \
  198. ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT( \
  199. dst, dststride, tmp, SIZE, height, mx, my); \
  200. }
  201. HVBILIN(mmxext, 8, 4, 8)
  202. #if ARCH_X86_32
  203. HVBILIN(mmxext, 8, 8, 16)
  204. HVBILIN(mmxext, 8, 16, 16)
  205. #endif
  206. HVBILIN(sse2, 8, 8, 16)
  207. HVBILIN(sse2, 8, 16, 16)
  208. HVBILIN(ssse3, 8, 4, 8)
  209. HVBILIN(ssse3, 8, 8, 16)
  210. HVBILIN(ssse3, 8, 16, 16)
  211. void ff_vp8_idct_dc_add_mmx(uint8_t *dst, int16_t block[16],
  212. ptrdiff_t stride);
  213. void ff_vp8_idct_dc_add_sse4(uint8_t *dst, int16_t block[16],
  214. ptrdiff_t stride);
  215. void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, int16_t block[4][16],
  216. ptrdiff_t stride);
  217. void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, int16_t block[4][16],
  218. ptrdiff_t stride);
  219. void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, int16_t block[2][16],
  220. ptrdiff_t stride);
  221. void ff_vp8_luma_dc_wht_mmx(int16_t block[4][4][16], int16_t dc[16]);
  222. void ff_vp8_luma_dc_wht_sse(int16_t block[4][4][16], int16_t dc[16]);
  223. void ff_vp8_idct_add_mmx(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
  224. void ff_vp8_idct_add_sse(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
  225. #define DECLARE_LOOP_FILTER(NAME) \
  226. void ff_vp8_v_loop_filter_simple_ ## NAME(uint8_t *dst, \
  227. ptrdiff_t stride, \
  228. int flim); \
  229. void ff_vp8_h_loop_filter_simple_ ## NAME(uint8_t *dst, \
  230. ptrdiff_t stride, \
  231. int flim); \
  232. void ff_vp8_v_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
  233. ptrdiff_t stride, \
  234. int e, int i, int hvt); \
  235. void ff_vp8_h_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
  236. ptrdiff_t stride, \
  237. int e, int i, int hvt); \
  238. 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. 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. void ff_vp8_v_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
  247. ptrdiff_t stride, \
  248. int e, int i, int hvt); \
  249. void ff_vp8_h_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
  250. ptrdiff_t stride, \
  251. int e, int i, int hvt); \
  252. 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. 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(mmxext)
  262. DECLARE_LOOP_FILTER(sse2)
  263. DECLARE_LOOP_FILTER(ssse3)
  264. DECLARE_LOOP_FILTER(sse4)
  265. #endif /* HAVE_YASM */
  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 cpu_flags = av_get_cpu_flags();
  290. if (EXTERNAL_MMX(cpu_flags)) {
  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 (EXTERNAL_MMXEXT(cpu_flags)) {
  318. VP8_MC_FUNC(2, 4, mmxext);
  319. VP8_BILINEAR_MC_FUNC(2, 4, mmxext);
  320. #if ARCH_X86_32
  321. VP8_LUMA_MC_FUNC(0, 16, mmxext);
  322. VP8_MC_FUNC(1, 8, mmxext);
  323. VP8_BILINEAR_MC_FUNC(0, 16, mmxext);
  324. VP8_BILINEAR_MC_FUNC(1, 8, mmxext);
  325. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmxext;
  326. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmxext;
  327. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmxext;
  328. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmxext;
  329. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmxext;
  330. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmxext;
  331. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmxext;
  332. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmxext;
  333. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmxext;
  334. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmxext;
  335. #endif
  336. }
  337. if (EXTERNAL_SSE(cpu_flags)) {
  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 (HAVE_SSE2_EXTERNAL && cpu_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. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2;
  350. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_sse2;
  351. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_sse2;
  352. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_sse2;
  353. }
  354. if (EXTERNAL_SSE2(cpu_flags)) {
  355. c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_sse2;
  356. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2;
  357. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_sse2;
  358. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_sse2;
  359. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse2;
  360. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse2;
  361. }
  362. if (EXTERNAL_SSSE3(cpu_flags)) {
  363. VP8_LUMA_MC_FUNC(0, 16, ssse3);
  364. VP8_MC_FUNC(1, 8, ssse3);
  365. VP8_MC_FUNC(2, 4, ssse3);
  366. VP8_BILINEAR_MC_FUNC(0, 16, ssse3);
  367. VP8_BILINEAR_MC_FUNC(1, 8, ssse3);
  368. VP8_BILINEAR_MC_FUNC(2, 4, ssse3);
  369. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_ssse3;
  370. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_ssse3;
  371. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_ssse3;
  372. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_ssse3;
  373. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_ssse3;
  374. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_ssse3;
  375. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_ssse3;
  376. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_ssse3;
  377. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_ssse3;
  378. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_ssse3;
  379. }
  380. if (EXTERNAL_SSE4(cpu_flags)) {
  381. c->vp8_idct_dc_add = ff_vp8_idct_dc_add_sse4;
  382. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse4;
  383. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse4;
  384. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse4;
  385. }
  386. #endif /* HAVE_YASM */
  387. }