Subversion Repositories Kolibri OS

Rev

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

Rev 6639 Rev 6652
Line 932... Line 932...
932
	cmp edi,Z_NULL
932
	cmp edi,Z_NULL
933
	je @f
933
	je @f
934
	cmp dword[flush],Z_BLOCK
934
	cmp dword[flush],Z_BLOCK
935
	jg @f
935
	jg @f
936
	cmp dword[flush],0
936
	cmp dword[flush],0
937
	jl @f ;if (..==0 || ..==0 || ..>.. || ..<0)
937
	jge .end10 ;if (..==0 || ..==0 || ..>.. || ..<0)
938
		jmp .end10
-
 
939
	@@:
938
	@@:
940
		mov eax,Z_STREAM_ERROR
939
		mov eax,Z_STREAM_ERROR
941
		jmp .end_f
940
		jmp .end_f
942
	.end10:
941
	.end10:
943
	cmp dword[ebx+z_stream.next_out],Z_NULL
942
	cmp dword[ebx+z_stream.next_out],Z_NULL
Line 949... Line 948...
949
	@@:
948
	@@:
950
	cmp dword[edi+deflate_state.status],FINISH_STATE
949
	cmp dword[edi+deflate_state.status],FINISH_STATE
951
	jne .end0
950
	jne .end0
952
	cmp dword[flush],Z_FINISH
951
	cmp dword[flush],Z_FINISH
953
	je .end0
952
	je .end0
954
	.beg0: ;if (..==0 || (..==0 && ..!=0) || (..=.. && ..!=..))
953
	.beg0: ;if (..==0 || (..==0 && ..!=0) || (..==.. && ..!=..))
955
		ERR_RETURN ebx, Z_STREAM_ERROR
954
		ERR_RETURN ebx, Z_STREAM_ERROR
956
		jmp .end_f
955
		jmp .end_f
957
	.end0:
956
	.end0:
958
	cmp word[ebx+z_stream.avail_out],0
957
	cmp word[ebx+z_stream.avail_out],0
959
	jne @f ;if (..==0)
958
	jne @f ;if (..==0)
Line 1066... Line 1065...
1066
			shl edx,8 ;edx = header
1065
			shl edx,8 ;edx = header
1067
			;esi = level_flags
1066
			;esi = level_flags
Line 1068... Line 1067...
1068
 
1067
 
1069
			mov esi,3
1068
			mov esi,3
1070
			cmp word[edi+deflate_state.strategy],Z_HUFFMAN_ONLY
1069
			cmp word[edi+deflate_state.strategy],Z_HUFFMAN_ONLY
1071
			jl @f
1070
			jge @f
1072
			cmp word[edi+deflate_state.level],2
1071
			cmp word[edi+deflate_state.level],2
-
 
1072
			jge .end30 ;if (..>=.. || ..<..)
1073
			jge @f ;if (..>=.. || ..<..)
1073
			@@:
1074
				xor esi,esi
1074
				xor esi,esi
1075
				jmp .end4
1075
				jmp .end4
1076
			@@:
1076
			.end30:
1077
			cmp word[edi+deflate_state.level],6
1077
			cmp word[edi+deflate_state.level],6
1078
			jge @f ;else if (..<..)
1078
			jge @f ;else if (..<..)
1079
				mov esi,1
1079
				mov esi,1
1080
				jmp .end4
1080
				jmp .end4
Line 1389... Line 1389...
1389
		mov edx,eax
1389
		mov edx,eax
Line 1390... Line 1390...
1390
 
1390
 
1391
		cmp edx,finish_started
1391
		cmp edx,finish_started
1392
		je @f
1392
		je @f
1393
		cmp edx,finish_done
-
 
1394
		je @f
1393
		cmp edx,finish_done
1395
			jmp .end18
1394
		jne .end18
1396
		@@: ;if (..==.. || ..==..)
1395
		@@: ;if (..==.. || ..==..)
1397
			mov dword[edi+deflate_state.status],FINISH_STATE
1396
			mov dword[edi+deflate_state.status],FINISH_STATE
1398
		.end18:
1397
		.end18:
1399
		cmp edx,need_more
1398
		cmp edx,need_more
1400
		je @f
1399
		je @f
1401
		cmp edx,finish_started
-
 
1402
		je @f
1400
		cmp edx,finish_started
1403
			jmp .end19
1401
		jne .end19
1404
		@@: ;if (..==.. || ..==..)
1402
		@@: ;if (..==.. || ..==..)
1405
			cmp word[ebx+z_stream.avail_out],0
1403
			cmp word[ebx+z_stream.avail_out],0
