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.

530 lines
17KB

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