Rev 6797 | Rev 6847 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6797 | Rev 6799 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | BUSY_STATE equ 113 |
44 | BUSY_STATE equ 113 |
45 | FINISH_STATE equ 800 |
45 | FINISH_STATE equ 800 |
46 | ; Stream status |
46 | ; Stream status |
Line 47... | Line 47... | ||
47 | 47 | ||
48 | ; Data structure describing a single value and its code string. |
48 | ; Data structure describing a single value and its code string. |
49 | struct ct_data ;ct_data_s |
49 | struct ct_data |
50 | fc dw ? ;union |
50 | fc dw ? ;union |
51 | ;uint_16 freq ;frequency count |
51 | ;uint_16 freq ;frequency count |
52 | ;uint_16 code ;bit string |
52 | ;uint_16 code ;bit string |
53 | dale dw ? ;union |
53 | dale dw ? ;union |
Line 58... | Line 58... | ||
58 | Freq equ ct_data.fc ;.freq |
58 | Freq equ ct_data.fc ;.freq |
59 | Code equ ct_data.fc ;.code |
59 | Code equ ct_data.fc ;.code |
60 | Dad equ ct_data.dale ;.dad |
60 | Dad equ ct_data.dale ;.dad |
61 | Len equ ct_data.dale ;.len |
61 | Len equ ct_data.dale ;.len |
Line 62... | Line 62... | ||
62 | 62 | ||
63 | struct tree_desc ;tree_desc_s |
63 | struct tree_desc |
64 | dyn_tree dd ? ;ct_data * ;the dynamic tree |
64 | dyn_tree dd ? ;ct_data * ;the dynamic tree |
65 | max_code dd ? ;int ;largest code with non zero frequency |
65 | max_code dd ? ;int ;largest code with non zero frequency |
66 | stat_desc dd ? ;static_tree_desc * ;the corresponding static tree |
66 | stat_desc dd ? ;static_tree_desc * ;the corresponding static tree |
Line 78... | Line 78... | ||
78 | pending dd ? ;uInt ;nb of bytes in the pending buffer |
78 | pending dd ? ;uInt ;nb of bytes in the pending buffer |
79 | wrap dd ? ;int ;bit 0 true for zlib, bit 1 true for gzip |
79 | wrap dd ? ;int ;bit 0 true for zlib, bit 1 true for gzip |
80 | gzhead dd ? ;gz_headerp ;gzip header information to write |
80 | gzhead dd ? ;gz_headerp ;gzip header information to write |
81 | gzindex dd ? ;uInt ;where in extra, name, or comment |
81 | gzindex dd ? ;uInt ;where in extra, name, or comment |
82 | method db ? ;Byte ;can only be DEFLATED |
82 | method db ? ;Byte ;can only be DEFLATED |
- | 83 | rb 3 ;for align |
|
83 | last_flush dd ? ;int ;value of flush param for previous deflate call |
84 | last_flush dd ? ;int ;value of flush param for previous deflate call |
Line 84... | Line 85... | ||
84 | 85 | ||
Line 85... | Line 86... | ||
85 | ; used by deflate.asm: |
86 | ; used by deflate.asm: |
Line 169... | Line 170... | ||
169 | heap_len dd ? ;int ;number of elements in the heap |
170 | heap_len dd ? ;int ;number of elements in the heap |
170 | heap_max dd ? ;int ;element of largest frequency |
171 | heap_max dd ? ;int ;element of largest frequency |
171 | ; The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. |
172 | ; The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. |
172 | ; The same heap array is used to build all trees. |
173 | ; The same heap array is used to build all trees. |
Line 173... | Line 174... | ||
173 | 174 | ||
174 | depth rb 2*L_CODES+1 ;uch[] |
175 | depth rb ((2*L_CODES+1)+3) and (not 3) ;uch[] |
Line 175... | Line 176... | ||
175 | ; Depth of each subtree used as tie breaker for trees of equal frequency |
176 | ; Depth of each subtree used as tie breaker for trees of equal frequency |
Line 176... | Line 177... | ||
176 | 177 | ||
Line 235... | Line 236... | ||
235 | ; Output a byte on the stream. |
236 | ; Output a byte on the stream. |
236 | ; IN assertion: there is enough room in pending_buf. |
237 | ; IN assertion: there is enough room in pending_buf. |
Line 237... | Line 238... | ||
237 | 238 | ||
238 | macro put_byte s, c |
239 | macro put_byte s, c |
239 | { |
- | |
240 | ;xor eax,eax |
- | |
241 | ;mov al,c |
- | |
242 | ;zlib_debug '(%d)',eax |
240 | { |
243 | movzx eax,word[s+deflate_state.pending] |
241 | movzx eax,word[s+deflate_state.pending] |
244 | add eax,[s+deflate_state.pending_buf] |
242 | add eax,[s+deflate_state.pending_buf] |
245 | mov byte[eax],c |
243 | mov byte[eax],c |
246 | inc word[s+deflate_state.pending] |
244 | inc word[s+deflate_state.pending] |