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.

488 lines
15KB

  1. /**
  2. * VP8 compatible video decoder
  3. *
  4. * Copyright (C) 2010 David Conrad
  5. * Copyright (C) 2010 Ronald S. Bultje
  6. *
  7. * This file is part of FFmpeg.
  8. *
  9. * FFmpeg is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2.1 of the License, or (at your option) any later version.
  13. *
  14. * FFmpeg is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with FFmpeg; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. */
  23. #include "dsputil.h"
  24. #include "vp8dsp.h"
  25. // TODO: Maybe add dequant
  26. static void vp8_luma_dc_wht_c(DCTELEM block[4][4][16], DCTELEM dc[16])
  27. {
  28. int i, t0, t1, t2, t3;
  29. for (i = 0; i < 4; i++) {
  30. t0 = dc[0*4+i] + dc[3*4+i];
  31. t1 = dc[1*4+i] + dc[2*4+i];
  32. t2 = dc[1*4+i] - dc[2*4+i];
  33. t3 = dc[0*4+i] - dc[3*4+i];
  34. dc[0*4+i] = t0 + t1;
  35. dc[1*4+i] = t3 + t2;
  36. dc[2*4+i] = t0 - t1;
  37. dc[3*4+i] = t3 - t2;
  38. }
  39. for (i = 0; i < 4; i++) {
  40. t0 = dc[i*4+0] + dc[i*4+3] + 3; // rounding
  41. t1 = dc[i*4+1] + dc[i*4+2];
  42. t2 = dc[i*4+1] - dc[i*4+2];
  43. t3 = dc[i*4+0] - dc[i*4+3] + 3; // rounding
  44. *block[i][0] = (t0 + t1) >> 3;
  45. *block[i][1] = (t3 + t2) >> 3;
  46. *block[i][2] = (t0 - t1) >> 3;
  47. *block[i][3] = (t3 - t2) >> 3;
  48. }
  49. }
  50. #define MUL_20091(a) ((((a)*20091) >> 16) + (a))
  51. #define MUL_35468(a) (((a)*35468) >> 16)
  52. static void vp8_idct_add_c(uint8_t *dst, DCTELEM block[16], int stride)
  53. {
  54. int i, t0, t1, t2, t3;
  55. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
  56. DCTELEM tmp[16];
  57. for (i = 0; i < 4; i++) {
  58. t0 = block[0*4+i] + block[2*4+i];
  59. t1 = block[0*4+i] - block[2*4+i];
  60. t2 = MUL_35468(block[1*4+i]) - MUL_20091(block[3*4+i]);
  61. t3 = MUL_20091(block[1*4+i]) + MUL_35468(block[3*4+i]);
  62. tmp[i*4+0] = t0 + t3;
  63. tmp[i*4+1] = t1 + t2;
  64. tmp[i*4+2] = t1 - t2;
  65. tmp[i*4+3] = t0 - t3;
  66. }
  67. for (i = 0; i < 4; i++) {
  68. t0 = tmp[0*4+i] + tmp[2*4+i];
  69. t1 = tmp[0*4+i] - tmp[2*4+i];
  70. t2 = MUL_35468(tmp[1*4+i]) - MUL_20091(tmp[3*4+i]);
  71. t3 = MUL_20091(tmp[1*4+i]) + MUL_35468(tmp[3*4+i]);
  72. dst[0] = cm[dst[0] + ((t0 + t3 + 4) >> 3)];
  73. dst[1] = cm[dst[1] + ((t1 + t2 + 4) >> 3)];
  74. dst[2] = cm[dst[2] + ((t1 - t2 + 4) >> 3)];
  75. dst[3] = cm[dst[3] + ((t0 - t3 + 4) >> 3)];
  76. dst += stride;
  77. }
  78. }
  79. static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], int stride)
  80. {
  81. int i, dc = (block[0] + 4) >> 3;
  82. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc;
  83. for (i = 0; i < 4; i++) {
  84. dst[0] = cm[dst[0]];
  85. dst[1] = cm[dst[1]];
  86. dst[2] = cm[dst[2]];
  87. dst[3] = cm[dst[3]];
  88. dst += stride;
  89. }
  90. }
  91. // because I like only having two parameters to pass functions...
  92. #define LOAD_PIXELS\
  93. int av_unused p3 = p[-4*stride];\
  94. int av_unused p2 = p[-3*stride];\
  95. int av_unused p1 = p[-2*stride];\
  96. int av_unused p0 = p[-1*stride];\
  97. int av_unused q0 = p[ 0*stride];\
  98. int av_unused q1 = p[ 1*stride];\
  99. int av_unused q2 = p[ 2*stride];\
  100. int av_unused q3 = p[ 3*stride];
  101. #define clip_int8(n) (cm[n+0x80]-0x80)
  102. static av_always_inline void filter_common(uint8_t *p, int stride, int is4tap)
  103. {
  104. LOAD_PIXELS
  105. int a, f1, f2;
  106. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
  107. a = 3*(q0 - p0);
  108. if (is4tap)
  109. a += clip_int8(p1 - q1);
  110. a = clip_int8(a);
  111. // We deviate from the spec here with c(a+3) >> 3
  112. // since that's what libvpx does.
  113. f1 = FFMIN(a+4, 127) >> 3;
  114. f2 = FFMIN(a+3, 127) >> 3;
  115. // Despite what the spec says, we do need to clamp here to
  116. // be bitexact with libvpx.
  117. p[-1*stride] = cm[p0 + f2];
  118. p[ 0*stride] = cm[q0 - f1];
  119. // only used for _inner on blocks without high edge variance
  120. if (!is4tap) {
  121. a = (f1+1)>>1;
  122. p[-2*stride] = cm[p1 + a];
  123. p[ 1*stride] = cm[q1 - a];
  124. }
  125. }
  126. static av_always_inline int simple_limit(uint8_t *p, int stride, int flim)
  127. {
  128. LOAD_PIXELS
  129. return 2*FFABS(p0-q0) + (FFABS(p1-q1) >> 1) <= flim;
  130. }
  131. /**
  132. * E - limit at the macroblock edge
  133. * I - limit for interior difference
  134. */
  135. static av_always_inline int normal_limit(uint8_t *p, int stride, int E, int I)
  136. {
  137. LOAD_PIXELS
  138. return simple_limit(p, stride, E)
  139. && FFABS(p3-p2) <= I && FFABS(p2-p1) <= I && FFABS(p1-p0) <= I
  140. && FFABS(q3-q2) <= I && FFABS(q2-q1) <= I && FFABS(q1-q0) <= I;
  141. }
  142. // high edge variance
  143. static av_always_inline int hev(uint8_t *p, int stride, int thresh)
  144. {
  145. LOAD_PIXELS
  146. return FFABS(p1-p0) > thresh || FFABS(q1-q0) > thresh;
  147. }
  148. static av_always_inline void filter_mbedge(uint8_t *p, int stride)
  149. {
  150. int a0, a1, a2, w;
  151. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
  152. LOAD_PIXELS
  153. w = clip_int8(p1-q1);
  154. w = clip_int8(w + 3*(q0-p0));
  155. a0 = (27*w + 63) >> 7;
  156. a1 = (18*w + 63) >> 7;
  157. a2 = ( 9*w + 63) >> 7;
  158. p[-3*stride] = cm[p2 + a2];
  159. p[-2*stride] = cm[p1 + a1];
  160. p[-1*stride] = cm[p0 + a0];
  161. p[ 0*stride] = cm[q0 - a0];
  162. p[ 1*stride] = cm[q1 - a1];
  163. p[ 2*stride] = cm[q2 - a2];
  164. }
  165. #define LOOP_FILTER(dir, size, stridea, strideb, maybe_inline) \
  166. static maybe_inline void vp8_ ## dir ## _loop_filter ## size ## _c(uint8_t *dst, int stride,\
  167. int flim_E, int flim_I, int hev_thresh)\
  168. {\
  169. int i;\
  170. \
  171. for (i = 0; i < size; i++)\
  172. if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\
  173. if (hev(dst+i*stridea, strideb, hev_thresh))\
  174. filter_common(dst+i*stridea, strideb, 1);\
  175. else\
  176. filter_mbedge(dst+i*stridea, strideb);\
  177. }\
  178. }\
  179. \
  180. static maybe_inline void vp8_ ## dir ## _loop_filter ## size ## _inner_c(uint8_t *dst, int stride,\
  181. int flim_E, int flim_I, int hev_thresh)\
  182. {\
  183. int i;\
  184. \
  185. for (i = 0; i < size; i++)\
  186. if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\
  187. int hv = hev(dst+i*stridea, strideb, hev_thresh);\
  188. if (hv) \
  189. filter_common(dst+i*stridea, strideb, 1);\
  190. else \
  191. filter_common(dst+i*stridea, strideb, 0);\
  192. }\
  193. }
  194. LOOP_FILTER(v, 16, 1, stride,)
  195. LOOP_FILTER(h, 16, stride, 1,)
  196. #define UV_LOOP_FILTER(dir, stridea, strideb) \
  197. LOOP_FILTER(dir, 8, stridea, strideb, av_always_inline) \
  198. static void vp8_ ## dir ## _loop_filter8uv_c(uint8_t *dstU, uint8_t *dstV, int stride,\
  199. int fE, int fI, int hev_thresh)\
  200. {\
  201. vp8_ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh);\
  202. vp8_ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh);\
  203. }\
  204. static void vp8_ ## dir ## _loop_filter8uv_inner_c(uint8_t *dstU, uint8_t *dstV, int stride,\
  205. int fE, int fI, int hev_thresh)\
  206. {\
  207. vp8_ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, hev_thresh);\
  208. vp8_ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, hev_thresh);\
  209. }
  210. UV_LOOP_FILTER(v, 1, stride)
  211. UV_LOOP_FILTER(h, stride, 1)
  212. static void vp8_v_loop_filter_simple_c(uint8_t *dst, int stride, int flim)
  213. {
  214. int i;
  215. for (i = 0; i < 16; i++)
  216. if (simple_limit(dst+i, stride, flim))
  217. filter_common(dst+i, stride, 1);
  218. }
  219. static void vp8_h_loop_filter_simple_c(uint8_t *dst, int stride, int flim)
  220. {
  221. int i;
  222. for (i = 0; i < 16; i++)
  223. if (simple_limit(dst+i*stride, 1, flim))
  224. filter_common(dst+i*stride, 1, 1);
  225. }
  226. static const uint8_t subpel_filters[7][6] = {
  227. { 0, 6, 123, 12, 1, 0 },
  228. { 2, 11, 108, 36, 8, 1 },
  229. { 0, 9, 93, 50, 6, 0 },
  230. { 3, 16, 77, 77, 16, 3 },
  231. { 0, 6, 50, 93, 9, 0 },
  232. { 1, 8, 36, 108, 11, 2 },
  233. { 0, 1, 12, 123, 6, 0 },
  234. };
  235. #define PUT_PIXELS(WIDTH) \
  236. static void put_vp8_pixels ## WIDTH ##_c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int x, int y) { \
  237. int i; \
  238. for (i = 0; i < h; i++, dst+= dststride, src+= srcstride) { \
  239. memcpy(dst, src, WIDTH); \
  240. } \
  241. }
  242. PUT_PIXELS(16)
  243. PUT_PIXELS(8)
  244. PUT_PIXELS(4)
  245. #define FILTER_6TAP(src, F, stride) \
  246. cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + F[0]*src[x-2*stride] + \
  247. F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + F[5]*src[x+3*stride] + 64) >> 7]
  248. #define FILTER_4TAP(src, F, stride) \
  249. cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + \
  250. F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + 64) >> 7]
  251. #define VP8_EPEL_H(SIZE, FILTER, FILTERNAME) \
  252. static void put_vp8_epel ## SIZE ## _ ## FILTERNAME ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
  253. { \
  254. const uint8_t *filter = subpel_filters[mx-1]; \
  255. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
  256. int x, y; \
  257. \
  258. for (y = 0; y < h; y++) { \
  259. for (x = 0; x < SIZE; x++) \
  260. dst[x] = FILTER(src, filter, 1); \
  261. dst += dststride; \
  262. src += srcstride; \
  263. } \
  264. }
  265. #define VP8_EPEL_V(SIZE, FILTER, FILTERNAME) \
  266. static void put_vp8_epel ## SIZE ## _ ## FILTERNAME ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
  267. { \
  268. const uint8_t *filter = subpel_filters[my-1]; \
  269. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
  270. int x, y; \
  271. \
  272. for (y = 0; y < h; y++) { \
  273. for (x = 0; x < SIZE; x++) \
  274. dst[x] = FILTER(src, filter, srcstride); \
  275. dst += dststride; \
  276. src += srcstride; \
  277. } \
  278. }
  279. #define VP8_EPEL_HV(SIZE, FILTERX, FILTERY, FILTERNAME) \
  280. static void put_vp8_epel ## SIZE ## _ ## FILTERNAME ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
  281. { \
  282. const uint8_t *filter = subpel_filters[mx-1]; \
  283. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
  284. int x, y; \
  285. uint8_t tmp_array[(2*SIZE+5)*SIZE]; \
  286. uint8_t *tmp = tmp_array; \
  287. src -= 2*srcstride; \
  288. \
  289. for (y = 0; y < h+5; y++) { \
  290. for (x = 0; x < SIZE; x++) \
  291. tmp[x] = FILTERX(src, filter, 1); \
  292. tmp += SIZE; \
  293. src += srcstride; \
  294. } \
  295. \
  296. tmp = tmp_array + 2*SIZE; \
  297. filter = subpel_filters[my-1]; \
  298. \
  299. for (y = 0; y < h; y++) { \
  300. for (x = 0; x < SIZE; x++) \
  301. dst[x] = FILTERY(tmp, filter, SIZE); \
  302. dst += dststride; \
  303. tmp += SIZE; \
  304. } \
  305. }
  306. VP8_EPEL_H(16, FILTER_4TAP, h4)
  307. VP8_EPEL_H(8, FILTER_4TAP, h4)
  308. VP8_EPEL_H(4, FILTER_4TAP, h4)
  309. VP8_EPEL_H(16, FILTER_6TAP, h6)
  310. VP8_EPEL_H(8, FILTER_6TAP, h6)
  311. VP8_EPEL_H(4, FILTER_6TAP, h6)
  312. VP8_EPEL_V(16, FILTER_4TAP, v4)
  313. VP8_EPEL_V(8, FILTER_4TAP, v4)
  314. VP8_EPEL_V(4, FILTER_4TAP, v4)
  315. VP8_EPEL_V(16, FILTER_6TAP, v6)
  316. VP8_EPEL_V(8, FILTER_6TAP, v6)
  317. VP8_EPEL_V(4, FILTER_6TAP, v6)
  318. VP8_EPEL_HV(16, FILTER_4TAP, FILTER_4TAP, h4v4)
  319. VP8_EPEL_HV(8, FILTER_4TAP, FILTER_4TAP, h4v4)
  320. VP8_EPEL_HV(4, FILTER_4TAP, FILTER_4TAP, h4v4)
  321. VP8_EPEL_HV(16, FILTER_4TAP, FILTER_6TAP, h4v6)
  322. VP8_EPEL_HV(8, FILTER_4TAP, FILTER_6TAP, h4v6)
  323. VP8_EPEL_HV(4, FILTER_4TAP, FILTER_6TAP, h4v6)
  324. VP8_EPEL_HV(16, FILTER_6TAP, FILTER_4TAP, h6v4)
  325. VP8_EPEL_HV(8, FILTER_6TAP, FILTER_4TAP, h6v4)
  326. VP8_EPEL_HV(4, FILTER_6TAP, FILTER_4TAP, h6v4)
  327. VP8_EPEL_HV(16, FILTER_6TAP, FILTER_6TAP, h6v6)
  328. VP8_EPEL_HV(8, FILTER_6TAP, FILTER_6TAP, h6v6)
  329. VP8_EPEL_HV(4, FILTER_6TAP, FILTER_6TAP, h6v6)
  330. #define VP8_BILINEAR(SIZE) \
  331. static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, int stride, uint8_t *src, int s2, int h, int mx, int my) \
  332. { \
  333. int a = 8-mx, b = mx; \
  334. int x, y; \
  335. \
  336. for (y = 0; y < h; y++) { \
  337. for (x = 0; x < SIZE; x++) \
  338. dst[x] = (a*src[x] + b*src[x+1] + 4) >> 3; \
  339. dst += stride; \
  340. src += stride; \
  341. } \
  342. } \
  343. static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, int stride, uint8_t *src, int s2, int h, int mx, int my) \
  344. { \
  345. int c = 8-my, d = my; \
  346. int x, y; \
  347. \
  348. for (y = 0; y < h; y++) { \
  349. for (x = 0; x < SIZE; x++) \
  350. dst[x] = (c*src[x] + d*src[x+stride] + 4) >> 3; \
  351. dst += stride; \
  352. src += stride; \
  353. } \
  354. } \
  355. \
  356. static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, int stride, uint8_t *src, int s2, int h, int mx, int my) \
  357. { \
  358. int a = 8-mx, b = mx; \
  359. int c = 8-my, d = my; \
  360. int x, y; \
  361. uint8_t tmp_array[(2*SIZE+1)*SIZE]; \
  362. uint8_t *tmp = tmp_array; \
  363. \
  364. for (y = 0; y < h+1; y++) { \
  365. for (x = 0; x < SIZE; x++) \
  366. tmp[x] = (a*src[x] + b*src[x+1] + 4) >> 3; \
  367. tmp += SIZE; \
  368. src += stride; \
  369. } \
  370. \
  371. tmp = tmp_array; \
  372. \
  373. for (y = 0; y < h; y++) { \
  374. for (x = 0; x < SIZE; x++) \
  375. dst[x] = (c*tmp[x] + d*tmp[x+SIZE] + 4) >> 3; \
  376. dst += stride; \
  377. tmp += SIZE; \
  378. } \
  379. }
  380. VP8_BILINEAR(16)
  381. VP8_BILINEAR(8)
  382. VP8_BILINEAR(4)
  383. #define VP8_MC_FUNC(IDX, SIZE) \
  384. dsp->put_vp8_epel_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
  385. dsp->put_vp8_epel_pixels_tab[IDX][0][1] = put_vp8_epel ## SIZE ## _h4_c; \
  386. dsp->put_vp8_epel_pixels_tab[IDX][0][2] = put_vp8_epel ## SIZE ## _h6_c; \
  387. dsp->put_vp8_epel_pixels_tab[IDX][1][0] = put_vp8_epel ## SIZE ## _v4_c; \
  388. dsp->put_vp8_epel_pixels_tab[IDX][1][1] = put_vp8_epel ## SIZE ## _h4v4_c; \
  389. dsp->put_vp8_epel_pixels_tab[IDX][1][2] = put_vp8_epel ## SIZE ## _h6v4_c; \
  390. dsp->put_vp8_epel_pixels_tab[IDX][2][0] = put_vp8_epel ## SIZE ## _v6_c; \
  391. dsp->put_vp8_epel_pixels_tab[IDX][2][1] = put_vp8_epel ## SIZE ## _h4v6_c; \
  392. dsp->put_vp8_epel_pixels_tab[IDX][2][2] = put_vp8_epel ## SIZE ## _h6v6_c
  393. #define VP8_BILINEAR_MC_FUNC(IDX, SIZE) \
  394. dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
  395. dsp->put_vp8_bilinear_pixels_tab[IDX][0][1] = put_vp8_bilinear ## SIZE ## _h_c; \
  396. dsp->put_vp8_bilinear_pixels_tab[IDX][0][2] = put_vp8_bilinear ## SIZE ## _h_c; \
  397. dsp->put_vp8_bilinear_pixels_tab[IDX][1][0] = put_vp8_bilinear ## SIZE ## _v_c; \
  398. dsp->put_vp8_bilinear_pixels_tab[IDX][1][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
  399. dsp->put_vp8_bilinear_pixels_tab[IDX][1][2] = put_vp8_bilinear ## SIZE ## _hv_c; \
  400. dsp->put_vp8_bilinear_pixels_tab[IDX][2][0] = put_vp8_bilinear ## SIZE ## _v_c; \
  401. dsp->put_vp8_bilinear_pixels_tab[IDX][2][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
  402. dsp->put_vp8_bilinear_pixels_tab[IDX][2][2] = put_vp8_bilinear ## SIZE ## _hv_c
  403. av_cold void ff_vp8dsp_init(VP8DSPContext *dsp)
  404. {
  405. dsp->vp8_luma_dc_wht = vp8_luma_dc_wht_c;
  406. dsp->vp8_idct_add = vp8_idct_add_c;
  407. dsp->vp8_idct_dc_add = vp8_idct_dc_add_c;
  408. dsp->vp8_v_loop_filter16y = vp8_v_loop_filter16_c;
  409. dsp->vp8_h_loop_filter16y = vp8_h_loop_filter16_c;
  410. dsp->vp8_v_loop_filter8uv = vp8_v_loop_filter8uv_c;
  411. dsp->vp8_h_loop_filter8uv = vp8_h_loop_filter8uv_c;
  412. dsp->vp8_v_loop_filter16y_inner = vp8_v_loop_filter16_inner_c;
  413. dsp->vp8_h_loop_filter16y_inner = vp8_h_loop_filter16_inner_c;
  414. dsp->vp8_v_loop_filter8uv_inner = vp8_v_loop_filter8uv_inner_c;
  415. dsp->vp8_h_loop_filter8uv_inner = vp8_h_loop_filter8uv_inner_c;
  416. dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c;
  417. dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c;
  418. VP8_MC_FUNC(0, 16);
  419. VP8_MC_FUNC(1, 8);
  420. VP8_MC_FUNC(2, 4);
  421. VP8_BILINEAR_MC_FUNC(0, 16);
  422. VP8_BILINEAR_MC_FUNC(1, 8);
  423. VP8_BILINEAR_MC_FUNC(2, 4);
  424. if (HAVE_MMX)
  425. ff_vp8dsp_init_x86(dsp);
  426. if (HAVE_ALTIVEC)
  427. ff_vp8dsp_init_altivec(dsp);
  428. }