1406
			jne @f ;if (..==0)
1404
			jne @f ;if (..==0)
1407
				mov dword[edi+deflate_state.last_flush],-1 ;avoid BUF_ERROR next call, see above
1405
				mov dword[edi+deflate_state.last_flush],-1 ;avoid BUF_ERROR next call, see above
Line 2745... Line 2743...
2745
;    int flush
2743
;    int flush
2746
align 4
2744
align 4
2747
proc deflate_rle uses ecx edx edi esi, s:dword, flush:dword
2745
proc deflate_rle uses ecx edx edi esi, s:dword, flush:dword
2748
locals
2746
locals
2749
	bflush dd ? ;int ;set if current block must be flushed
2747
	bflush dd ? ;int ;set if current block must be flushed
2750
;    uInt prev;              /* byte at distance one to match */
-
 
2751
;    Bytef *scan, *strend;   /* scan goes up to strend for length of run */	
-
 
2752
endl
2748
endl
2753
	mov edx,[s]
2749
	mov edx,[s]
2754
zlib_debug 'deflate_rle'
2750
	zlib_debug 'deflate_rle'
-
 
2751
align 4
2755
	.cycle0: ;for (;;)
2752
	.cycle0: ;for (;;)
2756
		; Make sure that we always have enough lookahead, except
2753
		; Make sure that we always have enough lookahead, except
2757
		; at the end of the input file. We need MAX_MATCH bytes
2754
		; at the end of the input file. We need MAX_MATCH bytes
2758
		; for the longest run, plus one for the unrolled loop.
2755
		; for the longest run, plus one for the unrolled loop.
2759
		cmp dword[edx+deflate_state.lookahead],MAX_MATCH
2756
		cmp dword[edx+deflate_state.lookahead],MAX_MATCH
Line 2787... Line 2784...
2787
			jnz .end2
2784
			jnz .end2
2788
			scasb
2785
			scasb
2789
			jnz .end2
2786
			jnz .end2
2790
			scasb
2787
			scasb
2791
			jnz .end2 ;if (..==.. && ..==.. && ..==..)
2788
			jnz .end2 ;if (..==.. && ..==.. && ..==..)
2792
				;edi = scan
2789
				;edi = scan ;scan goes up to strend for length of run
2793
				; al = prev
2790
				; al = prev ;byte at distance one to match
2794
				;ecx = strend-scan
2791
				;ecx = strend-scan
2795
				mov ecx,MAX_MATCH-2
2792
				mov ecx,MAX_MATCH-2
2796
				repz scasb
2793
				repz scasb
2797
				sub edi,[edx+deflate_state.window]
2794
				sub edi,[edx+deflate_state.window]
2798
				sub edi,[edx+deflate_state.strstart]
2795
				sub edi,[edx+deflate_state.strstart]
Line 2871... Line 2868...
2871
locals
2868
locals
2872
	bflush dd ? ;int ;set if current block must be flushed
2869
	bflush dd ? ;int ;set if current block must be flushed
2873
endl
2870
endl
2874
	mov edi,[s]
2871
	mov edi,[s]
2875
zlib_debug 'deflate_huff'
2872
	zlib_debug 'deflate_huff'
-
 
2873
align 4
2876
	.cycle0: ;for (;;)
2874
	.cycle0: ;for (;;)
2877
		; Make sure that we have a literal to write.
2875
		; Make sure that we have a literal to write.
2878
		cmp dword[edi+deflate_state.lookahead],0
2876
		cmp dword[edi+deflate_state.lookahead],0
2879
		jne .end0 ;if (..==0)
2877
		jne .end0 ;if (..==0)
2880
			stdcall fill_window, edi
2878
			stdcall fill_window, edi
2881
			cmp dword[edi+deflate_state.lookahead],0
2879
			cmp dword[edi+deflate_state.lookahead],0
2882
			jne .end0 ;if (..==0)
2880
			jne .end0 ;if (..==0)
2883
				cmp dword[flush],Z_NO_FLUSH
2881
				cmp dword[flush],Z_NO_FLUSH
2884
				jne @f ;if (..==..)
2882
				jne .cycle0end ;if (..==..)
2885
					mov eax,need_more
2883
					mov eax,need_more
2886
					jmp .end_f
2884
					jmp .end_f
2887
align 4
-
 
2888
				@@:
-
 
2889
			jmp .cycle0end ;flush the current block
2885
				;flush the current block
2890
align 4
2886
align 4
2891
		.end0:
2887
		.end0:
Line 2892... Line 2888...
2892
 
2888
 
2893
		; Output a literal byte
2889
		; Output a literal byte