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.

567 lines
16KB

  1. /*
  2. * MMX optimized forward DCT
  3. * The gcc porting is Copyright (c) 2001 Fabrice Bellard.
  4. * cleanup/optimizations are Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
  5. * SSE2 optimization is Copyright (c) 2004 Denes Balatoni.
  6. *
  7. * from fdctam32.c - AP922 MMX(3D-Now) forward-DCT
  8. *
  9. * Intel Application Note AP-922 - fast, precise implementation of DCT
  10. * http://developer.intel.com/vtune/cbts/appnotes.htm
  11. *
  12. * Also of inspiration:
  13. * a page about fdct at http://www.geocities.com/ssavekar/dct.htm
  14. * Skal's fdct at http://skal.planet-d.net/coding/dct.html
  15. *
  16. * This file is part of FFmpeg.
  17. *
  18. * FFmpeg is free software; you can redistribute it and/or
  19. * modify it under the terms of the GNU Lesser General Public
  20. * License as published by the Free Software Foundation; either
  21. * version 2.1 of the License, or (at your option) any later version.
  22. *
  23. * FFmpeg is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  26. * Lesser General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU Lesser General Public
  29. * License along with FFmpeg; if not, write to the Free Software
  30. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  31. */
  32. #include "common.h"
  33. #include "../dsputil.h"
  34. #include "mmx.h"
  35. #define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align)))
  36. //////////////////////////////////////////////////////////////////////
  37. //
  38. // constants for the forward DCT
  39. // -----------------------------
  40. //
  41. // Be sure to check that your compiler is aligning all constants to QWORD
  42. // (8-byte) memory boundaries! Otherwise the unaligned memory access will
  43. // severely stall MMX execution.
  44. //
  45. //////////////////////////////////////////////////////////////////////
  46. #define BITS_FRW_ACC 3 //; 2 or 3 for accuracy
  47. #define SHIFT_FRW_COL BITS_FRW_ACC
  48. #define SHIFT_FRW_ROW (BITS_FRW_ACC + 17 - 3)
  49. #define RND_FRW_ROW (1 << (SHIFT_FRW_ROW-1))
  50. //#define RND_FRW_COL (1 << (SHIFT_FRW_COL-1))
  51. //concatenated table, for forward DCT transformation
  52. static const int16_t fdct_tg_all_16[] ATTR_ALIGN(8) = {
  53. 13036, 13036, 13036, 13036, // tg * (2<<16) + 0.5
  54. 27146, 27146, 27146, 27146, // tg * (2<<16) + 0.5
  55. -21746, -21746, -21746, -21746, // tg * (2<<16) + 0.5
  56. };
  57. static const int16_t ocos_4_16[4] ATTR_ALIGN(8) = {
  58. 23170, 23170, 23170, 23170, //cos * (2<<15) + 0.5
  59. };
  60. static const int64_t fdct_one_corr ATTR_ALIGN(8) = 0x0001000100010001LL;
  61. static const int32_t fdct_r_row[2] ATTR_ALIGN(8) = {RND_FRW_ROW, RND_FRW_ROW };
  62. static struct
  63. {
  64. const int32_t fdct_r_row_sse2[4] ATTR_ALIGN(16);
  65. } fdct_r_row_sse2 ATTR_ALIGN(16)=
  66. {{
  67. RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW
  68. }};
  69. //static const long fdct_r_row_sse2[4] ATTR_ALIGN(16) = {RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW};
  70. static const int16_t tab_frw_01234567[] ATTR_ALIGN(8) = { // forward_dct coeff table
  71. 16384, 16384, 22725, 19266,
  72. 16384, 16384, 12873, 4520,
  73. 21407, 8867, 19266, -4520,
  74. -8867, -21407, -22725, -12873,
  75. 16384, -16384, 12873, -22725,
  76. -16384, 16384, 4520, 19266,
  77. 8867, -21407, 4520, -12873,
  78. 21407, -8867, 19266, -22725,
  79. 22725, 22725, 31521, 26722,
  80. 22725, 22725, 17855, 6270,
  81. 29692, 12299, 26722, -6270,
  82. -12299, -29692, -31521, -17855,
  83. 22725, -22725, 17855, -31521,
  84. -22725, 22725, 6270, 26722,
  85. 12299, -29692, 6270, -17855,
  86. 29692, -12299, 26722, -31521,
  87. 21407, 21407, 29692, 25172,
  88. 21407, 21407, 16819, 5906,
  89. 27969, 11585, 25172, -5906,
  90. -11585, -27969, -29692, -16819,
  91. 21407, -21407, 16819, -29692,
  92. -21407, 21407, 5906, 25172,
  93. 11585, -27969, 5906, -16819,
  94. 27969, -11585, 25172, -29692,
  95. 19266, 19266, 26722, 22654,
  96. 19266, 19266, 15137, 5315,
  97. 25172, 10426, 22654, -5315,
  98. -10426, -25172, -26722, -15137,
  99. 19266, -19266, 15137, -26722,
  100. -19266, 19266, 5315, 22654,
  101. 10426, -25172, 5315, -15137,
  102. 25172, -10426, 22654, -26722,
  103. 16384, 16384, 22725, 19266,
  104. 16384, 16384, 12873, 4520,
  105. 21407, 8867, 19266, -4520,
  106. -8867, -21407, -22725, -12873,
  107. 16384, -16384, 12873, -22725,
  108. -16384, 16384, 4520, 19266,
  109. 8867, -21407, 4520, -12873,
  110. 21407, -8867, 19266, -22725,
  111. 19266, 19266, 26722, 22654,
  112. 19266, 19266, 15137, 5315,
  113. 25172, 10426, 22654, -5315,
  114. -10426, -25172, -26722, -15137,
  115. 19266, -19266, 15137, -26722,
  116. -19266, 19266, 5315, 22654,
  117. 10426, -25172, 5315, -15137,
  118. 25172, -10426, 22654, -26722,
  119. 21407, 21407, 29692, 25172,
  120. 21407, 21407, 16819, 5906,
  121. 27969, 11585, 25172, -5906,
  122. -11585, -27969, -29692, -16819,
  123. 21407, -21407, 16819, -29692,
  124. -21407, 21407, 5906, 25172,
  125. 11585, -27969, 5906, -16819,
  126. 27969, -11585, 25172, -29692,
  127. 22725, 22725, 31521, 26722,
  128. 22725, 22725, 17855, 6270,
  129. 29692, 12299, 26722, -6270,
  130. -12299, -29692, -31521, -17855,
  131. 22725, -22725, 17855, -31521,
  132. -22725, 22725, 6270, 26722,
  133. 12299, -29692, 6270, -17855,
  134. 29692, -12299, 26722, -31521,
  135. };
  136. static struct
  137. {
  138. const int16_t tab_frw_01234567_sse2[256] ATTR_ALIGN(16);
  139. } tab_frw_01234567_sse2 ATTR_ALIGN(16) =
  140. {{
  141. //static const int16_t tab_frw_01234567_sse2[] ATTR_ALIGN(16) = { // forward_dct coeff table
  142. #define TABLE_SSE2 C4, C4, C1, C3, -C6, -C2, -C1, -C5, \
  143. C4, C4, C5, C7, C2, C6, C3, -C7, \
  144. -C4, C4, C7, C3, C6, -C2, C7, -C5, \
  145. C4, -C4, C5, -C1, C2, -C6, C3, -C1,
  146. // c1..c7 * cos(pi/4) * 2^15
  147. #define C1 22725
  148. #define C2 21407
  149. #define C3 19266
  150. #define C4 16384
  151. #define C5 12873
  152. #define C6 8867
  153. #define C7 4520
  154. TABLE_SSE2
  155. #undef C1
  156. #undef C2
  157. #undef C3
  158. #undef C4
  159. #undef C5
  160. #undef C6
  161. #undef C7
  162. #define C1 31521
  163. #define C2 29692
  164. #define C3 26722
  165. #define C4 22725
  166. #define C5 17855
  167. #define C6 12299
  168. #define C7 6270
  169. TABLE_SSE2
  170. #undef C1
  171. #undef C2
  172. #undef C3
  173. #undef C4
  174. #undef C5
  175. #undef C6
  176. #undef C7
  177. #define C1 29692
  178. #define C2 27969
  179. #define C3 25172
  180. #define C4 21407
  181. #define C5 16819
  182. #define C6 11585
  183. #define C7 5906
  184. TABLE_SSE2
  185. #undef C1
  186. #undef C2
  187. #undef C3
  188. #undef C4
  189. #undef C5
  190. #undef C6
  191. #undef C7
  192. #define C1 26722
  193. #define C2 25172
  194. #define C3 22654
  195. #define C4 19266
  196. #define C5 15137
  197. #define C6 10426
  198. #define C7 5315
  199. TABLE_SSE2
  200. #undef C1
  201. #undef C2
  202. #undef C3
  203. #undef C4
  204. #undef C5
  205. #undef C6
  206. #undef C7
  207. #define C1 22725
  208. #define C2 21407
  209. #define C3 19266
  210. #define C4 16384
  211. #define C5 12873
  212. #define C6 8867
  213. #define C7 4520
  214. TABLE_SSE2
  215. #undef C1
  216. #undef C2
  217. #undef C3
  218. #undef C4
  219. #undef C5
  220. #undef C6
  221. #undef C7
  222. #define C1 26722
  223. #define C2 25172
  224. #define C3 22654
  225. #define C4 19266
  226. #define C5 15137
  227. #define C6 10426
  228. #define C7 5315
  229. TABLE_SSE2
  230. #undef C1
  231. #undef C2
  232. #undef C3
  233. #undef C4
  234. #undef C5
  235. #undef C6
  236. #undef C7
  237. #define C1 29692
  238. #define C2 27969
  239. #define C3 25172
  240. #define C4 21407
  241. #define C5 16819
  242. #define C6 11585
  243. #define C7 5906
  244. TABLE_SSE2
  245. #undef C1
  246. #undef C2
  247. #undef C3
  248. #undef C4
  249. #undef C5
  250. #undef C6
  251. #undef C7
  252. #define C1 31521
  253. #define C2 29692
  254. #define C3 26722
  255. #define C4 22725
  256. #define C5 17855
  257. #define C6 12299
  258. #define C7 6270
  259. TABLE_SSE2
  260. }};
  261. static av_always_inline void fdct_col(const int16_t *in, int16_t *out, int offset)
  262. {
  263. movq_m2r(*(in + offset + 1 * 8), mm0);
  264. movq_m2r(*(in + offset + 6 * 8), mm1);
  265. movq_r2r(mm0, mm2);
  266. movq_m2r(*(in + offset + 2 * 8), mm3);
  267. paddsw_r2r(mm1, mm0);
  268. movq_m2r(*(in + offset + 5 * 8), mm4);
  269. psllw_i2r(SHIFT_FRW_COL, mm0);
  270. movq_m2r(*(in + offset + 0 * 8), mm5);
  271. paddsw_r2r(mm3, mm4);
  272. paddsw_m2r(*(in + offset + 7 * 8), mm5);
  273. psllw_i2r(SHIFT_FRW_COL, mm4);
  274. movq_r2r(mm0, mm6);
  275. psubsw_r2r(mm1, mm2);
  276. movq_m2r(*(fdct_tg_all_16 + 4), mm1);
  277. psubsw_r2r(mm4, mm0);
  278. movq_m2r(*(in + offset + 3 * 8), mm7);
  279. pmulhw_r2r(mm0, mm1);
  280. paddsw_m2r(*(in + offset + 4 * 8), mm7);
  281. psllw_i2r(SHIFT_FRW_COL, mm5);
  282. paddsw_r2r(mm4, mm6);
  283. psllw_i2r(SHIFT_FRW_COL, mm7);
  284. movq_r2r(mm5, mm4);
  285. psubsw_r2r(mm7, mm5);
  286. paddsw_r2r(mm5, mm1);
  287. paddsw_r2r(mm7, mm4);
  288. por_m2r(fdct_one_corr, mm1);
  289. psllw_i2r(SHIFT_FRW_COL + 1, mm2);
  290. pmulhw_m2r(*(fdct_tg_all_16 + 4), mm5);
  291. movq_r2r(mm4, mm7);
  292. psubsw_m2r(*(in + offset + 5 * 8), mm3);
  293. psubsw_r2r(mm6, mm4);
  294. movq_r2m(mm1, *(out + offset + 2 * 8));
  295. paddsw_r2r(mm6, mm7);
  296. movq_m2r(*(in + offset + 3 * 8), mm1);
  297. psllw_i2r(SHIFT_FRW_COL + 1, mm3);
  298. psubsw_m2r(*(in + offset + 4 * 8), mm1);
  299. movq_r2r(mm2, mm6);
  300. movq_r2m(mm4, *(out + offset + 4 * 8));
  301. paddsw_r2r(mm3, mm2);
  302. pmulhw_m2r(*ocos_4_16, mm2);
  303. psubsw_r2r(mm3, mm6);
  304. pmulhw_m2r(*ocos_4_16, mm6);
  305. psubsw_r2r(mm0, mm5);
  306. por_m2r(fdct_one_corr, mm5);
  307. psllw_i2r(SHIFT_FRW_COL, mm1);
  308. por_m2r(fdct_one_corr, mm2);
  309. movq_r2r(mm1, mm4);
  310. movq_m2r(*(in + offset + 0 * 8), mm3);
  311. paddsw_r2r(mm6, mm1);
  312. psubsw_m2r(*(in + offset + 7 * 8), mm3);
  313. psubsw_r2r(mm6, mm4);
  314. movq_m2r(*(fdct_tg_all_16 + 0), mm0);
  315. psllw_i2r(SHIFT_FRW_COL, mm3);
  316. movq_m2r(*(fdct_tg_all_16 + 8), mm6);
  317. pmulhw_r2r(mm1, mm0);
  318. movq_r2m(mm7, *(out + offset + 0 * 8));
  319. pmulhw_r2r(mm4, mm6);
  320. movq_r2m(mm5, *(out + offset + 6 * 8));
  321. movq_r2r(mm3, mm7);
  322. movq_m2r(*(fdct_tg_all_16 + 8), mm5);
  323. psubsw_r2r(mm2, mm7);
  324. paddsw_r2r(mm2, mm3);
  325. pmulhw_r2r(mm7, mm5);
  326. paddsw_r2r(mm3, mm0);
  327. paddsw_r2r(mm4, mm6);
  328. pmulhw_m2r(*(fdct_tg_all_16 + 0), mm3);
  329. por_m2r(fdct_one_corr, mm0);
  330. paddsw_r2r(mm7, mm5);
  331. psubsw_r2r(mm6, mm7);
  332. movq_r2m(mm0, *(out + offset + 1 * 8));
  333. paddsw_r2r(mm4, mm5);
  334. movq_r2m(mm7, *(out + offset + 3 * 8));
  335. psubsw_r2r(mm1, mm3);
  336. movq_r2m(mm5, *(out + offset + 5 * 8));
  337. movq_r2m(mm3, *(out + offset + 7 * 8));
  338. }
  339. static av_always_inline void fdct_row_sse2(const int16_t *in, int16_t *out)
  340. {
  341. asm volatile(
  342. #define FDCT_ROW_SSE2_H1(i,t) \
  343. "movq " #i "(%0), %%xmm2 \n\t" \
  344. "movq " #i "+8(%0), %%xmm0 \n\t" \
  345. "movdqa " #t "+32(%1), %%xmm3 \n\t" \
  346. "movdqa " #t "+48(%1), %%xmm7 \n\t" \
  347. "movdqa " #t "(%1), %%xmm4 \n\t" \
  348. "movdqa " #t "+16(%1), %%xmm5 \n\t"
  349. #define FDCT_ROW_SSE2_H2(i,t) \
  350. "movq " #i "(%0), %%xmm2 \n\t" \
  351. "movq " #i "+8(%0), %%xmm0 \n\t" \
  352. "movdqa " #t "+32(%1), %%xmm3 \n\t" \
  353. "movdqa " #t "+48(%1), %%xmm7 \n\t"
  354. #define FDCT_ROW_SSE2(i) \
  355. "movq %%xmm2, %%xmm1 \n\t" \
  356. "pshuflw $27, %%xmm0, %%xmm0 \n\t" \
  357. "paddsw %%xmm0, %%xmm1 \n\t" \
  358. "psubsw %%xmm0, %%xmm2 \n\t" \
  359. "punpckldq %%xmm2, %%xmm1 \n\t" \
  360. "pshufd $78, %%xmm1, %%xmm2 \n\t" \
  361. "pmaddwd %%xmm2, %%xmm3 \n\t" \
  362. "pmaddwd %%xmm1, %%xmm7 \n\t" \
  363. "pmaddwd %%xmm5, %%xmm2 \n\t" \
  364. "pmaddwd %%xmm4, %%xmm1 \n\t" \
  365. "paddd %%xmm7, %%xmm3 \n\t" \
  366. "paddd %%xmm2, %%xmm1 \n\t" \
  367. "paddd %%xmm6, %%xmm3 \n\t" \
  368. "paddd %%xmm6, %%xmm1 \n\t" \
  369. "psrad %3, %%xmm3 \n\t" \
  370. "psrad %3, %%xmm1 \n\t" \
  371. "packssdw %%xmm3, %%xmm1 \n\t" \
  372. "movdqa %%xmm1, " #i "(%4) \n\t"
  373. "movdqa (%2), %%xmm6 \n\t"
  374. FDCT_ROW_SSE2_H1(0,0)
  375. FDCT_ROW_SSE2(0)
  376. FDCT_ROW_SSE2_H2(64,0)
  377. FDCT_ROW_SSE2(64)
  378. FDCT_ROW_SSE2_H1(16,64)
  379. FDCT_ROW_SSE2(16)
  380. FDCT_ROW_SSE2_H2(112,64)
  381. FDCT_ROW_SSE2(112)
  382. FDCT_ROW_SSE2_H1(32,128)
  383. FDCT_ROW_SSE2(32)
  384. FDCT_ROW_SSE2_H2(96,128)
  385. FDCT_ROW_SSE2(96)
  386. FDCT_ROW_SSE2_H1(48,192)
  387. FDCT_ROW_SSE2(48)
  388. FDCT_ROW_SSE2_H2(80,192)
  389. FDCT_ROW_SSE2(80)
  390. :
  391. : "r" (in), "r" (tab_frw_01234567_sse2.tab_frw_01234567_sse2), "r" (fdct_r_row_sse2.fdct_r_row_sse2), "i" (SHIFT_FRW_ROW), "r" (out)
  392. );
  393. }
  394. static av_always_inline void fdct_row_mmx2(const int16_t *in, int16_t *out, const int16_t *table)
  395. {
  396. pshufw_m2r(*(in + 4), mm5, 0x1B);
  397. movq_m2r(*(in + 0), mm0);
  398. movq_r2r(mm0, mm1);
  399. paddsw_r2r(mm5, mm0);
  400. psubsw_r2r(mm5, mm1);
  401. movq_r2r(mm0, mm2);
  402. punpckldq_r2r(mm1, mm0);
  403. punpckhdq_r2r(mm1, mm2);
  404. movq_m2r(*(table + 0), mm1);
  405. movq_m2r(*(table + 4), mm3);
  406. movq_m2r(*(table + 8), mm4);
  407. movq_m2r(*(table + 12), mm5);
  408. movq_m2r(*(table + 16), mm6);
  409. movq_m2r(*(table + 20), mm7);
  410. pmaddwd_r2r(mm0, mm1);
  411. pmaddwd_r2r(mm2, mm3);
  412. pmaddwd_r2r(mm0, mm4);
  413. pmaddwd_r2r(mm2, mm5);
  414. pmaddwd_r2r(mm0, mm6);
  415. pmaddwd_r2r(mm2, mm7);
  416. pmaddwd_m2r(*(table + 24), mm0);
  417. pmaddwd_m2r(*(table + 28), mm2);
  418. paddd_r2r(mm1, mm3);
  419. paddd_r2r(mm4, mm5);
  420. paddd_r2r(mm6, mm7);
  421. paddd_r2r(mm0, mm2);
  422. movq_m2r(*fdct_r_row, mm0);
  423. paddd_r2r(mm0, mm3);
  424. paddd_r2r(mm0, mm5);
  425. paddd_r2r(mm0, mm7);
  426. paddd_r2r(mm0, mm2);
  427. psrad_i2r(SHIFT_FRW_ROW, mm3);
  428. psrad_i2r(SHIFT_FRW_ROW, mm5);
  429. psrad_i2r(SHIFT_FRW_ROW, mm7);
  430. psrad_i2r(SHIFT_FRW_ROW, mm2);
  431. packssdw_r2r(mm5, mm3);
  432. packssdw_r2r(mm2, mm7);
  433. movq_r2m(mm3, *(out + 0));
  434. movq_r2m(mm7, *(out + 4));
  435. }
  436. static av_always_inline void fdct_row_mmx(const int16_t *in, int16_t *out, const int16_t *table)
  437. {
  438. //FIXME reorder (i dont have a old mmx only cpu here to benchmark ...)
  439. movd_m2r(*(in + 6), mm1);
  440. punpcklwd_m2r(*(in + 4), mm1);
  441. movq_r2r(mm1, mm2);
  442. psrlq_i2r(0x20, mm1);
  443. movq_m2r(*(in + 0), mm0);
  444. punpcklwd_r2r(mm2, mm1);
  445. movq_r2r(mm0, mm5);
  446. paddsw_r2r(mm1, mm0);
  447. psubsw_r2r(mm1, mm5);
  448. movq_r2r(mm0, mm2);
  449. punpckldq_r2r(mm5, mm0);
  450. punpckhdq_r2r(mm5, mm2);
  451. movq_m2r(*(table + 0), mm1);
  452. movq_m2r(*(table + 4), mm3);
  453. movq_m2r(*(table + 8), mm4);
  454. movq_m2r(*(table + 12), mm5);
  455. movq_m2r(*(table + 16), mm6);
  456. movq_m2r(*(table + 20), mm7);
  457. pmaddwd_r2r(mm0, mm1);
  458. pmaddwd_r2r(mm2, mm3);
  459. pmaddwd_r2r(mm0, mm4);
  460. pmaddwd_r2r(mm2, mm5);
  461. pmaddwd_r2r(mm0, mm6);
  462. pmaddwd_r2r(mm2, mm7);
  463. pmaddwd_m2r(*(table + 24), mm0);
  464. pmaddwd_m2r(*(table + 28), mm2);
  465. paddd_r2r(mm1, mm3);
  466. paddd_r2r(mm4, mm5);
  467. paddd_r2r(mm6, mm7);
  468. paddd_r2r(mm0, mm2);
  469. movq_m2r(*fdct_r_row, mm0);
  470. paddd_r2r(mm0, mm3);
  471. paddd_r2r(mm0, mm5);
  472. paddd_r2r(mm0, mm7);
  473. paddd_r2r(mm0, mm2);
  474. psrad_i2r(SHIFT_FRW_ROW, mm3);
  475. psrad_i2r(SHIFT_FRW_ROW, mm5);
  476. psrad_i2r(SHIFT_FRW_ROW, mm7);
  477. psrad_i2r(SHIFT_FRW_ROW, mm2);
  478. packssdw_r2r(mm5, mm3);
  479. packssdw_r2r(mm2, mm7);
  480. movq_r2m(mm3, *(out + 0));
  481. movq_r2m(mm7, *(out + 4));
  482. }
  483. void ff_fdct_mmx(int16_t *block)
  484. {
  485. int64_t align_tmp[16] ATTR_ALIGN(8);
  486. int16_t * block1= (int16_t*)align_tmp;
  487. const int16_t *table= tab_frw_01234567;
  488. int i;
  489. fdct_col(block, block1, 0);
  490. fdct_col(block, block1, 4);
  491. for(i=8;i>0;i--) {
  492. fdct_row_mmx(block1, block, table);
  493. block1 += 8;
  494. table += 32;
  495. block += 8;
  496. }
  497. }
  498. void ff_fdct_mmx2(int16_t *block)
  499. {
  500. int64_t align_tmp[16] ATTR_ALIGN(8);
  501. int16_t *block1= (int16_t*)align_tmp;
  502. const int16_t *table= tab_frw_01234567;
  503. int i;
  504. fdct_col(block, block1, 0);
  505. fdct_col(block, block1, 4);
  506. for(i=8;i>0;i--) {
  507. fdct_row_mmx2(block1, block, table);
  508. block1 += 8;
  509. table += 32;
  510. block += 8;
  511. }
  512. }
  513. void ff_fdct_sse2(int16_t *block)
  514. {
  515. int64_t align_tmp[16] ATTR_ALIGN(16);
  516. int16_t * const block1= (int16_t*)align_tmp;
  517. fdct_col(block, block1, 0);
  518. fdct_col(block, block1, 4);
  519. fdct_row_sse2(block1, block);
  520. }