Source code of Windows XP (NT5)
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.

685 lines
17 KiB

  1. #include "stdafx.h"
  2. #pragma hdrstop
  3. /***************************************************************************
  4. *
  5. * INTEL Corporation Proprietary Information
  6. *
  7. *
  8. * Copyright (c) 1996 Intel Corporation.
  9. * All rights reserved.
  10. *
  11. ***************************************************************************
  12. */
  13. /*
  14. * jfdctint.c
  15. *
  16. * Copyright (C) 1991-1996, Thomas G. Lane.
  17. * This file is part of the Independent JPEG Group's software.
  18. * For conditions of distribution and use, see the accompanying README file.
  19. *
  20. * This file contains a slow-but-accurate integer implementation of the
  21. * forward DCT (Discrete Cosine Transform).
  22. *
  23. * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
  24. * on each column. Direct algorithms are also available, but they are
  25. * much more complex and seem not to be any faster when reduced to code.
  26. *
  27. * This implementation is based on an algorithm described in
  28. * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
  29. * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
  30. * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
  31. * The primary algorithm described there uses 11 multiplies and 29 adds.
  32. * We use their alternate method with 12 multiplies and 32 adds.
  33. * The advantage of this method is that no data path contains more than one
  34. * multiplication; this allows a very simple and accurate implementation in
  35. * scaled fixed-point arithmetic, with a minimal number of shifts.
  36. */
  37. #define JPEG_INTERNALS
  38. #include "jinclude.h"
  39. #include "jpeglib.h"
  40. #include "jdct.h" /* Private declarations for DCT subsystem */
  41. #ifdef DCT_ISLOW_SUPPORTED
  42. /*
  43. * This module is specialized to the case DCTSIZE = 8.
  44. */
  45. #if DCTSIZE != 8
  46. Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
  47. #endif
  48. /*
  49. * The poop on this scaling stuff is as follows:
  50. *
  51. * Each 1-D DCT step produces outputs which are a factor of sqrt(N)
  52. * larger than the true DCT outputs. The final outputs are therefore
  53. * a factor of N larger than desired; since N=8 this can be cured by
  54. * a simple right shift at the end of the algorithm. The advantage of
  55. * this arrangement is that we save two multiplications per 1-D DCT,
  56. * because the y0 and y4 outputs need not be divided by sqrt(N).
  57. * In the IJG code, this factor of 8 is removed by the quantization step
  58. * (in jcdctmgr.c), NOT in this module.
  59. *
  60. * We have to do addition and subtraction of the integer inputs, which
  61. * is no problem, and multiplication by fractional constants, which is
  62. * a problem to do in integer arithmetic. We multiply all the constants
  63. * by CONST_SCALE and convert them to integer constants (thus retaining
  64. * CONST_BITS bits of precision in the constants). After doing a
  65. * multiplication we have to divide the product by CONST_SCALE, with proper
  66. * rounding, to produce the correct output. This division can be done
  67. * cheaply as a right shift of CONST_BITS bits. We postpone shifting
  68. * as long as possible so that partial sums can be added together with
  69. * full fractional precision.
  70. *
  71. * The outputs of the first pass are scaled up by PASS1_BITS bits so that
  72. * they are represented to better-than-integral precision. These outputs
  73. * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
  74. * with the recommended scaling. (For 12-bit sample data, the intermediate
  75. * array is INT32 anyway.)
  76. *
  77. * To avoid overflow of the 32-bit intermediate results in pass 2, we must
  78. * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
  79. * shows that the values given below are the most effective.
  80. */
  81. #if BITS_IN_JSAMPLE == 8
  82. #define CONST_BITS 13
  83. #define PASS1_BITS 2
  84. #else
  85. #define CONST_BITS 13
  86. #define PASS1_BITS 1 /* lose a little precision to avoid overflow */
  87. #endif
  88. /* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
  89. * causing a lot of useless floating-point operations at run time.
  90. * To get around this we use the following pre-calculated constants.
  91. * If you change CONST_BITS you may want to add appropriate values.
  92. * (With a reasonable C compiler, you can just rely on the FIX() macro...)
  93. */
  94. #if CONST_BITS == 13
  95. #define FIX_0_298631336 2446 /* FIX(0.298631336) */
  96. #define FIX_0_390180644 3196 /* FIX(0.390180644) */
  97. #define FIX_0_541196100 4433 /* FIX(0.541196100) */
  98. #define FIX_0_765366865 6270 /* FIX(0.765366865) */
  99. #define FIX_0_899976223 7373 /* FIX(0.899976223) */
  100. #define FIX_1_175875602 9633 /* FIX(1.175875602) */
  101. #define FIX_1_501321110 12299 /* FIX(1.501321110) */
  102. #define FIX_1_847759065 15137 /* FIX(1.847759065) */
  103. #define FIX_1_961570560 16069 /* FIX(1.961570560) */
  104. #define FIX_2_053119869 16819 /* FIX(2.053119869) */
  105. #define FIX_2_562915447 20995 /* FIX(2.562915447) */
  106. #define FIX_3_072711026 25172 /* FIX(3.072711026) */
  107. #else
  108. #define FIX_0_298631336 FIX(0.298631336)
  109. #define FIX_0_390180644 FIX(0.390180644)
  110. #define FIX_0_541196100 FIX(0.541196100)
  111. #define FIX_0_765366865 FIX(0.765366865)
  112. #define FIX_0_899976223 FIX(0.899976223)
  113. #define FIX_1_175875602 FIX(1.175875602)
  114. #define FIX_1_501321110 FIX(1.501321110)
  115. #define FIX_1_847759065 FIX(1.847759065)
  116. #define FIX_1_961570560 FIX(1.961570560)
  117. #define FIX_2_053119869 FIX(2.053119869)
  118. #define FIX_2_562915447 FIX(2.562915447)
  119. #define FIX_3_072711026 FIX(3.072711026)
  120. #endif
  121. /* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
  122. * For 8-bit samples with the recommended scaling, all the variable
  123. * and constant values involved are no more than 16 bits wide, so a
  124. * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
  125. * For 12-bit samples, a full 32-bit multiplication will be needed.
  126. */
  127. #if BITS_IN_JSAMPLE == 8
  128. #define MULTIPLY(var,const) MULTIPLY16C16(var,const)
  129. #else
  130. #define MULTIPLY(var,const) ((var) * (const))
  131. #endif
  132. #define DATASIZE 4
  133. #define DCTWIDTH 32
  134. #if _MSC_FULL_VER >= 13008827 && defined(_M_IX86)
  135. #pragma warning(push)
  136. #pragma warning(disable:4731) // EBP modified with inline asm
  137. #endif
  138. /*
  139. * Perform the forward DCT on one block of samples.
  140. */
  141. GLOBAL(void)
  142. pfdct8x8llm (DCTELEM * data)
  143. {
  144. INT32 tmp4, tmp5, tmp6, tmp7;
  145. int counter;
  146. __asm{
  147. /* Pass 1: process rows. */
  148. /* Note results are scaled up by sqrt(8) compared to a true DCT; */
  149. /* furthermore, we scale the results by 2**PASS1_BITS. */
  150. // dataptr = data;
  151. mov esi, [data]
  152. mov counter, 8
  153. // for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
  154. // tmp0 = dataptr[0] + dataptr[7];
  155. // tmp7 = dataptr[0] - dataptr[7];
  156. // tmp1 = dataptr[1] + dataptr[6];
  157. // tmp6 = dataptr[1] - dataptr[6];
  158. // tmp2 = dataptr[2] + dataptr[5];
  159. // tmp5 = dataptr[2] - dataptr[5];
  160. // tmp3 = dataptr[3] + dataptr[4];
  161. // tmp4 = dataptr[3] - dataptr[4];
  162. StartRow:
  163. mov eax, [esi][DATASIZE*0]
  164. mov ebx, [esi][DATASIZE*7]
  165. mov edx, eax
  166. add eax, ebx ; eax = tmp0
  167. sub edx, ebx ; edx = tmp7
  168. mov ebx, [esi][DATASIZE*3]
  169. mov ecx, [esi][DATASIZE*4]
  170. mov edi, ebx
  171. add ebx, ecx ; ebx = tmp3
  172. sub edi, ecx ; edi = tmp4
  173. mov tmp4, edi
  174. mov tmp7, edx
  175. /* Even part per LL&M figure 1 --- note that published figure is faulty;
  176. * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
  177. */
  178. // tmp10 = tmp0 + tmp3;
  179. // tmp13 = tmp0 - tmp3;
  180. // tmp11 = tmp1 + tmp2;
  181. // tmp12 = tmp1 - tmp2;
  182. mov ecx, eax
  183. add eax, ebx ; eax = tmp10
  184. sub ecx, ebx ; ecx = tmp13
  185. mov edx, [esi][DATASIZE*1]
  186. mov edi, [esi][DATASIZE*6]
  187. mov ebx, edx
  188. add edx, edi ; edx = tmp1
  189. sub ebx, edi ; ebx = tmp6
  190. mov tmp6, ebx
  191. push ebp
  192. mov edi, [esi][DATASIZE*2]
  193. mov ebp, [esi][DATASIZE*5]
  194. mov ebx, edi
  195. add edi, ebp ; edi = tmp2
  196. sub ebx, ebp ; ebx = tmp5
  197. mov ebp, edx
  198. add edx, edi ; edx = tmp11
  199. sub ebp, edi ; ebp = tmp12
  200. // dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS);
  201. // dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
  202. mov edi, eax
  203. add eax, edx ; eax = tmp10 + tmp11
  204. shl eax, 2
  205. sub edi, edx ; edi = tmp10 - tmp11
  206. shl edi, 2
  207. mov [esi][DATASIZE*0], eax
  208. mov [esi][DATASIZE*4], edi
  209. mov eax, ebp ; eax = tmp12
  210. // z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
  211. add ebp, ecx ; eax = tmp12 + tmp13
  212. add esi, 32
  213. imul ebp, FIX_0_541196100 ; ebp = z1
  214. // dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
  215. // CONST_BITS-PASS1_BITS);
  216. imul ecx, FIX_0_765366865
  217. // dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
  218. // CONST_BITS-PASS1_BITS);
  219. imul eax, FIX_1_847759065
  220. add ecx, ebp ; add z1
  221. xor eax, 0xFFFFFFFF
  222. add ecx, 1024 ; rounding adj
  223. inc eax ; negate the result
  224. add eax, ebp ; add z1
  225. pop ebp
  226. sar ecx, 11
  227. add eax, 1024
  228. mov [esi][DATASIZE*2-32], ecx
  229. mov edi, tmp4
  230. sar eax, 11
  231. mov ecx, tmp6
  232. mov [esi][DATASIZE*6-32], eax
  233. push esi
  234. /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
  235. * cK represents cos(K*pi/16).
  236. * i0..i3 in the paper are tmp4..tmp7 here.
  237. */
  238. // z1 = tmp4 + tmp7;
  239. // z2 = tmp5 + tmp6;
  240. // z3 = tmp4 + tmp6;
  241. // z4 = tmp5 + tmp7;
  242. mov edx, tmp7
  243. mov eax, edi ; edi = eax = tmp4
  244. mov esi, edi ; esi = tmp4
  245. add edi, edx ; edi = z1
  246. add eax, ecx ; eax = z3
  247. add ecx, ebx ; ecx = z2
  248. // z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
  249. // z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
  250. imul edi, FIX_0_899976223
  251. imul ecx, FIX_2_562915447
  252. xor ecx, 0xFFFFFFFF
  253. add edx, ebx ; edx = z4
  254. // tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
  255. // tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
  256. imul esi, FIX_0_298631336
  257. imul ebx, FIX_2_053119869
  258. xor edi, 0xFFFFFFFF
  259. inc ecx ; ecx = z2
  260. inc edi ; edi = z1
  261. add ebx, ecx ; ebx = z2 + tmp5
  262. add esi, edi ; esi = z1 + tmp4
  263. mov tmp5, ebx
  264. // z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
  265. mov ebx, eax ; ebx = z3
  266. add eax, edx ; eax = z3 + z4
  267. imul eax, FIX_1_175875602
  268. // z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
  269. // z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
  270. imul ebx, FIX_1_961570560
  271. imul edx, FIX_0_390180644
  272. xor ebx, 0xFFFFFFFF
  273. xor edx, 0xFFFFFFFF
  274. inc ebx ; ebx = z3
  275. inc edx ; edx = z4
  276. // z3 += z5;
  277. // z4 += z5;
  278. add ebx, eax ; ebx = z3
  279. add edx, eax ; edx = z4
  280. // tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
  281. // tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
  282. mov eax, tmp6
  283. add ecx, ebx ; ecx = z2 + z3
  284. imul eax, FIX_3_072711026
  285. add ecx, eax ; ecx = tmp6 + z2 + z3
  286. mov eax, tmp7
  287. imul eax, FIX_1_501321110
  288. // dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
  289. // dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
  290. // dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
  291. // dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
  292. add edi, edx ; edi = z1 + z4
  293. add ecx, 1024
  294. add edi, eax ; edi = tmp7 + z1 + z4
  295. mov eax, tmp5 ; eax = tmp5 + z2
  296. add ebx, esi ; ebx = tmp4 + z1 + z3
  297. add edx, eax ; edx = tmp5 + z2 + z4
  298. sar ecx, 11
  299. add ebx, 1024
  300. sar ebx, 11
  301. pop esi
  302. add edx, 1024
  303. add edi, 1024
  304. sar edx, 11
  305. mov [esi][DATASIZE*7-32], ebx
  306. sar edi, 11
  307. mov [esi][DATASIZE*3-32], ecx
  308. mov [esi][DATASIZE*5-32], edx
  309. mov ecx, counter
  310. mov [esi][DATASIZE*1-32], edi
  311. dec ecx
  312. mov counter, ecx
  313. jnz StartRow
  314. // dataptr += DCTSIZE; /* advance pointer to next row */
  315. // }
  316. /* Pass 2: process columns.
  317. * We remove the PASS1_BITS scaling, but leave the results scaled up
  318. * by an overall factor of 8.
  319. */
  320. // dataptr = data;
  321. mov esi, [data]
  322. mov counter, 8
  323. //for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
  324. // tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
  325. // tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
  326. // tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
  327. // tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
  328. // tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
  329. // tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
  330. // tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
  331. // tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
  332. StartCol:
  333. mov eax, [esi][DCTWIDTH*0]
  334. mov ebx, [esi][DCTWIDTH*7]
  335. mov edx, eax
  336. add eax, ebx ; eax = tmp0
  337. sub edx, ebx ; edx = tmp7
  338. mov ebx, [esi][DCTWIDTH*3]
  339. mov ecx, [esi][DCTWIDTH*4]
  340. mov edi, ebx
  341. add ebx, ecx ; ebx = tmp3
  342. sub edi, ecx ; edi = tmp4
  343. mov tmp4, edi
  344. mov tmp7, edx
  345. /* Even part per LL&M figure 1 --- note that published figure is faulty;
  346. * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
  347. */
  348. // tmp10 = tmp0 + tmp3;
  349. // tmp13 = tmp0 - tmp3;
  350. // tmp11 = tmp1 + tmp2;
  351. // tmp12 = tmp1 - tmp2;
  352. mov ecx, eax ; ecx = tmp0
  353. add eax, ebx ; eax = tmp10
  354. sub ecx, ebx ; ecx = tmp13
  355. mov edx, [esi][DCTWIDTH*1]
  356. mov edi, [esi][DCTWIDTH*6]
  357. mov ebx, edx
  358. add edx, edi ; edx = tmp1
  359. sub ebx, edi ; ebx = tmp6
  360. mov tmp6, ebx
  361. push ebp
  362. mov edi, [esi][DCTWIDTH*2]
  363. mov ebp, [esi][DCTWIDTH*5]
  364. mov ebx, edi
  365. add edi, ebp ; edi = tmp2
  366. sub ebx, ebp ; ebx = tmp5
  367. mov ebp, edx ; ebp = tmp1
  368. add edx, edi ; edx = tmp11
  369. sub ebp, edi ; ebx = tmp12
  370. // dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
  371. // dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
  372. add eax, 2 ; adj for rounding
  373. mov edi, eax
  374. add eax, edx ; eax = tmp10 + tmp11
  375. sar eax, 2
  376. sub edi, edx ; edi = tmp10 - tmp11
  377. sar edi, 2
  378. mov [esi][DCTWIDTH*0], eax
  379. mov [esi][DCTWIDTH*4], edi
  380. mov eax, ebp ; eax = tmp12
  381. // z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
  382. add ebp, ecx ; eax = tmp12 + tmp13
  383. add esi, 4
  384. imul ebp, FIX_0_541196100 ; ebp = z1
  385. // dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
  386. // CONST_BITS+PASS1_BITS);
  387. imul ecx, FIX_0_765366865
  388. // dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
  389. // CONST_BITS+PASS1_BITS);
  390. imul eax, FIX_1_847759065
  391. add ecx, ebp ; add z1
  392. xor eax, 0xFFFFFFFF
  393. add ecx, 16384 ; rounding adj
  394. inc eax ; negate the result
  395. add eax, ebp ; add z1
  396. pop ebp
  397. sar ecx, 15
  398. add eax, 16384
  399. mov [esi][DCTWIDTH*2-4], ecx
  400. mov edi, tmp4
  401. sar eax, 15
  402. mov ecx, tmp6
  403. mov [esi][DCTWIDTH*6-4], eax
  404. push esi
  405. /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
  406. * cK represents cos(K*pi/16).
  407. * i0..i3 in the paper are tmp4..tmp7 here.
  408. */
  409. // z1 = tmp4 + tmp7;
  410. // z2 = tmp5 + tmp6;
  411. // z3 = tmp4 + tmp6;
  412. // z4 = tmp5 + tmp7;
  413. mov edx, tmp7
  414. mov eax, edi ; edi = eax = tmp4
  415. mov esi, edi ; esi = tmp4
  416. add edi, edx ; edi = z1
  417. add eax, ecx ; eax = z3
  418. add ecx, ebx ; ecx = z2
  419. // z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
  420. // z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
  421. imul edi, FIX_0_899976223
  422. imul ecx, FIX_2_562915447
  423. xor ecx, 0xFFFFFFFF
  424. add edx, ebx ; edx = z4
  425. // tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
  426. // tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
  427. imul esi, FIX_0_298631336
  428. imul ebx, FIX_2_053119869
  429. xor edi, 0xFFFFFFFF
  430. inc ecx ; ecx = z2
  431. inc edi ; edi = z1
  432. add ebx, ecx ; ebx = z2 + tmp5
  433. add esi, edi ; esi = z1 + tmp4
  434. mov tmp5, ebx
  435. // z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
  436. mov ebx, eax ; ebx = z3
  437. add eax, edx ; eax = z3 + z4
  438. imul eax, FIX_1_175875602
  439. // z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
  440. // z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
  441. imul ebx, FIX_1_961570560
  442. imul edx, FIX_0_390180644
  443. xor ebx, 0xFFFFFFFF
  444. xor edx, 0xFFFFFFFF
  445. inc ebx ; ebx = z3
  446. inc edx ; edx = z4
  447. // z3 += z5;
  448. // z4 += z5;
  449. add ebx, eax ; ebx = z3
  450. add edx, eax ; edx = z4
  451. // tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
  452. // tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
  453. mov eax, tmp6
  454. add ecx, ebx ; ecx = z2 + z3
  455. imul eax, FIX_3_072711026
  456. add ecx, eax ; ecx = tmp6 + z2 + z3
  457. mov eax, tmp7
  458. imul eax, FIX_1_501321110
  459. // dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3,
  460. // CONST_BITS+PASS1_BITS);
  461. // dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4,
  462. // CONST_BITS+PASS1_BITS);
  463. // dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3,
  464. // CONST_BITS+PASS1_BITS);
  465. // dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4,
  466. // CONST_BITS+PASS1_BITS);
  467. add edi, edx ; edi = z1 + z4
  468. add ecx, 16384
  469. add edi, eax ; edi = tmp7 + z1 + z4
  470. mov eax, tmp5 ; eax = tmp5 + z2
  471. add ebx, esi ; ebx = tmp4 + z1 + z3
  472. add edx, eax ; edx = tmp5 + z2 + z4
  473. sar ecx, 15
  474. add ebx, 16384
  475. sar ebx, 15
  476. pop esi
  477. add edx, 16384
  478. add edi, 16384
  479. sar edx, 15
  480. mov [esi][DCTWIDTH*7-4], ebx
  481. sar edi, 15
  482. mov [esi][DCTWIDTH*3-4], ecx
  483. mov [esi][DCTWIDTH*5-4], edx
  484. mov ecx, counter
  485. mov [esi][DCTWIDTH*1-4], edi
  486. dec ecx
  487. mov counter, ecx
  488. jnz StartCol
  489. } //end asm
  490. // dataptr++; /* advance pointer to next column */
  491. // }
  492. }
  493. #if _MSC_FULL_VER >= 13008827
  494. #pragma warning(pop)
  495. #endif
  496. #endif /* DCT_ISLOW_SUPPORTED */