vp8dsp_init.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  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. void ff_put_vp8_epel4_h4_mmxext(uint8_t *dst, ptrdiff_t dststride,
  31. uint8_t *src, ptrdiff_t srcstride,
  32. int height, int mx, int my);
  33. void ff_put_vp8_epel4_h6_mmxext(uint8_t *dst, ptrdiff_t dststride,
  34. uint8_t *src, ptrdiff_t srcstride,
  35. int height, int mx, int my);
  36. void ff_put_vp8_epel4_v4_mmxext(uint8_t *dst, ptrdiff_t dststride,
  37. uint8_t *src, ptrdiff_t srcstride,
  38. int height, int mx, int my);
  39. void ff_put_vp8_epel4_v6_mmxext(uint8_t *dst, ptrdiff_t dststride,
  40. uint8_t *src, ptrdiff_t srcstride,
  41. int height, int mx, int my);
  42. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. void ff_put_vp8_bilinear4_h_mmxext(uint8_t *dst, ptrdiff_t dststride,
  79. uint8_t *src, ptrdiff_t srcstride,
  80. int height, int mx, int my);
  81. 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. 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. 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. void ff_put_vp8_bilinear4_v_mmxext(uint8_t *dst, ptrdiff_t dststride,
  91. uint8_t *src, ptrdiff_t srcstride,
  92. int height, int mx, int my);
  93. 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. 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. 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. 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. 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. 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 (mmxext, epel, h4)
  133. TAP_W8 (mmxext, epel, h6)
  134. TAP_W16(mmxext, epel, h6)
  135. TAP_W8 (mmxext, epel, v4)
  136. TAP_W8 (mmxext, epel, v6)
  137. TAP_W16(mmxext, epel, v6)
  138. TAP_W8 (mmxext, bilinear, h)
  139. TAP_W16(mmxext, bilinear, h)
  140. TAP_W8 (mmxext, bilinear, v)
  141. TAP_W16(mmxext, 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(mmxext, 8, x, y, 4, 8) \
  167. HVTAP(mmxext, 8, x, y, 8, 16)
  168. HVTAP(mmxext, 8, 6, 6, 16, 16)
  169. #else
  170. #define HVTAPMMX(x, y) \
  171. HVTAP(mmxext, 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(mmxext, 8, 4, 8)
  201. #if ARCH_X86_32
  202. HVBILIN(mmxext, 8, 8, 16)
  203. HVBILIN(mmxext, 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. void ff_vp8_idct_dc_add_mmx(uint8_t *dst, int16_t block[16],
  211. ptrdiff_t stride);
  212. void ff_vp8_idct_dc_add_sse4(uint8_t *dst, int16_t block[16],
  213. ptrdiff_t stride);
  214. void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, int16_t block[4][16],
  215. ptrdiff_t stride);
  216. void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, int16_t block[4][16],
  217. ptrdiff_t stride);
  218. void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, int16_t block[2][16],
  219. ptrdiff_t stride);
  220. void ff_vp8_luma_dc_wht_mmx(int16_t block[4][4][16], int16_t dc[16]);
  221. void ff_vp8_luma_dc_wht_sse(int16_t block[4][4][16], int16_t dc[16]);
  222. void ff_vp8_idct_add_mmx(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
  223. void ff_vp8_idct_add_sse(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
  224. #define DECLARE_LOOP_FILTER(NAME) \
  225. void ff_vp8_v_loop_filter_simple_ ## NAME(uint8_t *dst, \
  226. ptrdiff_t stride, \
  227. int flim); \
  228. void ff_vp8_h_loop_filter_simple_ ## NAME(uint8_t *dst, \
  229. ptrdiff_t stride, \
  230. int flim); \
  231. void ff_vp8_v_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
  232. ptrdiff_t stride, \
  233. int e, int i, int hvt); \
  234. void ff_vp8_h_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
  235. ptrdiff_t stride, \
  236. int e, int i, int hvt); \
  237. void ff_vp8_v_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
  238. uint8_t *dstV, \
  239. ptrdiff_t s, \
  240. int e, int i, int hvt); \
  241. void ff_vp8_h_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
  242. uint8_t *dstV, \
  243. ptrdiff_t s, \
  244. int e, int i, int hvt); \
  245. void ff_vp8_v_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
  246. ptrdiff_t stride, \
  247. int e, int i, int hvt); \
  248. void ff_vp8_h_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
  249. ptrdiff_t stride, \
  250. int e, int i, int hvt); \
  251. void ff_vp8_v_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
  252. uint8_t *dstV, \
  253. ptrdiff_t s, \
  254. int e, int i, int hvt); \
  255. void ff_vp8_h_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
  256. uint8_t *dstV, \
  257. ptrdiff_t s, \
  258. int e, int i, int hvt);
  259. DECLARE_LOOP_FILTER(mmx)
  260. DECLARE_LOOP_FILTER(mmxext)
  261. DECLARE_LOOP_FILTER(sse2)
  262. DECLARE_LOOP_FILTER(ssse3)
  263. DECLARE_LOOP_FILTER(sse4)
  264. #endif /* HAVE_YASM */
  265. #define VP8_LUMA_MC_FUNC(IDX, SIZE, OPT) \
  266. c->put_vp8_epel_pixels_tab[IDX][0][2] = ff_put_vp8_epel ## SIZE ## _h6_ ## OPT; \
  267. c->put_vp8_epel_pixels_tab[IDX][2][0] = ff_put_vp8_epel ## SIZE ## _v6_ ## OPT; \
  268. c->put_vp8_epel_pixels_tab[IDX][2][2] = ff_put_vp8_epel ## SIZE ## _h6v6_ ## OPT
  269. #define VP8_MC_FUNC(IDX, SIZE, OPT) \
  270. c->put_vp8_epel_pixels_tab[IDX][0][1] = ff_put_vp8_epel ## SIZE ## _h4_ ## OPT; \
  271. c->put_vp8_epel_pixels_tab[IDX][1][0] = ff_put_vp8_epel ## SIZE ## _v4_ ## OPT; \
  272. c->put_vp8_epel_pixels_tab[IDX][1][1] = ff_put_vp8_epel ## SIZE ## _h4v4_ ## OPT; \
  273. c->put_vp8_epel_pixels_tab[IDX][1][2] = ff_put_vp8_epel ## SIZE ## _h6v4_ ## OPT; \
  274. c->put_vp8_epel_pixels_tab[IDX][2][1] = ff_put_vp8_epel ## SIZE ## _h4v6_ ## OPT; \
  275. VP8_LUMA_MC_FUNC(IDX, SIZE, OPT)
  276. #define VP8_BILINEAR_MC_FUNC(IDX, SIZE, OPT) \
  277. c->put_vp8_bilinear_pixels_tab[IDX][0][1] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
  278. c->put_vp8_bilinear_pixels_tab[IDX][0][2] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
  279. c->put_vp8_bilinear_pixels_tab[IDX][1][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
  280. c->put_vp8_bilinear_pixels_tab[IDX][1][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  281. c->put_vp8_bilinear_pixels_tab[IDX][1][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  282. c->put_vp8_bilinear_pixels_tab[IDX][2][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
  283. c->put_vp8_bilinear_pixels_tab[IDX][2][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
  284. c->put_vp8_bilinear_pixels_tab[IDX][2][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT
  285. av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
  286. {
  287. #if HAVE_YASM
  288. int mm_flags = av_get_cpu_flags();
  289. if (mm_flags & AV_CPU_FLAG_MMX) {
  290. c->vp8_idct_dc_add = ff_vp8_idct_dc_add_mmx;
  291. c->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmx;
  292. #if ARCH_X86_32
  293. c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_mmx;
  294. c->vp8_idct_add = ff_vp8_idct_add_mmx;
  295. c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_mmx;
  296. c->put_vp8_epel_pixels_tab[0][0][0] =
  297. c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmx;
  298. #endif
  299. c->put_vp8_epel_pixels_tab[1][0][0] =
  300. c->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmx;
  301. #if ARCH_X86_32
  302. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx;
  303. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx;
  304. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx;
  305. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx;
  306. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx;
  307. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx;
  308. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmx;
  309. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmx;
  310. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmx;
  311. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmx;
  312. #endif
  313. }
  314. /* note that 4-tap width=16 functions are missing because w=16
  315. * is only used for luma, and luma is always a copy or sixtap. */
  316. if (mm_flags & AV_CPU_FLAG_MMXEXT) {
  317. VP8_MC_FUNC(2, 4, mmxext);
  318. VP8_BILINEAR_MC_FUNC(2, 4, mmxext);
  319. #if ARCH_X86_32
  320. VP8_LUMA_MC_FUNC(0, 16, mmxext);
  321. VP8_MC_FUNC(1, 8, mmxext);
  322. VP8_BILINEAR_MC_FUNC(0, 16, mmxext);
  323. VP8_BILINEAR_MC_FUNC(1, 8, mmxext);
  324. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmxext;
  325. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmxext;
  326. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmxext;
  327. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmxext;
  328. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmxext;
  329. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmxext;
  330. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmxext;
  331. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmxext;
  332. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmxext;
  333. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmxext;
  334. #endif
  335. }
  336. if (mm_flags & AV_CPU_FLAG_SSE) {
  337. c->vp8_idct_add = ff_vp8_idct_add_sse;
  338. c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_sse;
  339. c->put_vp8_epel_pixels_tab[0][0][0] =
  340. c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse;
  341. }
  342. if (mm_flags & (AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW)) {
  343. VP8_LUMA_MC_FUNC(0, 16, sse2);
  344. VP8_MC_FUNC(1, 8, sse2);
  345. VP8_BILINEAR_MC_FUNC(0, 16, sse2);
  346. VP8_BILINEAR_MC_FUNC(1, 8, sse2);
  347. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_sse2;
  348. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2;
  349. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_sse2;
  350. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_sse2;
  351. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_sse2;
  352. }
  353. if (mm_flags & AV_CPU_FLAG_SSE2) {
  354. c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_sse2;
  355. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2;
  356. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_sse2;
  357. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_sse2;
  358. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse2;
  359. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse2;
  360. }
  361. if (mm_flags & AV_CPU_FLAG_SSSE3) {
  362. VP8_LUMA_MC_FUNC(0, 16, ssse3);
  363. VP8_MC_FUNC(1, 8, ssse3);
  364. VP8_MC_FUNC(2, 4, ssse3);
  365. VP8_BILINEAR_MC_FUNC(0, 16, ssse3);
  366. VP8_BILINEAR_MC_FUNC(1, 8, ssse3);
  367. VP8_BILINEAR_MC_FUNC(2, 4, ssse3);
  368. c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_ssse3;
  369. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_ssse3;
  370. c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_ssse3;
  371. c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_ssse3;
  372. c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_ssse3;
  373. c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_ssse3;
  374. c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_ssse3;
  375. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_ssse3;
  376. c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_ssse3;
  377. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_ssse3;
  378. }
  379. if (mm_flags & AV_CPU_FLAG_SSE4) {
  380. c->vp8_idct_dc_add = ff_vp8_idct_dc_add_sse4;
  381. c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse4;
  382. c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse4;
  383. c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse4;
  384. }
  385. #endif /* HAVE_YASM */
  386. }