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.

532 lines
16KB

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