Leaked source code of windows server 2003
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.

1908 lines
53 KiB

  1. ;/* *************************************************************************
  2. ;** INTEL Corporation Proprietary Information
  3. ;**
  4. ;** This listing is supplied under the terms of a license
  5. ;** agreement with INTEL Corporation and may not be copied
  6. ;** nor disclosed except in accordance with the terms of
  7. ;** that agreement.
  8. ;**
  9. ;** Copyright (c) 1995 Intel Corporation.
  10. ;** All Rights Reserved.
  11. ;**
  12. ;** *************************************************************************
  13. ;*/
  14. ;////////////////////////////////////////////////////////////////////////////
  15. ;//
  16. ;// $Header: S:\h26x\src\enc\ex5qrle.asv 1.2 06 Feb 1996 09:12:10 KLILLEVO $
  17. ;// $Log: S:\h26x\src\enc\ex5qrle.asv $
  18. ;//
  19. ;// Rev 1.2 06 Feb 1996 09:12:10 KLILLEVO
  20. ;// now quantizes INTER blocks as TMN5 specifies and simulator does
  21. ;//
  22. ;// Rev 1.1 27 Dec 1995 15:32:48 RMCKENZX
  23. ;// Added copyright notice
  24. ;//
  25. ;////////////////////////////////////////////////////////////////////////////
  26. ; QuantRLE -- This function performs quantization on a block of coefficients
  27. ; and produces (run,level,sign) triples. (These triples are VLC by
  28. ; another routine.) 'run' is unsigned byte integer, 'level' is
  29. ; unsigned byte integer, and 'sign' is a signed byte integer with
  30. ; a value of either 0 or -1.
  31. ; Arguments:
  32. ; CoeffStr: Starting Address of coefficient stream
  33. ; CodeStr: Starting address of code stream; i.e. starting address for code
  34. ; stream triples
  35. ; Returns:
  36. ; Dependencies:
  37. ; The order of coefficient storage comes from e3dctc.inc file. These coeff
  38. ; appear as CxxCxx in this file.
  39. OPTION PROLOGUE:None
  40. OPTION EPILOGUE:ReturnAndRelieveEpilogueMacro
  41. OPTION M510
  42. .xlist
  43. include locals.inc
  44. include memmodel.inc
  45. include e3dctc.inc
  46. .list
  47. ; READ-ONLY TABLE
  48. .CONST
  49. ; QP can range from 1 to 31; but we build the following table for QP from 0 to
  50. ; 31 so that we can use indexing without subtracting 1 from QP or subtracting
  51. ; 8 from the displacement term. In each pair, the first value is "2^32/2*QP"
  52. ; or "2^31/QP". For some QP values, e.g. QP = 3, "2^31/QP" is an infinite
  53. ; bit string. We check the most significant bit of the bit string that we are
  54. ; throwing away, if it is 1 then we increment the value. For eaxmple,
  55. ; 2^31/3 is 2AAAAAAA.AAAAAA... but we use 2AAAAAAB as the table value.
  56. ALIGN 8 ; so that each pair is in a cache line
  57. RecipINTER2QP LABEL DWORD
  58. DWORD 0H ; Recip2QP for QP = 0
  59. DWORD 0H ; QuantINTERSubTerm for QP = 0
  60. DWORD 080000000H ; Recip2QP for QP = 1
  61. DWORD 07FEH ; 0800 - 2*QP - QP/2, QP = 1
  62. DWORD 040000000H ; QP = 2
  63. DWORD 07FBH ; QP = 2
  64. DWORD 02AAAAAABH ; QP = 3
  65. DWORD 07F0H ; QP = 3
  66. DWORD 020000000H ; QP = 4
  67. DWORD 07F6H ; QP = 4
  68. DWORD 01999999AH ; QP = 5
  69. DWORD 07F4H ; QP = 5
  70. DWORD 015555556H ; QP = 6 *****
  71. DWORD 07F1H ; QP = 6
  72. DWORD 012492493H ; QP = 7 *****
  73. DWORD 07EFH ; QP = 7
  74. DWORD 010000000H ; QP = 8
  75. DWORD 07ECH ; QP = 8
  76. DWORD 00E38E38FH ; QP = 9 *****
  77. DWORD 07EAH ; QP = 9
  78. DWORD 00CCCCCCDH ; QP = 10
  79. DWORD 07E7H ; QP = 10
  80. DWORD 00BA2E8BBH ; QP = 11 *****
  81. DWORD 07E5H ; QP = 11
  82. DWORD 00AAAAAABH ; QP = 12
  83. DWORD 07E2H ; QP = 12
  84. DWORD 009D89D8AH ; QP = 13
  85. DWORD 07E0H ; QP = 13
  86. DWORD 00924924AH ; QP = 14 *****
  87. DWORD 07DDH ; QP = 14
  88. DWORD 008888889H ; QP = 15
  89. DWORD 07DBH ; QP = 15
  90. DWORD 008000000H ; QP = 16
  91. DWORD 07D8H ; QP = 16
  92. DWORD 007878788H ; QP = 17
  93. DWORD 07D6H ; QP = 17
  94. DWORD 0071C71C8H ; QP = 18 *****
  95. DWORD 07D3H ; QP = 18
  96. DWORD 006BCA1B0H ; QP = 19 *****
  97. DWORD 07D1H ; QP = 19
  98. DWORD 006666667H ; QP = 20 *****
  99. DWORD 07CEH ; QP = 20
  100. DWORD 006186187H ; QP = 21 *****
  101. DWORD 07CCH ; QP = 21
  102. DWORD 005D1745EH ; QP = 22 *****
  103. DWORD 07C9H ; QP = 22
  104. DWORD 00590B217H ; QP = 23 *****
  105. DWORD 07C7H ; QP = 23
  106. DWORD 005555556H ; QP = 24 *****
  107. DWORD 07C4H ; QP = 24
  108. DWORD 0051EB852H ; QP = 25
  109. DWORD 07C2H ; QP = 25
  110. DWORD 004EC4EC5H ; QP = 26
  111. DWORD 07BFH ; QP = 26
  112. DWORD 004BDA130H ; QP = 27 *****
  113. DWORD 07BDH ; QP = 27
  114. DWORD 004924925H ; QP = 28
  115. DWORD 07BAH ; QP = 28
  116. DWORD 00469EE59H ; QP = 29 *****
  117. DWORD 07B8H ; QP = 29
  118. DWORD 004444445H ; QP = 30 *****
  119. DWORD 07B5H ; QP = 30
  120. DWORD 004210843H ; QP = 31 *****
  121. DWORD 07B3H ; QP = 31
  122. QuantINTERSubTerm = RecipINTER2QP + 4
  123. RecipINTRA2QP LABEL DWORD
  124. DWORD 0H ; Recip2QP for QP = 0
  125. DWORD 0H ; QuantINTRASubTerm for QP = 0
  126. DWORD 080000000H ; Recip2QP for QP = 1
  127. DWORD 07FEH ; 0800 - 2*QP, QP = 1
  128. DWORD 040000000H ; QP = 2
  129. DWORD 07FCH ; QP = 2
  130. DWORD 02AAAAAABH ; QP = 3
  131. DWORD 07FAH ; QP = 3
  132. DWORD 020000000H ; QP = 4
  133. DWORD 07F8H ; QP = 4
  134. DWORD 01999999AH ; QP = 5
  135. DWORD 07F6H ; QP = 5
  136. DWORD 015555556H ; QP = 6 *****
  137. DWORD 07F4H ; QP = 6
  138. DWORD 012492493H ; QP = 7 *****
  139. DWORD 07F2H ; QP = 7
  140. DWORD 010000000H ; QP = 8
  141. DWORD 07F0H ; QP = 8
  142. DWORD 00E38E38FH ; QP = 9 *****
  143. DWORD 07EEH ; QP = 9
  144. DWORD 00CCCCCCDH ; QP = 10
  145. DWORD 07ECH ; QP = 10
  146. DWORD 00BA2E8BBH ; QP = 11 *****
  147. DWORD 07EAH ; QP = 11
  148. DWORD 00AAAAAABH ; QP = 12
  149. DWORD 07E8H ; QP = 12
  150. DWORD 009D89D8AH ; QP = 13
  151. DWORD 07E6H ; QP = 13
  152. DWORD 00924924AH ; QP = 14 *****
  153. DWORD 07E4H ; QP = 14
  154. DWORD 008888889H ; QP = 15
  155. DWORD 07E2H ; QP = 15
  156. DWORD 008000000H ; QP = 16
  157. DWORD 07E0H ; QP = 16
  158. DWORD 007878788H ; QP = 17
  159. DWORD 07DEH ; QP = 17
  160. DWORD 0071C71C8H ; QP = 18 *****
  161. DWORD 07DCH ; QP = 18
  162. DWORD 006BCA1B0H ; QP = 19 *****
  163. DWORD 07DAH ; QP = 19
  164. DWORD 006666667H ; QP = 20 *****
  165. DWORD 07D8H ; QP = 20
  166. DWORD 006186187H ; QP = 21 *****
  167. DWORD 07D6H ; QP = 21
  168. DWORD 005D1745EH ; QP = 22 *****
  169. DWORD 07D4H ; QP = 22
  170. DWORD 00590B217H ; QP = 23 *****
  171. DWORD 07D2H ; QP = 23
  172. DWORD 005555556H ; QP = 24 *****
  173. DWORD 07D0H ; QP = 24
  174. DWORD 0051EB852H ; QP = 25
  175. DWORD 07CEH ; QP = 25
  176. DWORD 004EC4EC5H ; QP = 26
  177. DWORD 07CCH ; QP = 26
  178. DWORD 004BDA130H ; QP = 27 *****
  179. DWORD 07CAH ; QP = 27
  180. DWORD 004924925H ; QP = 28
  181. DWORD 07C8H ; QP = 28
  182. DWORD 00469EE59H ; QP = 29 *****
  183. DWORD 07C6H ; QP = 29
  184. DWORD 004444445H ; QP = 30 *****
  185. DWORD 07C4H ; QP = 30
  186. DWORD 004210843H ; QP = 31 *****
  187. DWORD 07C2H ; QP = 31
  188. QuantINTRASubTerm = RecipINTRA2QP + 4
  189. .CODE
  190. ASSUME cs : FLAT
  191. ASSUME ds : FLAT
  192. ASSUME es : FLAT
  193. ASSUME fs : FLAT
  194. ASSUME gs : FLAT
  195. ASSUME ss : FLAT
  196. QUANTRLE proc C ACoeffStr: DWORD, ACodeStr:DWORD, AQP:DWORD, AIntraFlag:DWORD
  197. LocalFrameSize = 8
  198. RegisterStorageSize = 16
  199. SIGNHIGH = 1
  200. SIGNLOW = 17
  201. IsINTRA = 1
  202. ;;;;; Arguments:
  203. ACoeffStr_arg = LocalFrameSize + RegisterStorageSize + 4
  204. ACodeStr_arg = LocalFrameSize + RegisterStorageSize + 8
  205. AQP_arg = LocalFrameSize + RegisterStorageSize + 12
  206. AIntraFlag_arg= LocalFrameSize + RegisterStorageSize + 16
  207. ;;;;; Locals (on local stack frame)
  208. QST EQU 0
  209. R2P EQU 4
  210. push esi
  211. push edi
  212. push ebp
  213. push ebx
  214. sub esp, LocalFrameSize
  215. mov cl, 63 ; Initialize run-length (64 - 1)
  216. mov ebx, PD [esp+AQP_arg] ; copy parameters
  217. mov esi, PD [esp+ACoeffStr_arg]
  218. mov edx, RecipINTRA2QP[ebx*8] ; RecipINTRA2QP = RecipINTER2QP
  219. mov edi, PD [esp+ACodeStr_arg]
  220. mov [esp + R2P], edx ; store Recip2QP[QP] as local variable
  221. mov al, PB [esp+AIntraFlag_arg]
  222. mov edx, PD [esi+C00C02] ; First coeff
  223. test al, IsINTRA
  224. je QuantINTERC00
  225. ;
  226. ; OPTIMIZATIONS:
  227. ; The usual code to compute absolute value has been enhanced to subtract the
  228. ; bias without using extra instructions or cycles. Division is achieved by
  229. ; multiplying with the reciprocal value. High AC coefficients that will
  230. ; almost always be 0 are moved out-of-line towards the end of the routine.
  231. ; This reduces the execution time if the conditional branch is not in the BTB;
  232. ; it also reduces L1 footprint.
  233. ; There is one more optimization I want to implement: pair instructions such
  234. ; that the conditional branch instruction is executed in the U pipe. The
  235. ; mispredicted branch penalty for U pipe is 3 and for V pipe is 4. Since the
  236. ; low AC branches will frequently be mispredicted, this is a worthwhile
  237. ; optimization.
  238. ;
  239. ; esi -- base addr of coefficients; the order expected is the same as produced
  240. ; by Fast DCT
  241. ; edi -- RLE stream cursor
  242. ; ebx -- QP
  243. ; ecx -- run value indicator
  244. ; edx -- normally used to load coefficients
  245. ; eax,ebp -- scratch registers
  246. ;
  247. QuantINTRAC00:
  248. mov edx, QuantINTRASubTerm[ebx*8] ; Fetch QuantSubTerm for INTRA
  249. mov eax, PD [esi+C00C02]
  250. mov [esp + QST], edx ; Store QuantSubTerm as local variable
  251. mov PB [edi], 0H ; Run-length
  252. sar eax, 23 ; 8-bit signed INTRA-DC value
  253. mov edx, PD [esi+C01C03] ; Pre-load next coefficient
  254. mov PB [edi+2], ah ; sign of DC
  255. jnz @f
  256. mov al, 1
  257. @@:
  258. mov PB [edi+1], al ; DC
  259. add edi, 3
  260. mov cl, 62 ; 64 - Index (2 for C01)
  261. jmp QuantC01
  262. QuantINTERC00:
  263. mov eax, QuantINTERSubTerm[ebx*8] ; Fetch QuantSubTerm for INTER
  264. sal edx, SIGNHIGH ; C == sign of the coefficient
  265. sbb ebp, ebp ; -1 if coeff is negative else 0
  266. mov [esp + QST], eax ; store QuantSubTerm as local variable
  267. add eax, ebp
  268. xor ebp, edx
  269. shr ebp, 21 ; magnitude
  270. mov edx, PD [esi+C01C03] ; Pre-load next coeff
  271. sub eax, ebp
  272. jl QuantC01
  273. lea eax, [eax+2*ebx]
  274. mov cl, 62 ; Initialize run length counter
  275. mul PD [esp + R2P]
  276. ;
  277. mov eax, PD [esi+C00C02] ; Refetch orig. constant to check for sign
  278. mov PB [edi+1], dl ; Write quantized coefficient
  279. shr eax, 31
  280. mov PB [edi], 0H ; Write run length
  281. sub eax, 1 ; -1 if negative coefficient
  282. mov edx, PD [esi+C01C03] ; Next coefficient
  283. mov PB [edi+2], al ; Write sign
  284. add edi, 3 ; Increment output pointer
  285. QuantC01:
  286. sal edx, SIGNHIGH ; C == sign of the coefficient
  287. mov eax, [esp + QST] ; 0 for INTRA, QP for INTER
  288. sbb ebp, ebp ; -1 if coeff is negative else 0
  289. ; ;
  290. add eax, ebp
  291. xor ebp, edx
  292. shr ebp, 21 ; magnitude
  293. mov edx, PD [esi+C10C12] ; Pre-load next coeff
  294. sub eax, ebp
  295. jl QuantC10
  296. lea eax, [eax+2*ebx]
  297. sub cl, 62 ; compute run-length
  298. mul PD [esp + R2P]
  299. ;
  300. mov eax, PD [esi+C01C03] ; Refetch orig. constant to check for sign
  301. mov PB [edi+1], dl ; Write quantized coefficient
  302. shr eax, 31
  303. mov PB [edi], cl ; Write run length
  304. sub eax, 1 ; -1 if negative coefficient
  305. mov edx, PD [esi+C10C12] ; Next coefficient
  306. mov PB [edi+2], al ; Write sign
  307. mov cl, 61 ; Initialize run length counter
  308. add edi, 3 ; Increment output pointer
  309. mov eax, eax ; To keep pairing happy
  310. QuantC10:
  311. sal edx, SIGNHIGH
  312. mov eax, [esp + QST]
  313. sbb ebp, ebp
  314. ;
  315. add eax, ebp
  316. xor ebp, edx
  317. shr ebp, 21
  318. mov edx, PD [esi+C20C22]
  319. sub eax, ebp
  320. jl QuantC20
  321. lea eax, [eax+2*ebx]
  322. sub cl, 61
  323. mul PD [esp + R2P]
  324. ;
  325. mov eax, PD [esi+C10C12]
  326. mov PB [edi+1], dl
  327. shr eax, 31
  328. mov PB [edi], cl
  329. sub eax, 1
  330. mov edx, PD [esi+C20C22]
  331. mov PB [edi+2], al
  332. mov cl, 60
  333. add edi, 3
  334. mov eax, eax
  335. QuantC20:
  336. sal edx, SIGNHIGH
  337. mov eax, [esp + QST]
  338. sbb ebp, ebp
  339. ;
  340. add eax, ebp
  341. xor ebp, edx
  342. shr ebp, 21
  343. mov edx, PD [esi+C11C13]
  344. sub eax, ebp
  345. jl QuantC11
  346. lea eax, [eax+2*ebx]
  347. sub cl, 60
  348. mul PD [esp + R2P]
  349. ;
  350. mov eax, PD [esi+C20C22]
  351. mov PB [edi+1], dl
  352. shr eax, 31
  353. mov PB [edi], cl
  354. sub eax, 1
  355. mov edx, PD [esi+C11C13]
  356. mov PB [edi+2], al
  357. mov cl, 59 ;
  358. add edi, 3
  359. mov eax, eax
  360. QuantC11:
  361. sal edx, SIGNHIGH
  362. mov eax, [esp + QST]
  363. sbb ebp, ebp
  364. ;
  365. add eax, ebp
  366. xor ebp, edx
  367. shr ebp, 21
  368. mov edx, PD [esi+C00C02]
  369. sub eax, ebp
  370. jl QuantC02
  371. lea eax, [eax+2*ebx]
  372. sub cl, 59
  373. mul PD [esp + R2P]
  374. ;
  375. mov eax, PD [esi+C11C13]
  376. mov PB [edi+1], dl
  377. shr eax, 31
  378. mov PB [edi], cl
  379. sub eax, 1
  380. mov edx, PD [esi+C00C02]
  381. mov PB [edi+2], al
  382. mov cl, 58
  383. add edi, 3
  384. mov eax, eax
  385. QuantC02:
  386. sal edx, SIGNLOW
  387. mov eax, [esp + QST]
  388. sbb ebp, ebp
  389. ;
  390. add eax, ebp
  391. xor ebp, edx
  392. shr ebp, 21
  393. mov edx, PD [esi+C01C03]
  394. sub eax, ebp
  395. jl QuantC03
  396. lea eax, [eax+2*ebx]
  397. sub cl, 58
  398. mul PD [esp + R2P]
  399. ;
  400. mov eax, PD [esi+C00C02]
  401. mov PB [edi+1], dl
  402. shl eax, 16
  403. mov PB [edi], cl
  404. shr eax, 31
  405. mov cl, 57
  406. mov edx, PD [esi+C01C03]
  407. sub eax, 1
  408. mov PB [edi+2], al
  409. add edi, 3
  410. QuantC03:
  411. sal edx, SIGNLOW
  412. mov eax, [esp + QST]
  413. sbb ebp, ebp
  414. ;
  415. add eax, ebp
  416. xor ebp, edx
  417. shr ebp, 21
  418. mov edx, PD [esi+C10C12]
  419. sub eax, ebp
  420. jl QuantC12
  421. lea eax, [eax+2*ebx]
  422. sub cl, 57
  423. mul PD [esp + R2P]
  424. ;
  425. mov eax, PD [esi+C01C03]
  426. mov PB [edi+1], dl
  427. shl eax, 16
  428. mov PB [edi], cl
  429. shr eax, 31
  430. mov cl, 56
  431. mov edx, PD [esi+C10C12]
  432. sub eax, 1
  433. mov PB [edi+2], al
  434. add edi, 3
  435. QuantC12:
  436. sal edx, SIGNLOW
  437. mov eax, [esp + QST]
  438. sbb ebp, ebp
  439. ;
  440. add eax, ebp
  441. xor ebp, edx
  442. shr ebp, 21
  443. mov edx, PD [esi+C21C23]
  444. sub eax, ebp
  445. jl QuantC21
  446. lea eax, [eax+2*ebx]
  447. sub cl, 56
  448. mul PD [esp + R2P]
  449. ;
  450. mov eax, PD [esi+C10C12]
  451. mov PB [edi+1], dl
  452. shl eax, 16
  453. mov PB [edi], cl
  454. shr eax, 31
  455. mov cl, 55
  456. mov edx, PD [esi+C21C23]
  457. sub eax, 1
  458. mov PB [edi+2], al
  459. add edi, 3
  460. QuantC21:
  461. sal edx, SIGNHIGH
  462. mov eax, [esp + QST]
  463. sbb ebp, ebp
  464. ;
  465. add eax, ebp
  466. xor ebp, edx
  467. shr ebp, 21
  468. mov edx, PD [esi+C30C32]
  469. sub eax, ebp
  470. jl QuantC30
  471. lea eax, [eax+2*ebx]
  472. sub cl, 55
  473. mul PD [esp + R2P]
  474. ;
  475. mov eax, PD [esi+C21C23]
  476. mov PB [edi+1], dl
  477. shr eax, 31
  478. mov PB [edi], cl
  479. sub eax, 1
  480. mov edx, PD [esi+C30C32]
  481. mov PB [edi+2], al
  482. mov cl, 54
  483. add edi, 3
  484. mov eax, eax
  485. QuantC30:
  486. sal edx, SIGNHIGH
  487. mov eax, [esp + QST]
  488. sbb ebp, ebp
  489. ;
  490. add eax, ebp
  491. xor ebp, edx
  492. shr ebp, 21
  493. mov edx, PD [esi+C40C42]
  494. sub eax, ebp
  495. jl QuantC40
  496. lea eax, [eax+2*ebx]
  497. sub cl, 54
  498. mul PD [esp + R2P]
  499. ;
  500. mov eax, PD [esi+C30C32]
  501. mov PB [edi+1], dl
  502. shr eax, 31
  503. mov PB [edi], cl
  504. sub eax, 1
  505. mov edx, PD [esi+C40C42]
  506. mov PB [edi+2], al
  507. mov cl, 53
  508. add edi, 3
  509. mov eax, eax
  510. QuantC40:
  511. sal edx, SIGNHIGH
  512. mov eax, [esp + QST]
  513. sbb ebp, ebp
  514. ;
  515. add eax, ebp
  516. xor ebp, edx
  517. shr ebp, 21
  518. mov edx, PD [esi+C31C33]
  519. sub eax, ebp
  520. jl QuantC31
  521. lea eax, [eax+2*ebx]
  522. sub cl, 53
  523. mul PD [esp + R2P]
  524. ;
  525. mov eax, PD [esi+C40C42]
  526. mov PB [edi+1], dl
  527. shr eax, 31
  528. mov PB [edi], cl
  529. sub eax, 1
  530. mov edx, PD [esi+C31C33]
  531. mov PB [edi+2], al
  532. mov cl, 52
  533. add edi, 3
  534. mov eax, eax
  535. QuantC31:
  536. sal edx, SIGNHIGH
  537. mov eax, [esp + QST]
  538. sbb ebp, ebp
  539. ;
  540. add eax, ebp
  541. xor ebp, edx
  542. shr ebp, 21
  543. mov edx, PD [esi+C20C22]
  544. sub eax, ebp
  545. jl QuantC22
  546. lea eax, [eax+2*ebx]
  547. sub cl, 52
  548. mul PD [esp + R2P]
  549. ;
  550. mov eax, PD [esi+C31C33]
  551. mov PB [edi+1], dl
  552. shr eax, 31
  553. mov PB [edi], cl
  554. sub eax, 1
  555. mov edx, PD [esi+C20C22]
  556. mov PB [edi+2], al
  557. mov cl, 51
  558. add edi, 3
  559. mov eax, eax
  560. QuantC22:
  561. sal edx, SIGNLOW
  562. mov eax, [esp + QST]
  563. sbb ebp, ebp
  564. ;
  565. add eax, ebp
  566. xor ebp, edx
  567. shr ebp, 21
  568. mov edx, PD [esi+C11C13]
  569. sub eax, ebp
  570. jl QuantC13
  571. lea eax, [eax+2*ebx]
  572. sub cl, 51
  573. mul PD [esp + R2P]
  574. ;
  575. mov eax, PD [esi+C20C22]
  576. mov PB [edi+1], dl
  577. shl eax, 16
  578. mov PB [edi], cl
  579. shr eax, 31
  580. mov cl, 50
  581. mov edx, PD [esi+C11C13]
  582. sub eax, 1
  583. mov PB [edi+2], al
  584. add edi, 3
  585. QuantC13:
  586. sal edx, SIGNLOW
  587. mov eax, [esp + QST]
  588. sbb ebp, ebp
  589. ;
  590. add eax, ebp
  591. xor ebp, edx
  592. shr ebp, 21
  593. mov edx, PD [esi+C04C06]
  594. sub eax, ebp
  595. jl QuantC04
  596. lea eax, [eax+2*ebx]
  597. sub cl, 50
  598. mul PD [esp + R2P]
  599. ;
  600. mov eax, PD [esi+C11C13]
  601. mov PB [edi+1], dl
  602. shl eax, 16
  603. mov PB [edi], cl
  604. shr eax, 31
  605. mov cl, 49
  606. mov edx, PD [esi+C04C06]
  607. sub eax, 1
  608. mov PB [edi+2], al
  609. add edi, 3
  610. QuantC04:
  611. sal edx, SIGNHIGH
  612. mov eax, [esp + QST]
  613. sbb ebp, ebp
  614. ;
  615. add eax, ebp
  616. xor ebp, edx
  617. shr ebp, 21
  618. mov edx, PD [esi+C07C05]
  619. sub eax, ebp
  620. jl QuantC05
  621. lea eax, [eax+2*ebx]
  622. sub cl, 49
  623. mul PD [esp + R2P]
  624. ;
  625. mov eax, PD [esi+C04C06]
  626. mov PB [edi+1], dl
  627. shr eax, 31
  628. mov PB [edi], cl
  629. sub eax, 1
  630. mov edx, PD [esi+C07C05]
  631. mov PB [edi+2], al
  632. mov cl, 48
  633. add edi, 3
  634. mov eax, eax
  635. QuantC05:
  636. sal edx, SIGNLOW
  637. mov eax, [esp + QST]
  638. sbb ebp, ebp
  639. ;
  640. add eax, ebp
  641. xor ebp, edx
  642. shr ebp, 21
  643. mov edx, PD [esi+C14C16]
  644. sub eax, ebp
  645. jl QuantC14
  646. lea eax, [eax+2*ebx]
  647. sub cl, 48
  648. mul PD [esp + R2P]
  649. ;
  650. mov eax, PD [esi+C07C05]
  651. mov PB [edi+1], dl
  652. shl eax, 16
  653. mov PB [edi], cl
  654. shr eax, 31
  655. mov cl, 47
  656. mov edx, PD [esi+C14C16]
  657. sub eax, 1
  658. mov PB [edi+2], al
  659. add edi, 3
  660. QuantC14:
  661. sal edx, SIGNHIGH
  662. mov eax, [esp + QST]
  663. sbb ebp, ebp
  664. ;
  665. add eax, ebp
  666. xor ebp, edx
  667. shr ebp, 21
  668. mov edx, PD [esi+C21C23]
  669. sub eax, ebp
  670. jl QuantC23
  671. lea eax, [eax+2*ebx]
  672. sub cl, 47
  673. mul PD [esp + R2P]
  674. ;
  675. mov eax, PD [esi+C14C16]
  676. mov PB [edi+1], dl
  677. shr eax, 31
  678. mov PB [edi], cl
  679. sub eax, 1
  680. mov edx, PD [esi+C21C23]
  681. mov PB [edi+2], al
  682. mov cl, 46
  683. add edi, 3
  684. mov eax, eax
  685. QuantC23:
  686. sal edx, SIGNLOW
  687. mov eax, [esp + QST]
  688. sbb ebp, ebp
  689. ;
  690. add eax, ebp
  691. xor ebp, edx
  692. shr ebp, 21
  693. mov edx, PD [esi+C30C32]
  694. sub eax, ebp
  695. jl QuantC32
  696. lea eax, [eax+2*ebx]
  697. sub cl, 46
  698. mul PD [esp + R2P]
  699. ;
  700. mov eax, PD [esi+C21C23]
  701. mov PB [edi+1], dl
  702. shl eax, 16
  703. mov PB [edi], cl
  704. shr eax, 31
  705. mov cl, 45
  706. mov edx, PD [esi+C30C32]
  707. sub eax, 1
  708. mov PB [edi+2], al
  709. add edi, 3
  710. QuantC32:
  711. sal edx, SIGNLOW
  712. mov eax, [esp + QST]
  713. sbb ebp, ebp
  714. ;
  715. add eax, ebp
  716. xor ebp, edx
  717. shr ebp, 21
  718. mov edx, PD [esi+C41C43]
  719. sub eax, ebp
  720. jl QuantC41
  721. lea eax, [eax+2*ebx]
  722. sub cl, 45
  723. mul PD [esp + R2P]
  724. ;
  725. mov eax, PD [esi+C30C32]
  726. mov PB [edi+1], dl
  727. shl eax, 16
  728. mov PB [edi], cl
  729. shr eax, 31
  730. mov cl, 44
  731. mov edx, PD [esi+C41C43]
  732. sub eax, 1
  733. mov PB [edi+2], al
  734. add edi, 3
  735. QuantC41:
  736. sal edx, SIGNHIGH
  737. mov eax, [esp + QST]
  738. sbb ebp, ebp
  739. ;
  740. add eax, ebp
  741. xor ebp, edx
  742. shr ebp, 21
  743. mov edx, PD [esi+C50C52]
  744. sub eax, ebp
  745. jl QuantC50
  746. lea eax, [eax+2*ebx]
  747. sub cl, 44
  748. mul PD [esp + R2P]
  749. ;
  750. mov eax, PD [esi+C41C43]
  751. mov PB [edi+1], dl
  752. shr eax, 31
  753. mov PB [edi], cl
  754. sub eax, 1
  755. mov edx, PD [esi+C50C52]
  756. mov PB [edi+2], al
  757. mov cl, 43
  758. add edi, 3
  759. mov eax, eax
  760. QuantC50:
  761. sal edx, SIGNHIGH
  762. mov eax, [esp + QST]
  763. sbb ebp, ebp
  764. ;
  765. add eax, ebp
  766. xor ebp, edx
  767. shr ebp, 21
  768. mov edx, PD [esi+C60C62]
  769. sub eax, ebp
  770. jl QuantC60
  771. lea eax, [eax+2*ebx]
  772. sub cl, 43
  773. mul PD [esp + R2P]
  774. ;
  775. mov eax, PD [esi+C50C52]
  776. mov PB [edi+1], dl
  777. shr eax, 31
  778. mov PB [edi], cl
  779. sub eax, 1
  780. mov edx, PD [esi+C60C62]
  781. mov PB [edi+2], al
  782. mov cl, 42
  783. add edi, 3
  784. mov eax, eax
  785. QuantC60:
  786. sal edx, SIGNHIGH
  787. mov eax, [esp + QST]
  788. sbb ebp, ebp
  789. ;
  790. add eax, ebp
  791. xor ebp, edx
  792. shr ebp, 21
  793. mov edx, PD [esi+C51C53]
  794. sub eax, ebp
  795. jl QuantC51
  796. lea eax, [eax+2*ebx]
  797. sub cl, 42
  798. mul PD [esp + R2P]
  799. ;
  800. mov eax, PD [esi+C60C62]
  801. mov PB [edi+1], dl
  802. shr eax, 31
  803. mov PB [edi], cl
  804. sub eax, 1
  805. mov edx, PD [esi+C51C53]
  806. mov PB [edi+2], al
  807. mov cl, 41
  808. add edi, 3
  809. mov eax, eax
  810. QuantC51:
  811. sal edx, SIGNHIGH
  812. mov eax, [esp + QST]
  813. sbb ebp, ebp
  814. ;
  815. add eax, ebp
  816. xor ebp, edx
  817. shr ebp, 21
  818. mov edx, PD [esi+C40C42]
  819. sub eax, ebp
  820. jl QuantC42
  821. lea eax, [eax+2*ebx]
  822. sub cl, 41
  823. mul PD [esp + R2P]
  824. ;
  825. mov eax, PD [esi+C51C53]
  826. mov PB [edi+1], dl
  827. shr eax, 31
  828. mov PB [edi], cl
  829. sub eax, 1
  830. mov edx, PD [esi+C40C42]
  831. mov PB [edi+2], al
  832. mov cl, 40
  833. add edi, 3
  834. mov eax, eax
  835. QuantC42:
  836. sal edx, SIGNLOW
  837. mov eax, [esp + QST]
  838. sbb ebp, ebp
  839. ;
  840. add eax, ebp
  841. xor ebp, edx
  842. shr ebp, 21
  843. mov edx, PD [esi+C31C33]
  844. sub eax, ebp
  845. jl QuantC33
  846. lea eax, [eax+2*ebx]
  847. sub cl, 40
  848. mul PD [esp + R2P]
  849. ;
  850. mov eax, PD [esi+C40C42]
  851. mov PB [edi+1], dl
  852. shl eax, 16
  853. mov PB [edi], cl
  854. shr eax, 31
  855. mov cl, 39
  856. mov edx, PD [esi+C31C33]
  857. sub eax, 1
  858. mov PB [edi+2], al
  859. add edi, 3
  860. QuantC33:
  861. sal edx, SIGNLOW
  862. mov eax, [esp + QST]
  863. sbb ebp, ebp
  864. ;
  865. add eax, ebp
  866. xor ebp, edx
  867. shr ebp, 21
  868. mov edx, PD [esi+C24C26]
  869. sub eax, ebp
  870. jl QuantC24
  871. lea eax, [eax+2*ebx]
  872. sub cl, 39
  873. mul PD [esp + R2P]
  874. ;
  875. mov eax, PD [esi+C31C33]
  876. mov PB [edi+1], dl
  877. shl eax, 16
  878. mov PB [edi], cl
  879. shr eax, 31
  880. mov cl, 38
  881. mov edx, PD [esi+C24C26]
  882. sub eax, 1
  883. mov PB [edi+2], al
  884. add edi, 3
  885. QuantC24:
  886. sal edx, SIGNHIGH
  887. mov eax, [esp + QST]
  888. sbb ebp, ebp
  889. ;
  890. add eax, ebp
  891. xor ebp, edx
  892. shr ebp, 21
  893. mov edx, PD [esi+C17C15]
  894. sub eax, ebp
  895. jl QuantC15
  896. lea eax, [eax+2*ebx]
  897. sub cl, 38
  898. mul PD [esp + R2P]
  899. ;
  900. mov eax, PD [esi+C24C26]
  901. mov PB [edi+1], dl
  902. shr eax, 31
  903. mov PB [edi], cl
  904. sub eax, 1
  905. mov edx, PD [esi+C17C15]
  906. mov PB [edi+2], al
  907. mov cl, 37
  908. add edi, 3
  909. mov eax, eax
  910. QuantC15:
  911. sal edx, SIGNLOW
  912. mov eax, [esp + QST]
  913. sbb ebp, ebp
  914. ;
  915. add eax, ebp
  916. xor ebp, edx
  917. shr ebp, 21
  918. mov edx, PD [esi+C04C06]
  919. sub eax, ebp
  920. jl QuantC06
  921. lea eax, [eax+2*ebx]
  922. sub cl, 37
  923. mul PD [esp + R2P]
  924. ;
  925. mov eax, PD [esi+C17C15]
  926. mov PB [edi+1], dl
  927. shl eax, 16
  928. mov PB [edi], cl
  929. shr eax, 31
  930. mov cl, 36
  931. mov edx, PD [esi+C04C06]
  932. sub eax, 1
  933. mov PB [edi+2], al
  934. add edi, 3
  935. QuantC06:
  936. sal edx, SIGNLOW
  937. mov eax, [esp + QST]
  938. sbb ebp, ebp
  939. ;
  940. add eax, ebp
  941. xor ebp, edx
  942. shr ebp, 21
  943. mov edx, PD [esi+C07C05]
  944. sub eax, ebp
  945. jl QuantC07
  946. lea eax, [eax+2*ebx]
  947. sub cl, 36
  948. mul PD [esp + R2P]
  949. ;
  950. mov eax, PD [esi+C04C06]
  951. mov PB [edi+1], dl
  952. shl eax, 16
  953. mov PB [edi], cl
  954. shr eax, 31
  955. mov cl, 35
  956. mov edx, PD [esi+C07C05]
  957. sub eax, 1
  958. mov PB [edi+2], al
  959. add edi, 3
  960. QuantC07:
  961. sal edx, SIGNHIGH
  962. mov eax, [esp + QST]
  963. sbb ebp, ebp
  964. ;
  965. add eax, ebp
  966. xor ebp, edx
  967. shr ebp, 21
  968. mov edx, PD [esi+C14C16]
  969. sub eax, ebp
  970. jl QuantC16
  971. lea eax, [eax+2*ebx]
  972. sub cl, 35
  973. mul PD [esp + R2P]
  974. ;
  975. mov eax, PD [esi+C07C05]
  976. mov PB [edi+1], dl
  977. shr eax, 31
  978. mov PB [edi], cl
  979. sub eax, 1
  980. mov edx, PD [esi+C14C16]
  981. mov PB [edi+2], al
  982. mov cl, 34
  983. add edi, 3
  984. mov eax, eax
  985. QuantC16:
  986. sal edx, SIGNLOW
  987. mov eax, [esp + QST]
  988. sbb ebp, ebp
  989. ;
  990. add eax, ebp
  991. xor ebp, edx
  992. shr ebp, 21
  993. mov edx, PD [esi+C27C25]
  994. sub eax, ebp
  995. jl QuantC25
  996. lea eax, [eax+2*ebx]
  997. sub cl, 34
  998. mul PD [esp + R2P]
  999. ;
  1000. mov eax, PD [esi+C14C16]
  1001. mov PB [edi+1], dl
  1002. shl eax, 16
  1003. mov PB [edi], cl
  1004. shr eax, 31
  1005. mov cl, 33
  1006. mov edx, PD [esi+C27C25]
  1007. sub eax, 1
  1008. mov PB [edi+2], al
  1009. add edi, 3
  1010. QuantC25:
  1011. sal edx, SIGNLOW
  1012. mov eax, [esp + QST]
  1013. sbb ebp, ebp
  1014. ;
  1015. add eax, ebp
  1016. xor ebp, edx
  1017. shr ebp, 21
  1018. mov edx, PD [esi+C34C36]
  1019. sub eax, ebp
  1020. jl QuantC34
  1021. lea eax, [eax+2*ebx]
  1022. sub cl, 33
  1023. mul PD [esp + R2P]
  1024. ;
  1025. mov eax, PD [esi+C27C25]
  1026. mov PB [edi+1], dl
  1027. shl eax, 16
  1028. mov PB [edi], cl
  1029. shr eax, 31
  1030. mov cl, 32
  1031. mov edx, PD [esi+C34C36]
  1032. sub eax, 1
  1033. mov PB [edi+2], al
  1034. add edi, 3
  1035. QuantC34:
  1036. sal edx, SIGNHIGH
  1037. mov eax, [esp + QST]
  1038. sbb ebp, ebp
  1039. ;
  1040. add eax, ebp
  1041. xor ebp, edx
  1042. shr ebp, 21
  1043. mov edx, PD [esi+C41C43]
  1044. sub eax, ebp
  1045. jl QuantC43
  1046. lea eax, [eax+2*ebx]
  1047. sub cl, 32
  1048. mul PD [esp + R2P]
  1049. ;
  1050. mov eax, PD [esi+C34C36]
  1051. mov PB [edi+1], dl
  1052. shr eax, 31
  1053. mov PB [edi], cl
  1054. sub eax, 1
  1055. mov edx, PD [esi+C41C43]
  1056. mov PB [edi+2], al
  1057. mov cl, 31
  1058. add edi, 3
  1059. mov eax, eax
  1060. QuantC43:
  1061. sal edx, SIGNLOW
  1062. mov eax, [esp + QST]
  1063. sbb ebp, ebp
  1064. ;
  1065. add eax, ebp
  1066. xor ebp, edx
  1067. shr ebp, 21
  1068. mov edx, PD [esi+C50C52]
  1069. sub eax, ebp
  1070. jl QuantC52
  1071. lea eax, [eax+2*ebx]
  1072. sub cl, 31
  1073. mul PD [esp + R2P]
  1074. ;
  1075. mov eax, PD [esi+C41C43]
  1076. mov PB [edi+1], dl
  1077. shl eax, 16
  1078. mov PB [edi], cl
  1079. shr eax, 31
  1080. mov cl, 30
  1081. mov edx, PD [esi+C50C52]
  1082. sub eax, 1
  1083. mov PB [edi+2], al
  1084. add edi, 3
  1085. QuantC52:
  1086. sal edx, SIGNLOW
  1087. mov eax, [esp + QST]
  1088. sbb ebp, ebp
  1089. ;
  1090. add eax, ebp
  1091. xor ebp, edx
  1092. shr ebp, 21
  1093. mov edx, PD [esi+C61C63]
  1094. sub eax, ebp
  1095. jl QuantC61
  1096. lea eax, [eax+2*ebx]
  1097. sub cl, 30
  1098. mul PD [esp + R2P]
  1099. ;
  1100. mov eax, PD [esi+C50C52]
  1101. mov PB [edi+1], dl
  1102. shl eax, 16
  1103. mov PB [edi], cl
  1104. shr eax, 31
  1105. mov cl, 29
  1106. mov edx, PD [esi+C61C63]
  1107. sub eax, 1
  1108. mov PB [edi+2], al
  1109. add edi, 3
  1110. QuantC61:
  1111. sal edx, SIGNHIGH
  1112. mov eax, [esp + QST]
  1113. sbb ebp, ebp
  1114. ;
  1115. add eax, ebp
  1116. xor ebp, edx
  1117. shr ebp, 21
  1118. mov edx, PD [esi+C70C72]
  1119. sub eax, ebp
  1120. jge QuantNZC61
  1121. QuantC70:
  1122. sal edx, SIGNHIGH
  1123. mov eax, [esp + QST]
  1124. sbb ebp, ebp
  1125. ;
  1126. add eax, ebp
  1127. xor ebp, edx
  1128. shr ebp, 21
  1129. mov edx, PD [esi+C71C73]
  1130. sub eax, ebp
  1131. jge QuantNZC70
  1132. QuantC71:
  1133. sal edx, SIGNHIGH
  1134. mov eax, [esp + QST]
  1135. sbb ebp, ebp
  1136. ;
  1137. add eax, ebp
  1138. xor ebp, edx
  1139. shr ebp, 21
  1140. mov edx, PD [esi+C60C62]
  1141. sub eax, ebp
  1142. jge QuantNZC71
  1143. QuantC62:
  1144. sal edx, SIGNLOW
  1145. mov eax, [esp + QST]
  1146. sbb ebp, ebp
  1147. ;
  1148. add eax, ebp
  1149. xor ebp, edx
  1150. shr ebp, 21
  1151. mov edx, PD [esi+C51C53]
  1152. sub eax, ebp
  1153. jl QuantC53
  1154. lea eax, [eax+2*ebx]
  1155. sub cl, 26
  1156. mul PD [esp + R2P]
  1157. ;
  1158. mov eax, PD [esi+C60C62]
  1159. mov PB [edi+1], dl
  1160. shl eax, 16
  1161. mov PB [edi], cl
  1162. shr eax, 31
  1163. mov cl, 25
  1164. mov edx, PD [esi+C51C53]
  1165. sub eax, 1
  1166. mov PB [edi+2], al
  1167. add edi, 3
  1168. QuantC53:
  1169. sal edx, SIGNLOW
  1170. mov eax, [esp + QST]
  1171. sbb ebp, ebp
  1172. ;
  1173. add eax, ebp
  1174. xor ebp, edx
  1175. shr ebp, 21
  1176. mov edx, PD [esi+C44C46]
  1177. sub eax, ebp
  1178. jl QuantC44
  1179. lea eax, [eax+2*ebx]
  1180. sub cl, 25
  1181. mul PD [esp + R2P]
  1182. ;
  1183. mov eax, PD [esi+C51C53]
  1184. mov PB [edi+1], dl
  1185. shl eax, 16
  1186. mov PB [edi], cl
  1187. shr eax, 31
  1188. mov cl, 24
  1189. mov edx, PD [esi+C44C46]
  1190. sub eax, 1
  1191. mov PB [edi+2], al
  1192. add edi, 3
  1193. QuantC44:
  1194. sal edx, SIGNHIGH
  1195. mov eax, [esp + QST]
  1196. sbb ebp, ebp
  1197. ;
  1198. add eax, ebp
  1199. xor ebp, edx
  1200. shr ebp, 21
  1201. mov edx, PD [esi+C37C35]
  1202. sub eax, ebp
  1203. jge QuantNZC44
  1204. QuantC35:
  1205. sal edx, SIGNLOW
  1206. mov eax, [esp + QST]
  1207. sbb ebp, ebp
  1208. ;
  1209. add eax, ebp
  1210. xor ebp, edx
  1211. shr ebp, 21
  1212. mov edx, PD [esi+C24C26]
  1213. sub eax, ebp
  1214. jl QuantC26
  1215. lea eax, [eax+2*ebx]
  1216. sub cl, 23
  1217. mul PD [esp + R2P]
  1218. ;
  1219. mov eax, PD [esi+C37C35]
  1220. mov PB [edi+1], dl
  1221. shl eax, 16
  1222. mov PB [edi], cl
  1223. shr eax, 31
  1224. mov cl, 22
  1225. mov edx, PD [esi+C24C26]
  1226. sub eax, 1
  1227. mov PB [edi+2], al
  1228. add edi, 3
  1229. QuantC26:
  1230. sal edx, SIGNLOW
  1231. mov eax, [esp + QST]
  1232. sbb ebp, ebp
  1233. ;
  1234. add eax, ebp
  1235. xor ebp, edx
  1236. shr ebp, 21
  1237. mov edx, PD [esi+C17C15]
  1238. sub eax, ebp
  1239. jl QuantC17
  1240. lea eax, [eax+2*ebx]
  1241. sub cl, 22
  1242. mul PD [esp + R2P]
  1243. ;
  1244. mov eax, PD [esi+C24C26]
  1245. mov PB [edi+1], dl
  1246. shl eax, 16
  1247. mov PB [edi], cl
  1248. shr eax, 31
  1249. mov cl, 21
  1250. mov edx, PD [esi+C17C15]
  1251. sub eax, 1
  1252. mov PB [edi+2], al
  1253. add edi, 3
  1254. QuantC17:
  1255. sal edx, SIGNHIGH
  1256. mov eax, [esp + QST]
  1257. sbb ebp, ebp
  1258. ;
  1259. add eax, ebp
  1260. xor ebp, edx
  1261. shr ebp, 21
  1262. mov edx, PD [esi+C27C25]
  1263. sub eax, ebp
  1264. jge QuantNZC17
  1265. QuantC27:
  1266. sal edx, SIGNHIGH
  1267. mov eax, [esp + QST]
  1268. sbb ebp, ebp
  1269. ;
  1270. add eax, ebp
  1271. xor ebp, edx
  1272. shr ebp, 21
  1273. mov edx, PD [esi+C34C36]
  1274. sub eax, ebp
  1275. jge QuantNZC27
  1276. QuantC36:
  1277. sal edx, SIGNLOW
  1278. mov eax, [esp + QST]
  1279. sbb ebp, ebp
  1280. ;
  1281. add eax, ebp
  1282. xor ebp, edx
  1283. shr ebp, 21
  1284. mov edx, PD [esi+C47C45]
  1285. sub eax, ebp
  1286. jl QuantC45
  1287. lea eax, [eax+2*ebx]
  1288. sub cl, 19
  1289. mul PD [esp + R2P]
  1290. ;
  1291. mov eax, PD [esi+C34C36]
  1292. mov PB [edi+1], dl
  1293. shl eax, 16
  1294. mov PB [edi], cl
  1295. shr eax, 31
  1296. mov cl, 18
  1297. mov edx, PD [esi+C47C45]
  1298. sub eax, 1
  1299. mov PB [edi+2], al
  1300. add edi, 3
  1301. QuantC45:
  1302. sal edx, SIGNLOW
  1303. mov eax, [esp + QST]
  1304. sbb ebp, ebp
  1305. ;
  1306. add eax, ebp
  1307. xor ebp, edx
  1308. shr ebp, 21
  1309. mov edx, PD [esi+C54C56]
  1310. sub eax, ebp
  1311. jl QuantC54
  1312. lea eax, [eax+2*ebx]
  1313. sub cl, 18
  1314. mul PD [esp + R2P]
  1315. ;
  1316. mov eax, PD [esi+C47C45]
  1317. mov PB [edi+1], dl
  1318. shl eax, 16
  1319. mov PB [edi], cl
  1320. shr eax, 31
  1321. mov cl, 17
  1322. mov edx, PD [esi+C54C56]
  1323. sub eax, 1
  1324. mov PB [edi+2], al
  1325. add edi, 3
  1326. QuantC54:
  1327. sal edx, SIGNHIGH
  1328. mov eax, [esp + QST]
  1329. sbb ebp, ebp
  1330. ;
  1331. add eax, ebp
  1332. xor ebp, edx
  1333. shr ebp, 21
  1334. mov edx, PD [esi+C61C63]
  1335. sub eax, ebp
  1336. jge QuantNZC54
  1337. QuantC63:
  1338. sal edx, SIGNLOW
  1339. mov eax, [esp + QST]
  1340. sbb ebp, ebp
  1341. ;
  1342. add eax, ebp
  1343. xor ebp, edx
  1344. shr ebp, 21
  1345. mov edx, PD [esi+C70C72]
  1346. sub eax, ebp
  1347. jl QuantC72
  1348. lea eax, [eax+2*ebx]
  1349. sub cl, 16
  1350. mul PD [esp + R2P]
  1351. ;
  1352. mov eax, PD [esi+C61C63]
  1353. mov PB [edi+1], dl
  1354. shl eax, 16
  1355. mov PB [edi], cl
  1356. shr eax, 31
  1357. mov cl, 15
  1358. mov edx, PD [esi+C70C72]
  1359. sub eax, 1
  1360. mov PB [edi+2], al
  1361. add edi, 3
  1362. QuantC72:
  1363. sal edx, SIGNLOW
  1364. mov eax, [esp + QST]
  1365. sbb ebp, ebp
  1366. ;
  1367. add eax, ebp
  1368. xor ebp, edx
  1369. shr ebp, 21
  1370. mov edx, PD [esi+C71C73]
  1371. sub eax, ebp
  1372. jl QuantC73
  1373. lea eax, [eax+2*ebx]
  1374. sub cl, 15
  1375. mul PD [esp + R2P]
  1376. ;
  1377. mov eax, PD [esi+C70C72]
  1378. mov PB [edi+1], dl
  1379. shl eax, 16
  1380. mov PB [edi], cl
  1381. shr eax, 31
  1382. mov cl, 14
  1383. mov edx, PD [esi+C71C73]
  1384. sub eax, 1
  1385. mov PB [edi+2], al
  1386. add edi, 3
  1387. QuantC73:
  1388. sal edx, SIGNLOW
  1389. mov eax, [esp + QST]
  1390. sbb ebp, ebp
  1391. ;
  1392. add eax, ebp
  1393. xor ebp, edx
  1394. shr ebp, 21
  1395. mov edx, PD [esi+C64C66]
  1396. sub eax, ebp
  1397. jl QuantC64
  1398. lea eax, [eax+2*ebx]
  1399. sub cl, 14
  1400. mul PD [esp + R2P]
  1401. ;
  1402. mov eax, PD [esi+C71C73]
  1403. mov PB [edi+1], dl
  1404. shl eax, 16
  1405. mov PB [edi], cl
  1406. shr eax, 31
  1407. mov cl, 13
  1408. mov edx, PD [esi+C64C66]
  1409. sub eax, 1
  1410. mov PB [edi+2], al
  1411. add edi, 3
  1412. QuantC64:
  1413. sal edx, SIGNHIGH
  1414. mov eax, [esp + QST]
  1415. sbb ebp, ebp
  1416. ;
  1417. add eax, ebp
  1418. xor ebp, edx
  1419. shr ebp, 21
  1420. mov edx, PD [esi+C57C55]
  1421. sub eax, ebp
  1422. jge QuantNZC64
  1423. QuantC55:
  1424. sal edx, SIGNLOW
  1425. mov eax, [esp + QST]
  1426. sbb ebp, ebp
  1427. ;
  1428. add eax, ebp
  1429. xor ebp, edx
  1430. shr ebp, 21
  1431. mov edx, PD [esi+C44C46]
  1432. sub eax, ebp
  1433. jl QuantC46
  1434. lea eax, [eax+2*ebx]
  1435. sub cl, 12
  1436. mul PD [esp + R2P]
  1437. ;
  1438. mov eax, PD [esi+C57C55]
  1439. mov PB [edi+1], dl
  1440. shl eax, 16
  1441. mov PB [edi], cl
  1442. shr eax, 31
  1443. mov cl, 11
  1444. mov edx, PD [esi+C44C46]
  1445. sub eax, 1
  1446. mov PB [edi+2], al
  1447. add edi, 3
  1448. QuantC46:
  1449. sal edx, SIGNLOW
  1450. mov eax, [esp + QST]
  1451. sbb ebp, ebp
  1452. ;
  1453. add eax, ebp
  1454. xor ebp, edx
  1455. shr ebp, 21
  1456. mov edx, PD [esi+C37C35]
  1457. sub eax, ebp
  1458. jl QuantC37
  1459. lea eax, [eax+2*ebx]
  1460. sub cl, 11
  1461. mul PD [esp + R2P]
  1462. ;
  1463. mov eax, PD [esi+C44C46]
  1464. mov PB [edi+1], dl
  1465. shl eax, 16
  1466. mov PB [edi], cl
  1467. shr eax, 31
  1468. mov cl, 10
  1469. mov edx, PD [esi+C37C35]
  1470. sub eax, 1
  1471. mov PB [edi+2], al
  1472. add edi, 3
  1473. QuantC37:
  1474. sal edx, SIGNHIGH
  1475. mov eax, [esp + QST]
  1476. sbb ebp, ebp
  1477. ;
  1478. add eax, ebp
  1479. xor ebp, edx
  1480. shr ebp, 21
  1481. mov edx, PD [esi+C47C45]
  1482. sub eax, ebp
  1483. jge QuantNZC37
  1484. QuantC47:
  1485. sal edx, SIGNHIGH
  1486. mov eax, [esp + QST]
  1487. sbb ebp, ebp
  1488. ;
  1489. add eax, ebp
  1490. xor ebp, edx
  1491. shr ebp, 21
  1492. mov edx, PD [esi+C54C56]
  1493. sub eax, ebp
  1494. jge QuantNZC47
  1495. QuantC56:
  1496. sal edx, SIGNLOW
  1497. mov eax, [esp + QST]
  1498. sbb ebp, ebp
  1499. ;
  1500. add eax, ebp
  1501. xor ebp, edx
  1502. shr ebp, 21
  1503. mov edx, PD [esi+C67C65]
  1504. sub eax, ebp
  1505. jl QuantC65
  1506. lea eax, [eax+2*ebx]
  1507. sub cl, 8
  1508. mul PD [esp + R2P]
  1509. ;
  1510. mov eax, PD [esi+C54C56]
  1511. mov PB [edi+1], dl
  1512. shl eax, 16
  1513. mov PB [edi], cl
  1514. shr eax, 31
  1515. mov cl, 7
  1516. mov edx, PD [esi+C67C65]
  1517. sub eax, 1
  1518. mov PB [edi+2], al
  1519. add edi, 3
  1520. QuantC65:
  1521. sal edx, SIGNLOW
  1522. mov eax, [esp + QST]
  1523. sbb ebp, ebp
  1524. ;
  1525. add eax, ebp
  1526. xor ebp, edx
  1527. shr ebp, 21
  1528. mov edx, PD [esi+C74C76]
  1529. sub eax, ebp
  1530. jl QuantC74
  1531. lea eax, [eax+2*ebx]
  1532. sub cl, 7
  1533. mul PD [esp + R2P]
  1534. ;
  1535. mov eax, PD [esi+C67C65]
  1536. mov PB [edi+1], dl
  1537. shl eax, 16
  1538. mov PB [edi], cl
  1539. shr eax, 31
  1540. mov cl, 6
  1541. mov edx, PD [esi+C74C76]
  1542. sub eax, 1
  1543. mov PB [edi+2], al
  1544. add edi, 3
  1545. QuantC74:
  1546. sal edx, SIGNHIGH
  1547. mov eax, [esp + QST]
  1548. sbb ebp, ebp
  1549. ;
  1550. add eax, ebp
  1551. xor ebp, edx
  1552. shr ebp, 21
  1553. mov edx, PD [esi+C77C75]
  1554. sub eax, ebp
  1555. jge QuantNZC74
  1556. QuantC75:
  1557. sal edx, SIGNLOW
  1558. mov eax, [esp + QST]
  1559. sbb ebp, ebp
  1560. ;
  1561. add eax, ebp
  1562. xor ebp, edx
  1563. shr ebp, 21
  1564. mov edx, PD [esi+C64C66]
  1565. sub eax, ebp
  1566. jl QuantC66
  1567. lea eax, [eax+2*ebx]
  1568. sub cl, 5
  1569. mul PD [esp + R2P]
  1570. ;
  1571. mov eax, PD [esi+C77C75]
  1572. mov PB [edi+1], dl
  1573. shl eax, 16
  1574. mov PB [edi], cl
  1575. shr eax, 31
  1576. mov cl, 4
  1577. mov edx, PD [esi+C64C66]
  1578. sub eax, 1
  1579. mov PB [edi+2], al
  1580. add edi, 3
  1581. QuantC66:
  1582. sal edx, SIGNLOW
  1583. mov eax, [esp + QST]
  1584. sbb ebp, ebp
  1585. ;
  1586. add eax, ebp
  1587. xor ebp, edx
  1588. shr ebp, 21
  1589. mov edx, PD [esi+C57C55]
  1590. sub eax, ebp
  1591. jl QuantC57
  1592. lea eax, [eax+2*ebx]
  1593. sub cl, 4
  1594. mul PD [esp + R2P]
  1595. ;
  1596. mov eax, PD [esi+C64C66]
  1597. mov PB [edi+1], dl
  1598. shl eax, 16
  1599. mov PB [edi], cl
  1600. shr eax, 31
  1601. mov cl, 3
  1602. mov edx, PD [esi+C57C55]
  1603. sub eax, 1
  1604. mov PB [edi+2], al
  1605. add edi, 3
  1606. QuantC57:
  1607. sal edx, SIGNHIGH
  1608. mov eax, [esp + QST]
  1609. sbb ebp, ebp
  1610. ;
  1611. add eax, ebp
  1612. xor ebp, edx
  1613. shr ebp, 21
  1614. mov edx, PD [esi+C67C65]
  1615. sub eax, ebp
  1616. jge QuantNZC57
  1617. QuantC67:
  1618. sal edx, SIGNHIGH
  1619. mov eax, [esp + QST]
  1620. sbb ebp, ebp
  1621. ;
  1622. add eax, ebp
  1623. xor ebp, edx
  1624. shr ebp, 21
  1625. mov edx, PD [esi+C74C76]
  1626. sub eax, ebp
  1627. jge QuantNZC67
  1628. QuantC76:
  1629. sal edx, SIGNLOW
  1630. mov eax, [esp + QST]
  1631. sbb ebp, ebp
  1632. ;
  1633. add eax, ebp
  1634. xor ebp, edx
  1635. shr ebp, 21
  1636. mov edx, PD [esi+C77C75]
  1637. sub eax, ebp
  1638. jl QuantC77
  1639. lea eax, [eax+2*ebx]
  1640. sub cl, 1
  1641. mul PD [esp + R2P]
  1642. ;
  1643. mov eax, PD [esi+C74C76]
  1644. mov PB [edi+1], dl
  1645. shl eax, 16
  1646. mov PB [edi], cl
  1647. shr eax, 31
  1648. mov cl, 0
  1649. mov edx, PD [esi+C77C75]
  1650. sub eax, 1
  1651. mov PB [edi+2], al
  1652. add edi, 3
  1653. QuantC77:
  1654. sal edx, SIGNHIGH
  1655. mov eax, [esp + QST]
  1656. sbb ebp, ebp
  1657. ;
  1658. add eax, ebp
  1659. xor ebp, edx
  1660. shr ebp, 21
  1661. mov edx, edx
  1662. sub eax, ebp
  1663. jge QuantNZC77
  1664. ; Quantization and RLE is done
  1665. QuantDone:
  1666. mov eax, edi ; Return value
  1667. add esp,LocalFrameSize
  1668. pop ebx
  1669. pop ebp
  1670. pop edi
  1671. pop esi
  1672. rturn
  1673. QuantNZC61:
  1674. lea eax, [eax+2*ebx]
  1675. sub cl, 29
  1676. mul PD [esp + R2P]
  1677. ;
  1678. mov eax, PD [esi+C61C63]
  1679. mov PB [edi+1], dl
  1680. shr eax, 31
  1681. mov PB [edi], cl
  1682. sub eax, 1
  1683. mov edx, PD [esi+C70C72]
  1684. mov PB [edi+2], al
  1685. mov cl, 28
  1686. add edi, 3
  1687. jmp QuantC70
  1688. QuantNZC70:
  1689. lea eax, [eax+2*ebx]
  1690. sub cl, 28
  1691. mul PD [esp + R2P]
  1692. ;
  1693. mov eax, PD [esi+C70C72]
  1694. mov PB [edi+1], dl
  1695. shr eax, 31
  1696. mov PB [edi], cl
  1697. sub eax, 1
  1698. mov edx, PD [esi+C71C73]
  1699. mov PB [edi+2], al
  1700. mov cl, 27
  1701. add edi, 3
  1702. jmp QuantC71
  1703. QuantNZC71:
  1704. lea eax, [eax+2*ebx]
  1705. sub cl, 27
  1706. mul PD [esp + R2P]
  1707. ;
  1708. mov eax, PD [esi+C71C73]
  1709. mov PB [edi+1], dl
  1710. shr eax, 31
  1711. mov PB [edi], cl
  1712. sub eax, 1
  1713. mov edx, PD [esi+C60C62]
  1714. mov PB [edi+2], al
  1715. mov cl, 26
  1716. add edi, 3
  1717. jmp QuantC62
  1718. QuantNZC44:
  1719. lea eax, [eax+2*ebx]
  1720. sub cl, 24
  1721. mul PD [esp + R2P]
  1722. ;
  1723. mov eax, PD [esi+C44C46]
  1724. mov PB [edi+1], dl
  1725. shr eax, 31
  1726. mov PB [edi], cl
  1727. sub eax, 1
  1728. mov edx, PD [esi+C37C35]
  1729. mov PB [edi+2], al
  1730. mov cl, 23
  1731. add edi, 3
  1732. jmp QuantC35
  1733. QuantNZC17:
  1734. lea eax, [eax+2*ebx]
  1735. sub cl, 21
  1736. mul PD [esp + R2P]
  1737. ;
  1738. mov eax, PD [esi+C17C15]
  1739. mov PB [edi+1], dl
  1740. shr eax, 31
  1741. mov PB [edi], cl
  1742. sub eax, 1
  1743. mov edx, PD [esi+C27C25]
  1744. mov PB [edi+2], al
  1745. mov cl, 20
  1746. add edi, 3
  1747. jmp QuantC27
  1748. QuantNZC27:
  1749. lea eax, [eax+2*ebx]
  1750. sub cl, 20
  1751. mul PD [esp + R2P]
  1752. ;
  1753. mov eax, PD [esi+C27C25]
  1754. mov PB [edi+1], dl
  1755. shr eax, 31
  1756. mov PB [edi], cl
  1757. sub eax, 1
  1758. mov edx, PD [esi+C34C36]
  1759. mov PB [edi+2], al
  1760. mov cl, 19
  1761. add edi, 3
  1762. jmp QuantC36
  1763. QuantNZC54:
  1764. lea eax, [eax+2*ebx]
  1765. sub cl, 17
  1766. mul PD [esp + R2P]
  1767. ;
  1768. mov eax, PD [esi+C54C56]
  1769. mov PB [edi+1], dl
  1770. shr eax, 31
  1771. mov PB [edi], cl
  1772. sub eax, 1
  1773. mov edx, PD [esi+C61C63]
  1774. mov PB [edi+2], al
  1775. mov cl, 16
  1776. add edi, 3
  1777. jmp QuantC63
  1778. QuantNZC64:
  1779. lea eax, [eax+2*ebx]
  1780. sub cl, 13
  1781. mul PD [esp + R2P]
  1782. ;
  1783. mov eax, PD [esi+C64C66]
  1784. mov PB [edi+1], dl
  1785. shr eax, 31
  1786. mov PB [edi], cl
  1787. sub eax, 1
  1788. mov edx, PD [esi+C57C55]
  1789. mov PB [edi+2], al
  1790. mov cl, 12
  1791. add edi, 3
  1792. jmp QuantC55
  1793. QuantNZC37:
  1794. lea eax, [eax+2*ebx]
  1795. sub cl, 10
  1796. mul PD [esp + R2P]
  1797. ;
  1798. mov eax, PD [esi+C37C35]
  1799. mov PB [edi+1], dl
  1800. shr eax, 31
  1801. mov PB [edi], cl
  1802. sub eax, 1
  1803. mov edx, PD [esi+C47C45]
  1804. mov PB [edi+2], al
  1805. mov cl, 9
  1806. add edi, 3
  1807. jmp QuantC47
  1808. QuantNZC47:
  1809. lea eax, [eax+2*ebx]
  1810. sub cl, 9
  1811. mul PD [esp + R2P]
  1812. ;
  1813. mov eax, PD [esi+C47C45]
  1814. mov PB [edi+1], dl
  1815. shr eax, 31
  1816. mov PB [edi], cl
  1817. sub eax, 1
  1818. mov edx, PD [esi+C54C56]
  1819. mov PB [edi+2], al
  1820. mov cl, 8
  1821. add edi, 3
  1822. jmp QuantC56
  1823. QuantNZC74:
  1824. lea eax, [eax+2*ebx]
  1825. sub cl, 6
  1826. mul PD [esp + R2P]
  1827. ;
  1828. mov eax, PD [esi+C74C76]
  1829. mov PB [edi+1], dl
  1830. shr eax, 31
  1831. mov PB [edi], cl
  1832. sub eax, 1
  1833. mov edx, PD [esi+C77C75]
  1834. mov PB [edi+2], al
  1835. mov cl, 5
  1836. add edi, 3
  1837. jmp QuantC75
  1838. QuantNZC57:
  1839. lea eax, [eax+2*ebx]
  1840. sub cl, 3
  1841. mul PD [esp + R2P]
  1842. ;
  1843. mov eax, PD [esi+C57C55]
  1844. mov PB [edi+1], dl
  1845. shr eax, 31
  1846. mov PB [edi], cl
  1847. sub eax, 1
  1848. mov edx, PD [esi+C67C65]
  1849. mov PB [edi+2], al
  1850. mov cl, 2
  1851. add edi, 3
  1852. jmp QuantC67
  1853. QuantNZC67:
  1854. lea eax, [eax+2*ebx]
  1855. sub cl, 2
  1856. mul PD [esp + R2P]
  1857. ;
  1858. mov eax, PD [esi+C67C65]
  1859. mov PB [edi+1], dl
  1860. shr eax, 31
  1861. mov PB [edi], cl
  1862. sub eax, 1
  1863. mov edx, PD [esi+C74C76]
  1864. mov PB [edi+2], al
  1865. mov cl, 1
  1866. add edi, 3
  1867. jmp QuantC76
  1868. QuantNZC77:
  1869. lea eax, [eax+2*ebx]
  1870. sub cl, 0
  1871. mul PD [esp + R2P]
  1872. ;
  1873. mov eax, PD [esi+C77C75]
  1874. mov PB [edi+1], dl
  1875. shr eax, 31
  1876. mov PB [edi], cl
  1877. sub eax, 1
  1878. mov edx, edx
  1879. mov PB [edi+2], al
  1880. add edi, 3
  1881. jmp QuantDone
  1882. QUANTRLE endp
  1883. END