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.

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