Subversion Repositories Kolibri OS

Rev

Rev 6870 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6870 Rev 6888
Line 1286... Line 1286...
1286
; ===========================================================================
1286
; ===========================================================================
1287
; Construct the Huffman tree for the bit lengths and return the index in
1287
; Construct the Huffman tree for the bit lengths and return the index in
1288
; bl_order of the last bit length code to send.
1288
; bl_order of the last bit length code to send.
Line 1289... Line 1289...
1289
 
1289
 
1290
;int (deflate_state* s)
1290
;int (deflate_state* s)
1291
align 4
1291
align 16
1292
proc build_bl_tree uses edi, s:dword
1292
proc build_bl_tree uses ecx edi, s:dword
1293
locals
1293
locals
1294
	max_blindex dd ? ;int ;index of last bit length code of non zero freq
1294
	max_blindex dd ? ;int ;index of last bit length code of non zero freq
1295
endl
1295
endl
1296
	mov edi,[s]
1296
	mov edi,[s]
Line 1310... Line 1310...
1310
	; Determine the number of bit length codes to send. The pkzip format
1310
	; Determine the number of bit length codes to send. The pkzip format
1311
	; requires that at least 4 bit length codes be sent. (appnote.txt says
1311
	; requires that at least 4 bit length codes be sent. (appnote.txt says
1312
	; 3 but the actual value used is 4.)
1312
	; 3 but the actual value used is 4.)
Line 1313... Line 1313...
1313
 
1313
 
-
 
1314
	mov dword[max_blindex],BL_CODES-1
-
 
1315
	jmp @f
1314
	mov dword[max_blindex],BL_CODES-1
1316
align 4
-
 
1317
	.cycle0: ;for (..;..>=..;..)
-
 
1318
		dec dword[max_blindex]
1315
	.cycle0: ;for (..;..>=..;..)
1319
		@@:
1316
		cmp dword[max_blindex],3
1320
		cmp dword[max_blindex],3
1317
		jl .cycle0end
-
 
1318
		dec dword[max_blindex]
1321
		jl .cycle0end
1319
		mov eax,[max_blindex]
-
 
1320
		add eax,bl_order
1322
		mov ecx,[max_blindex]
1321
		movzx eax,byte[eax]
-
 
1322
		imul eax,sizeof.ct_data
-
 
1323
		add eax,edi
1323
		movzx eax,byte[ecx+bl_order]
1324
		cmp word[eax+deflate_state.bl_tree+Len],0
1324
		movzx ecx,word[edi+sizeof.ct_data*eax+deflate_state.bl_tree+Len]
1325
		jne .cycle0end ;if (..!=0) break
1325
		jecxz .cycle0
1326
		jmp .cycle0
1326
		jmp .cycle0end
1327
align 4
1327
align 4
1328
	.cycle0end:
1328
	.cycle0end:
1329
	; Update opt_len to include the bit length tree and counts
1329
	; Update opt_len to include the bit length tree and counts
1330
	mov eax,[max_blindex]
1330
	mov eax,[max_blindex]