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.

495 lines
23KB

  1. /*
  2. * VC-1 and WMV3 - DSP functions MMX-optimized
  3. * Copyright (c) 2007 Christophe GISQUET <christophe.gisquet@free.fr>
  4. *
  5. * Permission is hereby granted, free of charge, to any person
  6. * obtaining a copy of this software and associated documentation
  7. * files (the "Software"), to deal in the Software without
  8. * restriction, including without limitation the rights to use,
  9. * copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the
  11. * Software is furnished to do so, subject to the following
  12. * conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be
  15. * included in all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  18. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  19. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  20. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  21. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  22. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  23. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  24. * OTHER DEALINGS IN THE SOFTWARE.
  25. */
  26. #include "dsputil.h"
  27. #include "dsputil_mmx.h"
  28. #include "x86_cpu.h"
  29. /** Add rounder from mm7 to mm3 and pack result at destination */
  30. #define NORMALIZE_MMX(SHIFT) \
  31. "paddw %%mm7, %%mm3 \n\t" /* +bias-r */ \
  32. "paddw %%mm7, %%mm4 \n\t" /* +bias-r */ \
  33. "psraw "SHIFT", %%mm3 \n\t" \
  34. "psraw "SHIFT", %%mm4 \n\t"
  35. #define TRANSFER_DO_PACK \
  36. "packuswb %%mm4, %%mm3 \n\t" \
  37. "movq %%mm3, (%2) \n\t"
  38. #define TRANSFER_DONT_PACK \
  39. "movq %%mm3, 0(%2) \n\t" \
  40. "movq %%mm4, 8(%2) \n\t"
  41. /** @see MSPEL_FILTER13_CORE for use as UNPACK macro */
  42. #define DO_UNPACK(reg) "punpcklbw %%mm0, " reg "\n\t"
  43. #define DONT_UNPACK(reg)
  44. /** Compute the rounder 32-r or 8-r and unpacks it to mm7 */
  45. #define LOAD_ROUNDER_MMX(ROUND) \
  46. "movd "ROUND", %%mm7 \n\t" \
  47. "punpcklwd %%mm7, %%mm7 \n\t" \
  48. "punpckldq %%mm7, %%mm7 \n\t"
  49. #define SHIFT2_LINE(OFF, R0,R1,R2,R3) \
  50. "paddw %%mm"#R2", %%mm"#R1" \n\t" \
  51. "movd (%1,%4), %%mm"#R0" \n\t" \
  52. "pmullw %%mm6, %%mm"#R1" \n\t" \
  53. "punpcklbw %%mm0, %%mm"#R0" \n\t" \
  54. "movd (%1,%3), %%mm"#R3" \n\t" \
  55. "psubw %%mm"#R0", %%mm"#R1" \n\t" \
  56. "punpcklbw %%mm0, %%mm"#R3" \n\t" \
  57. "paddw %%mm7, %%mm"#R1" \n\t" \
  58. "psubw %%mm"#R3", %%mm"#R1" \n\t" \
  59. "psraw %5, %%mm"#R1" \n\t" \
  60. "movq %%mm"#R1", "#OFF"(%2) \n\t" \
  61. "add %3, %1 \n\t"
  62. DECLARE_ALIGNED_16(static const uint64_t, fact_9) = 0x0009000900090009ULL;
  63. /** Sacrifying mm6 allows to pipeline loads from src */
  64. static void vc1_put_ver_16b_shift2_mmx(int16_t *dst,
  65. const uint8_t *src, long int stride,
  66. int rnd, int64_t shift)
  67. {
  68. int w = 3;
  69. asm volatile(
  70. LOAD_ROUNDER_MMX("%6")
  71. "movq %7, %%mm6 \n\t"
  72. "1: \n\t"
  73. "movd (%1), %%mm2 \n\t"
  74. "add %3, %1 \n\t"
  75. "movd (%1), %%mm3 \n\t"
  76. "punpcklbw %%mm0, %%mm2 \n\t"
  77. "punpcklbw %%mm0, %%mm3 \n\t"
  78. SHIFT2_LINE( 0, 1, 2, 3, 4)
  79. SHIFT2_LINE( 24, 2, 3, 4, 1)
  80. SHIFT2_LINE( 48, 3, 4, 1, 2)
  81. SHIFT2_LINE( 72, 4, 1, 2, 3)
  82. SHIFT2_LINE( 96, 1, 2, 3, 4)
  83. SHIFT2_LINE(120, 2, 3, 4, 1)
  84. SHIFT2_LINE(144, 3, 4, 1, 2)
  85. SHIFT2_LINE(168, 4, 1, 2, 3)
  86. "sub %8, %1 \n\t"
  87. "add $8, %2 \n\t"
  88. "dec %0 \n\t"
  89. "jnz 1b \n\t"
  90. : "+g"(w), "+r"(src), "+r"(dst)
  91. : "r"(stride), "r"(-2*stride), "m"(shift),
  92. "m"(rnd), "m"(fact_9), "g"(9*stride-4)
  93. : "memory"
  94. );
  95. }
  96. /**
  97. * Data is already unpacked, so some operations can directly be made from
  98. * memory.
  99. */
  100. static void vc1_put_hor_16b_shift2_mmx(uint8_t *dst, long int stride,
  101. const int16_t *src, int rnd)
  102. {
  103. int h = 8;
  104. src -= 1;
  105. rnd -= (-1+9+9-1)*1024; /* Add -1024 bias */
  106. asm volatile(
  107. LOAD_ROUNDER_MMX("%4")
  108. "movq %6, %%mm6 \n\t"
  109. "movq %5, %%mm5 \n\t"
  110. "1: \n\t"
  111. "movq 2*0+0(%1), %%mm1 \n\t"
  112. "movq 2*0+8(%1), %%mm2 \n\t"
  113. "movq 2*1+0(%1), %%mm3 \n\t"
  114. "movq 2*1+8(%1), %%mm4 \n\t"
  115. "paddw 2*3+0(%1), %%mm1 \n\t"
  116. "paddw 2*3+8(%1), %%mm2 \n\t"
  117. "paddw 2*2+0(%1), %%mm3 \n\t"
  118. "paddw 2*2+8(%1), %%mm4 \n\t"
  119. "pmullw %%mm5, %%mm3 \n\t"
  120. "pmullw %%mm5, %%mm4 \n\t"
  121. "psubw %%mm1, %%mm3 \n\t"
  122. "psubw %%mm2, %%mm4 \n\t"
  123. NORMALIZE_MMX("$7")
  124. /* Remove bias */
  125. "paddw %%mm6, %%mm3 \n\t"
  126. "paddw %%mm6, %%mm4 \n\t"
  127. TRANSFER_DO_PACK
  128. "add $24, %1 \n\t"
  129. "add %3, %2 \n\t"
  130. "dec %0 \n\t"
  131. "jnz 1b \n\t"
  132. : "+g"(h), "+r" (src), "+r" (dst)
  133. : "g"(stride), "m"(rnd), "m"(fact_9), "m"(ff_pw_128)
  134. : "memory"
  135. );
  136. }
  137. /**
  138. * Purely vertical or horizontal 1/2 shift interpolation.
  139. * Sacrify mm6 for *9 factor.
  140. */
  141. static void vc1_put_shift2_mmx(uint8_t *dst, const uint8_t *src,
  142. long int stride, int rnd, long int offset)
  143. {
  144. int h = 8;
  145. rnd = 8-rnd;
  146. asm volatile(
  147. LOAD_ROUNDER_MMX("%6")
  148. "movq %8, %%mm6 \n\t"
  149. "1: \n\t"
  150. "movd 0(%1 ), %%mm3 \n\t"
  151. "movd 4(%1 ), %%mm4 \n\t"
  152. "movd 0(%1,%3), %%mm1 \n\t"
  153. "movd 4(%1,%3), %%mm2 \n\t"
  154. "add %3, %1 \n\t"
  155. "punpcklbw %%mm0, %%mm3 \n\t"
  156. "punpcklbw %%mm0, %%mm4 \n\t"
  157. "punpcklbw %%mm0, %%mm1 \n\t"
  158. "punpcklbw %%mm0, %%mm2 \n\t"
  159. "paddw %%mm1, %%mm3 \n\t"
  160. "paddw %%mm2, %%mm4 \n\t"
  161. "movd 0(%1,%4), %%mm1 \n\t"
  162. "movd 4(%1,%4), %%mm2 \n\t"
  163. "pmullw %%mm6, %%mm3 \n\t" /* 0,9,9,0*/
  164. "pmullw %%mm6, %%mm4 \n\t" /* 0,9,9,0*/
  165. "punpcklbw %%mm0, %%mm1 \n\t"
  166. "punpcklbw %%mm0, %%mm2 \n\t"
  167. "psubw %%mm1, %%mm3 \n\t" /*-1,9,9,0*/
  168. "psubw %%mm2, %%mm4 \n\t" /*-1,9,9,0*/
  169. "movd 0(%1,%3), %%mm1 \n\t"
  170. "movd 4(%1,%3), %%mm2 \n\t"
  171. "punpcklbw %%mm0, %%mm1 \n\t"
  172. "punpcklbw %%mm0, %%mm2 \n\t"
  173. "psubw %%mm1, %%mm3 \n\t" /*-1,9,9,-1*/
  174. "psubw %%mm2, %%mm4 \n\t" /*-1,9,9,-1*/
  175. NORMALIZE_MMX("$4")
  176. TRANSFER_DO_PACK
  177. "add %7, %1 \n\t"
  178. "add %5, %2 \n\t"
  179. "dec %0 \n\t"
  180. "jnz 1b \n\t"
  181. : "+g"(h), "+r"(src), "+r"(dst)
  182. : "r"(offset), "r"(-2*offset), "g"(stride), "m"(rnd),
  183. "g"(stride-offset), "m"(fact_9)
  184. : "memory"
  185. );
  186. }
  187. /**
  188. * Filter coefficients made global to allow access by all 1 or 3 quarter shift
  189. * interpolation functions.
  190. */
  191. DECLARE_ALIGNED_16(static const uint64_t, fact_53) = 0x0035003500350035ULL;
  192. DECLARE_ALIGNED_16(static const uint64_t, fact_18) = 0x0012001200120012ULL;
  193. /**
  194. * Core of the 1/4 and 3/4 shift bicubic interpolation.
  195. *
  196. * @param UNPACK Macro unpacking arguments from 8 to 16bits (can be empty).
  197. * @param MOVQ "movd 1" or "movq 2", if data read is already unpacked.
  198. * @param A1 Address of 1st tap (beware of unpacked/packed).
  199. * @param A2 Address of 2nd tap
  200. * @param A3 Address of 3rd tap
  201. * @param A4 Address of 4th tap
  202. */
  203. #define MSPEL_FILTER13_CORE(UNPACK, MOVQ, A1, A2, A3, A4, POS) \
  204. MOVQ "*0+"A1", %%mm1 \n\t" \
  205. MOVQ "*4+"A1", %%mm2 \n\t" \
  206. UNPACK("%%mm1") \
  207. UNPACK("%%mm2") \
  208. "pmullw "POS", %%mm1 \n\t" \
  209. "pmullw "POS", %%mm2 \n\t" \
  210. MOVQ "*0+"A2", %%mm3 \n\t" \
  211. MOVQ "*4+"A2", %%mm4 \n\t" \
  212. UNPACK("%%mm3") \
  213. UNPACK("%%mm4") \
  214. "pmullw %%mm6, %%mm3 \n\t" /* *18 */ \
  215. "pmullw %%mm6, %%mm4 \n\t" /* *18 */ \
  216. "psubw %%mm1, %%mm3 \n\t" /* 18,-3 */ \
  217. "psubw %%mm2, %%mm4 \n\t" /* 18,-3 */ \
  218. MOVQ "*0+"A4", %%mm1 \n\t" \
  219. MOVQ "*4+"A4", %%mm2 \n\t" \
  220. UNPACK("%%mm1") \
  221. UNPACK("%%mm2") \
  222. "psllw $2, %%mm1 \n\t" /* 4* */ \
  223. "psllw $2, %%mm2 \n\t" /* 4* */ \
  224. "psubw %%mm1, %%mm3 \n\t" /* -4,18,-3 */ \
  225. "psubw %%mm2, %%mm4 \n\t" /* -4,18,-3 */ \
  226. MOVQ "*0+"A3", %%mm1 \n\t" \
  227. MOVQ "*4+"A3", %%mm2 \n\t" \
  228. UNPACK("%%mm1") \
  229. UNPACK("%%mm2") \
  230. "pmullw %%mm5, %%mm1 \n\t" /* *53 */ \
  231. "pmullw %%mm5, %%mm2 \n\t" /* *53 */ \
  232. "paddw %%mm1, %%mm3 \n\t" /* 4,53,18,-3 */ \
  233. "paddw %%mm2, %%mm4 \n\t" /* 4,53,18,-3 */
  234. /**
  235. * Macro to build the vertical 16bits version of vc1_put_shift[13].
  236. * Here, offset=src_stride. Parameters passed A1 to A4 must use
  237. * %3 (src_stride) and %4 (3*src_stride).
  238. *
  239. * @param NAME Either 1 or 3
  240. * @see MSPEL_FILTER13_CORE for information on A1->A4
  241. */
  242. #define MSPEL_FILTER13_VER_16B(NAME, A1, A2, A3, A4) \
  243. static void \
  244. vc1_put_ver_16b_ ## NAME ## _mmx(int16_t *dst, const uint8_t *src, \
  245. long int src_stride, \
  246. int rnd, int64_t shift) \
  247. { \
  248. int h = 8; \
  249. src -= src_stride; \
  250. asm volatile( \
  251. LOAD_ROUNDER_MMX("%5") \
  252. "movq %7, %%mm5 \n\t" \
  253. "movq %8, %%mm6 \n\t" \
  254. ASMALIGN(3) \
  255. "1: \n\t" \
  256. MSPEL_FILTER13_CORE(DO_UNPACK, "movd 1", A1, A2, A3, A4, "%9") \
  257. NORMALIZE_MMX("%6") \
  258. TRANSFER_DONT_PACK \
  259. /* Last 3 (in fact 4) bytes on the line */ \
  260. "movd 8+"A1", %%mm1 \n\t" \
  261. DO_UNPACK("%%mm1") \
  262. "movq %%mm1, %%mm3 \n\t" \
  263. "paddw %%mm1, %%mm1 \n\t" \
  264. "paddw %%mm3, %%mm1 \n\t" /* 3* */ \
  265. "movd 8+"A2", %%mm3 \n\t" \
  266. DO_UNPACK("%%mm3") \
  267. "pmullw %%mm6, %%mm3 \n\t" /* *18 */ \
  268. "psubw %%mm1, %%mm3 \n\t" /*18,-3 */ \
  269. "movd 8+"A3", %%mm1 \n\t" \
  270. DO_UNPACK("%%mm1") \
  271. "pmullw %%mm5, %%mm1 \n\t" /* *53 */ \
  272. "paddw %%mm1, %%mm3 \n\t" /*53,18,-3 */ \
  273. "movd 8+"A4", %%mm1 \n\t" \
  274. DO_UNPACK("%%mm1") \
  275. "psllw $2, %%mm1 \n\t" /* 4* */ \
  276. "psubw %%mm1, %%mm3 \n\t" \
  277. "paddw %%mm7, %%mm3 \n\t" \
  278. "psraw %6, %%mm3 \n\t" \
  279. "movq %%mm3, 16(%2) \n\t" \
  280. "add %3, %1 \n\t" \
  281. "add $24, %2 \n\t" \
  282. "dec %0 \n\t" \
  283. "jnz 1b \n\t" \
  284. : "+g"(h), "+r" (src), "+r" (dst) \
  285. : "r"(src_stride), "r"(3*src_stride), \
  286. "m"(rnd), "m"(shift), \
  287. "m"(fact_53), "m"(fact_18), "m"(ff_pw_3) \
  288. : "memory" \
  289. ); \
  290. }
  291. /**
  292. * Macro to build the horizontal 16bits version of vc1_put_shift[13].
  293. * Here, offset=16bits, so parameters passed A1 to A4 should be simple.
  294. *
  295. * @param NAME Either 1 or 3
  296. * @see MSPEL_FILTER13_CORE for information on A1->A4
  297. */
  298. #define MSPEL_FILTER13_HOR_16B(NAME, A1, A2, A3, A4) \
  299. static void \
  300. vc1_put_hor_16b_ ## NAME ## _mmx(uint8_t *dst, long int stride, \
  301. const int16_t *src, int rnd) \
  302. { \
  303. int h = 8; \
  304. src -= 1; \
  305. rnd -= (-4+58+13-3)*256; /* Add -256 bias */ \
  306. asm volatile( \
  307. LOAD_ROUNDER_MMX("%4") \
  308. "movq %6, %%mm6 \n\t" \
  309. "movq %5, %%mm5 \n\t" \
  310. ASMALIGN(3) \
  311. "1: \n\t" \
  312. MSPEL_FILTER13_CORE(DONT_UNPACK, "movq 2", A1, A2, A3, A4, "%8")\
  313. NORMALIZE_MMX("$7") \
  314. /* Remove bias */ \
  315. "paddw %7, %%mm3 \n\t" \
  316. "paddw %7, %%mm4 \n\t" \
  317. TRANSFER_DO_PACK \
  318. "add $24, %1 \n\t" \
  319. "add %3, %2 \n\t" \
  320. "dec %0 \n\t" \
  321. "jnz 1b \n\t" \
  322. : "+g"(h), "+r" (src), "+r" (dst) \
  323. : "g"(stride), "m"(rnd), "m"(fact_53), "m"(fact_18), \
  324. "m"(ff_pw_128), "m"(ff_pw_3) \
  325. : "memory" \
  326. ); \
  327. }
  328. /**
  329. * Macro to build the 8bits, any direction, version of vc1_put_shift[13].
  330. * Here, offset=src_stride. Parameters passed A1 to A4 must use
  331. * %3 (offset) and %4 (3*offset).
  332. *
  333. * @param NAME Either 1 or 3
  334. * @see MSPEL_FILTER13_CORE for information on A1->A4
  335. */
  336. #define MSPEL_FILTER13_8B(NAME, A1, A2, A3, A4) \
  337. static void \
  338. vc1_put_## NAME ## _mmx(uint8_t *dst, const uint8_t *src, \
  339. long int stride, int rnd, long int offset) \
  340. { \
  341. int h = 8; \
  342. src -= offset; \
  343. rnd = 32-rnd; \
  344. asm volatile ( \
  345. LOAD_ROUNDER_MMX("%6") \
  346. "movq %7, %%mm5 \n\t" \
  347. "movq %8, %%mm6 \n\t" \
  348. ASMALIGN(3) \
  349. "1: \n\t" \
  350. MSPEL_FILTER13_CORE(DO_UNPACK, "movd 1", A1, A2, A3, A4, "%9")\
  351. NORMALIZE_MMX("$6") \
  352. TRANSFER_DO_PACK \
  353. "add %5, %1 \n\t" \
  354. "add %5, %2 \n\t" \
  355. "dec %0 \n\t" \
  356. "jnz 1b \n\t" \
  357. : "+g"(h), "+r" (src), "+r" (dst) \
  358. : "r"(offset), "r"(3*offset), "g"(stride), "m"(rnd), \
  359. "m"(fact_53), "m"(fact_18), "m"(ff_pw_3) \
  360. : "memory" \
  361. ); \
  362. }
  363. /** 1/4 shift bicubic interpolation */
  364. MSPEL_FILTER13_8B (shift1, "0(%1,%4 )", "0(%1,%3,2)", "0(%1,%3 )", "0(%1 )")
  365. MSPEL_FILTER13_VER_16B(shift1, "0(%1,%4 )", "0(%1,%3,2)", "0(%1,%3 )", "0(%1 )")
  366. MSPEL_FILTER13_HOR_16B(shift1, "2*3(%1)", "2*2(%1)", "2*1(%1)", "2*0(%1)")
  367. /** 3/4 shift bicubic interpolation */
  368. MSPEL_FILTER13_8B (shift3, "0(%1 )", "0(%1,%3 )", "0(%1,%3,2)", "0(%1,%4 )")
  369. MSPEL_FILTER13_VER_16B(shift3, "0(%1 )", "0(%1,%3 )", "0(%1,%3,2)", "0(%1,%4 )")
  370. MSPEL_FILTER13_HOR_16B(shift3, "2*0(%1)", "2*1(%1)", "2*2(%1)", "2*3(%1)")
  371. typedef void (*vc1_mspel_mc_filter_ver_16bits)(int16_t *dst, const uint8_t *src, long int src_stride, int rnd, int64_t shift);
  372. typedef void (*vc1_mspel_mc_filter_hor_16bits)(uint8_t *dst, long int dst_stride, const int16_t *src, int rnd);
  373. typedef void (*vc1_mspel_mc_filter_8bits)(uint8_t *dst, const uint8_t *src, long int stride, int rnd, long int offset);
  374. /**
  375. * Interpolates fractional pel values by applying proper vertical then
  376. * horizontal filter.
  377. *
  378. * @param dst Destination buffer for interpolated pels.
  379. * @param src Source buffer.
  380. * @param stride Stride for both src and dst buffers.
  381. * @param hmode Horizontal filter (expressed in quarter pixels shift).
  382. * @param hmode Vertical filter.
  383. * @param rnd Rounding bias.
  384. */
  385. static void vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride,
  386. int hmode, int vmode, int rnd)
  387. {
  388. static const vc1_mspel_mc_filter_ver_16bits vc1_put_shift_ver_16bits[] =
  389. { NULL, vc1_put_ver_16b_shift1_mmx, vc1_put_ver_16b_shift2_mmx, vc1_put_ver_16b_shift3_mmx };
  390. static const vc1_mspel_mc_filter_hor_16bits vc1_put_shift_hor_16bits[] =
  391. { NULL, vc1_put_hor_16b_shift1_mmx, vc1_put_hor_16b_shift2_mmx, vc1_put_hor_16b_shift3_mmx };
  392. static const vc1_mspel_mc_filter_8bits vc1_put_shift_8bits[] =
  393. { NULL, vc1_put_shift1_mmx, vc1_put_shift2_mmx, vc1_put_shift3_mmx };
  394. asm volatile(
  395. "pxor %%mm0, %%mm0 \n\t"
  396. ::: "memory"
  397. );
  398. if (vmode) { /* Vertical filter to apply */
  399. if (hmode) { /* Horizontal filter to apply, output to tmp */
  400. static const int shift_value[] = { 0, 5, 1, 5 };
  401. int shift = (shift_value[hmode]+shift_value[vmode])>>1;
  402. int r;
  403. DECLARE_ALIGNED_16(int16_t, tmp[12*8]);
  404. r = (1<<(shift-1)) + rnd-1;
  405. vc1_put_shift_ver_16bits[vmode](tmp, src-1, stride, r, shift);
  406. vc1_put_shift_hor_16bits[hmode](dst, stride, tmp+1, 64-rnd);
  407. return;
  408. }
  409. else { /* No horizontal filter, output 8 lines to dst */
  410. vc1_put_shift_8bits[vmode](dst, src, stride, 1-rnd, stride);
  411. return;
  412. }
  413. }
  414. /* Horizontal mode with no vertical mode */
  415. vc1_put_shift_8bits[hmode](dst, src, stride, rnd, 1);
  416. }
  417. void ff_put_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src, int stride, int rnd);
  418. /** Macro to ease bicubic filter interpolation functions declarations */
  419. #define DECLARE_FUNCTION(a, b) \
  420. static void put_vc1_mspel_mc ## a ## b ## _mmx(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
  421. vc1_mspel_mc(dst, src, stride, a, b, rnd); \
  422. }
  423. DECLARE_FUNCTION(0, 1)
  424. DECLARE_FUNCTION(0, 2)
  425. DECLARE_FUNCTION(0, 3)
  426. DECLARE_FUNCTION(1, 0)
  427. DECLARE_FUNCTION(1, 1)
  428. DECLARE_FUNCTION(1, 2)
  429. DECLARE_FUNCTION(1, 3)
  430. DECLARE_FUNCTION(2, 0)
  431. DECLARE_FUNCTION(2, 1)
  432. DECLARE_FUNCTION(2, 2)
  433. DECLARE_FUNCTION(2, 3)
  434. DECLARE_FUNCTION(3, 0)
  435. DECLARE_FUNCTION(3, 1)
  436. DECLARE_FUNCTION(3, 2)
  437. DECLARE_FUNCTION(3, 3)
  438. void ff_vc1dsp_init_mmx(DSPContext* dsp, AVCodecContext *avctx) {
  439. dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_mmx;
  440. dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_mmx;
  441. dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_mmx;
  442. dsp->put_vc1_mspel_pixels_tab[12] = put_vc1_mspel_mc03_mmx;
  443. dsp->put_vc1_mspel_pixels_tab[ 1] = put_vc1_mspel_mc10_mmx;
  444. dsp->put_vc1_mspel_pixels_tab[ 5] = put_vc1_mspel_mc11_mmx;
  445. dsp->put_vc1_mspel_pixels_tab[ 9] = put_vc1_mspel_mc12_mmx;
  446. dsp->put_vc1_mspel_pixels_tab[13] = put_vc1_mspel_mc13_mmx;
  447. dsp->put_vc1_mspel_pixels_tab[ 2] = put_vc1_mspel_mc20_mmx;
  448. dsp->put_vc1_mspel_pixels_tab[ 6] = put_vc1_mspel_mc21_mmx;
  449. dsp->put_vc1_mspel_pixels_tab[10] = put_vc1_mspel_mc22_mmx;
  450. dsp->put_vc1_mspel_pixels_tab[14] = put_vc1_mspel_mc23_mmx;
  451. dsp->put_vc1_mspel_pixels_tab[ 3] = put_vc1_mspel_mc30_mmx;
  452. dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_mmx;
  453. dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_mmx;
  454. dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_mmx;
  455. }