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.

510 lines
16KB

  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. block[0*4+i] = 0;
  63. block[1*4+i] = 0;
  64. block[2*4+i] = 0;
  65. block[3*4+i] = 0;
  66. tmp[i*4+0] = t0 + t3;
  67. tmp[i*4+1] = t1 + t2;
  68. tmp[i*4+2] = t1 - t2;
  69. tmp[i*4+3] = t0 - t3;
  70. }
  71. for (i = 0; i < 4; i++) {
  72. t0 = tmp[0*4+i] + tmp[2*4+i];
  73. t1 = tmp[0*4+i] - tmp[2*4+i];
  74. t2 = MUL_35468(tmp[1*4+i]) - MUL_20091(tmp[3*4+i]);
  75. t3 = MUL_20091(tmp[1*4+i]) + MUL_35468(tmp[3*4+i]);
  76. dst[0] = cm[dst[0] + ((t0 + t3 + 4) >> 3)];
  77. dst[1] = cm[dst[1] + ((t1 + t2 + 4) >> 3)];
  78. dst[2] = cm[dst[2] + ((t1 - t2 + 4) >> 3)];
  79. dst[3] = cm[dst[3] + ((t0 - t3 + 4) >> 3)];
  80. dst += stride;
  81. }
  82. }
  83. static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], int stride)
  84. {
  85. int i, dc = (block[0] + 4) >> 3;
  86. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc;
  87. block[0] = 0;
  88. for (i = 0; i < 4; i++) {
  89. dst[0] = cm[dst[0]];
  90. dst[1] = cm[dst[1]];
  91. dst[2] = cm[dst[2]];
  92. dst[3] = cm[dst[3]];
  93. dst += stride;
  94. }
  95. }
  96. static void vp8_idct_dc_add4uv_c(uint8_t *dst, DCTELEM block[4][16], int stride)
  97. {
  98. vp8_idct_dc_add_c(dst+stride*0+0, block[0], stride);
  99. vp8_idct_dc_add_c(dst+stride*0+4, block[1], stride);
  100. vp8_idct_dc_add_c(dst+stride*4+0, block[2], stride);
  101. vp8_idct_dc_add_c(dst+stride*4+4, block[3], stride);
  102. }
  103. static void vp8_idct_dc_add4y_c(uint8_t *dst, DCTELEM block[4][16], int stride)
  104. {
  105. vp8_idct_dc_add_c(dst+ 0, block[0], stride);
  106. vp8_idct_dc_add_c(dst+ 4, block[1], stride);
  107. vp8_idct_dc_add_c(dst+ 8, block[2], stride);
  108. vp8_idct_dc_add_c(dst+12, block[3], stride);
  109. }
  110. // because I like only having two parameters to pass functions...
  111. #define LOAD_PIXELS\
  112. int av_unused p3 = p[-4*stride];\
  113. int av_unused p2 = p[-3*stride];\
  114. int av_unused p1 = p[-2*stride];\
  115. int av_unused p0 = p[-1*stride];\
  116. int av_unused q0 = p[ 0*stride];\
  117. int av_unused q1 = p[ 1*stride];\
  118. int av_unused q2 = p[ 2*stride];\
  119. int av_unused q3 = p[ 3*stride];
  120. #define clip_int8(n) (cm[n+0x80]-0x80)
  121. static av_always_inline void filter_common(uint8_t *p, int stride, int is4tap)
  122. {
  123. LOAD_PIXELS
  124. int a, f1, f2;
  125. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
  126. a = 3*(q0 - p0);
  127. if (is4tap)
  128. a += clip_int8(p1 - q1);
  129. a = clip_int8(a);
  130. // We deviate from the spec here with c(a+3) >> 3
  131. // since that's what libvpx does.
  132. f1 = FFMIN(a+4, 127) >> 3;
  133. f2 = FFMIN(a+3, 127) >> 3;
  134. // Despite what the spec says, we do need to clamp here to
  135. // be bitexact with libvpx.
  136. p[-1*stride] = cm[p0 + f2];
  137. p[ 0*stride] = cm[q0 - f1];
  138. // only used for _inner on blocks without high edge variance
  139. if (!is4tap) {
  140. a = (f1+1)>>1;
  141. p[-2*stride] = cm[p1 + a];
  142. p[ 1*stride] = cm[q1 - a];
  143. }
  144. }
  145. static av_always_inline int simple_limit(uint8_t *p, int stride, int flim)
  146. {
  147. LOAD_PIXELS
  148. return 2*FFABS(p0-q0) + (FFABS(p1-q1) >> 1) <= flim;
  149. }
  150. /**
  151. * E - limit at the macroblock edge
  152. * I - limit for interior difference
  153. */
  154. static av_always_inline int normal_limit(uint8_t *p, int stride, int E, int I)
  155. {
  156. LOAD_PIXELS
  157. return simple_limit(p, stride, E)
  158. && FFABS(p3-p2) <= I && FFABS(p2-p1) <= I && FFABS(p1-p0) <= I
  159. && FFABS(q3-q2) <= I && FFABS(q2-q1) <= I && FFABS(q1-q0) <= I;
  160. }
  161. // high edge variance
  162. static av_always_inline int hev(uint8_t *p, int stride, int thresh)
  163. {
  164. LOAD_PIXELS
  165. return FFABS(p1-p0) > thresh || FFABS(q1-q0) > thresh;
  166. }
  167. static av_always_inline void filter_mbedge(uint8_t *p, int stride)
  168. {
  169. int a0, a1, a2, w;
  170. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
  171. LOAD_PIXELS
  172. w = clip_int8(p1-q1);
  173. w = clip_int8(w + 3*(q0-p0));
  174. a0 = (27*w + 63) >> 7;
  175. a1 = (18*w + 63) >> 7;
  176. a2 = ( 9*w + 63) >> 7;
  177. p[-3*stride] = cm[p2 + a2];
  178. p[-2*stride] = cm[p1 + a1];
  179. p[-1*stride] = cm[p0 + a0];
  180. p[ 0*stride] = cm[q0 - a0];
  181. p[ 1*stride] = cm[q1 - a1];
  182. p[ 2*stride] = cm[q2 - a2];
  183. }
  184. #define LOOP_FILTER(dir, size, stridea, strideb, maybe_inline) \
  185. static maybe_inline void vp8_ ## dir ## _loop_filter ## size ## _c(uint8_t *dst, int stride,\
  186. int flim_E, int flim_I, int hev_thresh)\
  187. {\
  188. int i;\
  189. \
  190. for (i = 0; i < size; i++)\
  191. if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\
  192. if (hev(dst+i*stridea, strideb, hev_thresh))\
  193. filter_common(dst+i*stridea, strideb, 1);\
  194. else\
  195. filter_mbedge(dst+i*stridea, strideb);\
  196. }\
  197. }\
  198. \
  199. static maybe_inline void vp8_ ## dir ## _loop_filter ## size ## _inner_c(uint8_t *dst, int stride,\
  200. int flim_E, int flim_I, int hev_thresh)\
  201. {\
  202. int i;\
  203. \
  204. for (i = 0; i < size; i++)\
  205. if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\
  206. int hv = hev(dst+i*stridea, strideb, hev_thresh);\
  207. if (hv) \
  208. filter_common(dst+i*stridea, strideb, 1);\
  209. else \
  210. filter_common(dst+i*stridea, strideb, 0);\
  211. }\
  212. }
  213. LOOP_FILTER(v, 16, 1, stride,)
  214. LOOP_FILTER(h, 16, stride, 1,)
  215. #define UV_LOOP_FILTER(dir, stridea, strideb) \
  216. LOOP_FILTER(dir, 8, stridea, strideb, av_always_inline) \
  217. static void vp8_ ## dir ## _loop_filter8uv_c(uint8_t *dstU, uint8_t *dstV, int stride,\
  218. int fE, int fI, int hev_thresh)\
  219. {\
  220. vp8_ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh);\
  221. vp8_ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh);\
  222. }\
  223. static void vp8_ ## dir ## _loop_filter8uv_inner_c(uint8_t *dstU, uint8_t *dstV, int stride,\
  224. int fE, int fI, int hev_thresh)\
  225. {\
  226. vp8_ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, hev_thresh);\
  227. vp8_ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, hev_thresh);\
  228. }
  229. UV_LOOP_FILTER(v, 1, stride)
  230. UV_LOOP_FILTER(h, stride, 1)
  231. static void vp8_v_loop_filter_simple_c(uint8_t *dst, int stride, int flim)
  232. {
  233. int i;
  234. for (i = 0; i < 16; i++)
  235. if (simple_limit(dst+i, stride, flim))
  236. filter_common(dst+i, stride, 1);
  237. }
  238. static void vp8_h_loop_filter_simple_c(uint8_t *dst, int stride, int flim)
  239. {
  240. int i;
  241. for (i = 0; i < 16; i++)
  242. if (simple_limit(dst+i*stride, 1, flim))
  243. filter_common(dst+i*stride, 1, 1);
  244. }
  245. static const uint8_t subpel_filters[7][6] = {
  246. { 0, 6, 123, 12, 1, 0 },
  247. { 2, 11, 108, 36, 8, 1 },
  248. { 0, 9, 93, 50, 6, 0 },
  249. { 3, 16, 77, 77, 16, 3 },
  250. { 0, 6, 50, 93, 9, 0 },
  251. { 1, 8, 36, 108, 11, 2 },
  252. { 0, 1, 12, 123, 6, 0 },
  253. };
  254. #define PUT_PIXELS(WIDTH) \
  255. static void put_vp8_pixels ## WIDTH ##_c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int x, int y) { \
  256. int i; \
  257. for (i = 0; i < h; i++, dst+= dststride, src+= srcstride) { \
  258. memcpy(dst, src, WIDTH); \
  259. } \
  260. }
  261. PUT_PIXELS(16)
  262. PUT_PIXELS(8)
  263. PUT_PIXELS(4)
  264. #define FILTER_6TAP(src, F, stride) \
  265. cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + F[0]*src[x-2*stride] + \
  266. F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + F[5]*src[x+3*stride] + 64) >> 7]
  267. #define FILTER_4TAP(src, F, stride) \
  268. cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + \
  269. F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + 64) >> 7]
  270. #define VP8_EPEL_H(SIZE, FILTER, FILTERNAME) \
  271. static void put_vp8_epel ## SIZE ## _ ## FILTERNAME ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
  272. { \
  273. const uint8_t *filter = subpel_filters[mx-1]; \
  274. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
  275. int x, y; \
  276. \
  277. for (y = 0; y < h; y++) { \
  278. for (x = 0; x < SIZE; x++) \
  279. dst[x] = FILTER(src, filter, 1); \
  280. dst += dststride; \
  281. src += srcstride; \
  282. } \
  283. }
  284. #define VP8_EPEL_V(SIZE, FILTER, FILTERNAME) \
  285. static void put_vp8_epel ## SIZE ## _ ## FILTERNAME ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
  286. { \
  287. const uint8_t *filter = subpel_filters[my-1]; \
  288. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
  289. int x, y; \
  290. \
  291. for (y = 0; y < h; y++) { \
  292. for (x = 0; x < SIZE; x++) \
  293. dst[x] = FILTER(src, filter, srcstride); \
  294. dst += dststride; \
  295. src += srcstride; \
  296. } \
  297. }
  298. #define VP8_EPEL_HV(SIZE, FILTERX, FILTERY, FILTERNAME) \
  299. static void put_vp8_epel ## SIZE ## _ ## FILTERNAME ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
  300. { \
  301. const uint8_t *filter = subpel_filters[mx-1]; \
  302. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
  303. int x, y; \
  304. uint8_t tmp_array[(2*SIZE+5)*SIZE]; \
  305. uint8_t *tmp = tmp_array; \
  306. src -= 2*srcstride; \
  307. \
  308. for (y = 0; y < h+5; y++) { \
  309. for (x = 0; x < SIZE; x++) \
  310. tmp[x] = FILTERX(src, filter, 1); \
  311. tmp += SIZE; \
  312. src += srcstride; \
  313. } \
  314. \
  315. tmp = tmp_array + 2*SIZE; \
  316. filter = subpel_filters[my-1]; \
  317. \
  318. for (y = 0; y < h; y++) { \
  319. for (x = 0; x < SIZE; x++) \
  320. dst[x] = FILTERY(tmp, filter, SIZE); \
  321. dst += dststride; \
  322. tmp += SIZE; \
  323. } \
  324. }
  325. VP8_EPEL_H(16, FILTER_4TAP, h4)
  326. VP8_EPEL_H(8, FILTER_4TAP, h4)
  327. VP8_EPEL_H(4, FILTER_4TAP, h4)
  328. VP8_EPEL_H(16, FILTER_6TAP, h6)
  329. VP8_EPEL_H(8, FILTER_6TAP, h6)
  330. VP8_EPEL_H(4, FILTER_6TAP, h6)
  331. VP8_EPEL_V(16, FILTER_4TAP, v4)
  332. VP8_EPEL_V(8, FILTER_4TAP, v4)
  333. VP8_EPEL_V(4, FILTER_4TAP, v4)
  334. VP8_EPEL_V(16, FILTER_6TAP, v6)
  335. VP8_EPEL_V(8, FILTER_6TAP, v6)
  336. VP8_EPEL_V(4, FILTER_6TAP, v6)
  337. VP8_EPEL_HV(16, FILTER_4TAP, FILTER_4TAP, h4v4)
  338. VP8_EPEL_HV(8, FILTER_4TAP, FILTER_4TAP, h4v4)
  339. VP8_EPEL_HV(4, FILTER_4TAP, FILTER_4TAP, h4v4)
  340. VP8_EPEL_HV(16, FILTER_4TAP, FILTER_6TAP, h4v6)
  341. VP8_EPEL_HV(8, FILTER_4TAP, FILTER_6TAP, h4v6)
  342. VP8_EPEL_HV(4, FILTER_4TAP, FILTER_6TAP, h4v6)
  343. VP8_EPEL_HV(16, FILTER_6TAP, FILTER_4TAP, h6v4)
  344. VP8_EPEL_HV(8, FILTER_6TAP, FILTER_4TAP, h6v4)
  345. VP8_EPEL_HV(4, FILTER_6TAP, FILTER_4TAP, h6v4)
  346. VP8_EPEL_HV(16, FILTER_6TAP, FILTER_6TAP, h6v6)
  347. VP8_EPEL_HV(8, FILTER_6TAP, FILTER_6TAP, h6v6)
  348. VP8_EPEL_HV(4, FILTER_6TAP, FILTER_6TAP, h6v6)
  349. #define VP8_BILINEAR(SIZE) \
  350. static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, int stride, uint8_t *src, int s2, int h, int mx, int my) \
  351. { \
  352. int a = 8-mx, b = mx; \
  353. int x, y; \
  354. \
  355. for (y = 0; y < h; y++) { \
  356. for (x = 0; x < SIZE; x++) \
  357. dst[x] = (a*src[x] + b*src[x+1] + 4) >> 3; \
  358. dst += stride; \
  359. src += stride; \
  360. } \
  361. } \
  362. static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, int stride, uint8_t *src, int s2, int h, int mx, int my) \
  363. { \
  364. int c = 8-my, d = my; \
  365. int x, y; \
  366. \
  367. for (y = 0; y < h; y++) { \
  368. for (x = 0; x < SIZE; x++) \
  369. dst[x] = (c*src[x] + d*src[x+stride] + 4) >> 3; \
  370. dst += stride; \
  371. src += stride; \
  372. } \
  373. } \
  374. \
  375. static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, int stride, uint8_t *src, int s2, int h, int mx, int my) \
  376. { \
  377. int a = 8-mx, b = mx; \
  378. int c = 8-my, d = my; \
  379. int x, y; \
  380. uint8_t tmp_array[(2*SIZE+1)*SIZE]; \
  381. uint8_t *tmp = tmp_array; \
  382. \
  383. for (y = 0; y < h+1; y++) { \
  384. for (x = 0; x < SIZE; x++) \
  385. tmp[x] = (a*src[x] + b*src[x+1] + 4) >> 3; \
  386. tmp += SIZE; \
  387. src += stride; \
  388. } \
  389. \
  390. tmp = tmp_array; \
  391. \
  392. for (y = 0; y < h; y++) { \
  393. for (x = 0; x < SIZE; x++) \
  394. dst[x] = (c*tmp[x] + d*tmp[x+SIZE] + 4) >> 3; \
  395. dst += stride; \
  396. tmp += SIZE; \
  397. } \
  398. }
  399. VP8_BILINEAR(16)
  400. VP8_BILINEAR(8)
  401. VP8_BILINEAR(4)
  402. #define VP8_MC_FUNC(IDX, SIZE) \
  403. dsp->put_vp8_epel_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
  404. dsp->put_vp8_epel_pixels_tab[IDX][0][1] = put_vp8_epel ## SIZE ## _h4_c; \
  405. dsp->put_vp8_epel_pixels_tab[IDX][0][2] = put_vp8_epel ## SIZE ## _h6_c; \
  406. dsp->put_vp8_epel_pixels_tab[IDX][1][0] = put_vp8_epel ## SIZE ## _v4_c; \
  407. dsp->put_vp8_epel_pixels_tab[IDX][1][1] = put_vp8_epel ## SIZE ## _h4v4_c; \
  408. dsp->put_vp8_epel_pixels_tab[IDX][1][2] = put_vp8_epel ## SIZE ## _h6v4_c; \
  409. dsp->put_vp8_epel_pixels_tab[IDX][2][0] = put_vp8_epel ## SIZE ## _v6_c; \
  410. dsp->put_vp8_epel_pixels_tab[IDX][2][1] = put_vp8_epel ## SIZE ## _h4v6_c; \
  411. dsp->put_vp8_epel_pixels_tab[IDX][2][2] = put_vp8_epel ## SIZE ## _h6v6_c
  412. #define VP8_BILINEAR_MC_FUNC(IDX, SIZE) \
  413. dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
  414. dsp->put_vp8_bilinear_pixels_tab[IDX][0][1] = put_vp8_bilinear ## SIZE ## _h_c; \
  415. dsp->put_vp8_bilinear_pixels_tab[IDX][0][2] = put_vp8_bilinear ## SIZE ## _h_c; \
  416. dsp->put_vp8_bilinear_pixels_tab[IDX][1][0] = put_vp8_bilinear ## SIZE ## _v_c; \
  417. dsp->put_vp8_bilinear_pixels_tab[IDX][1][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
  418. dsp->put_vp8_bilinear_pixels_tab[IDX][1][2] = put_vp8_bilinear ## SIZE ## _hv_c; \
  419. dsp->put_vp8_bilinear_pixels_tab[IDX][2][0] = put_vp8_bilinear ## SIZE ## _v_c; \
  420. dsp->put_vp8_bilinear_pixels_tab[IDX][2][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
  421. dsp->put_vp8_bilinear_pixels_tab[IDX][2][2] = put_vp8_bilinear ## SIZE ## _hv_c
  422. av_cold void ff_vp8dsp_init(VP8DSPContext *dsp)
  423. {
  424. dsp->vp8_luma_dc_wht = vp8_luma_dc_wht_c;
  425. dsp->vp8_idct_add = vp8_idct_add_c;
  426. dsp->vp8_idct_dc_add = vp8_idct_dc_add_c;
  427. dsp->vp8_idct_dc_add4y = vp8_idct_dc_add4y_c;
  428. dsp->vp8_idct_dc_add4uv = vp8_idct_dc_add4uv_c;
  429. dsp->vp8_v_loop_filter16y = vp8_v_loop_filter16_c;
  430. dsp->vp8_h_loop_filter16y = vp8_h_loop_filter16_c;
  431. dsp->vp8_v_loop_filter8uv = vp8_v_loop_filter8uv_c;
  432. dsp->vp8_h_loop_filter8uv = vp8_h_loop_filter8uv_c;
  433. dsp->vp8_v_loop_filter16y_inner = vp8_v_loop_filter16_inner_c;
  434. dsp->vp8_h_loop_filter16y_inner = vp8_h_loop_filter16_inner_c;
  435. dsp->vp8_v_loop_filter8uv_inner = vp8_v_loop_filter8uv_inner_c;
  436. dsp->vp8_h_loop_filter8uv_inner = vp8_h_loop_filter8uv_inner_c;
  437. dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c;
  438. dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c;
  439. VP8_MC_FUNC(0, 16);
  440. VP8_MC_FUNC(1, 8);
  441. VP8_MC_FUNC(2, 4);
  442. VP8_BILINEAR_MC_FUNC(0, 16);
  443. VP8_BILINEAR_MC_FUNC(1, 8);
  444. VP8_BILINEAR_MC_FUNC(2, 4);
  445. if (HAVE_MMX)
  446. ff_vp8dsp_init_x86(dsp);
  447. if (HAVE_ALTIVEC)
  448. ff_vp8dsp_init_altivec(dsp);
  449. }