diff options
Diffstat (limited to 'trees.c')
-rw-r--r-- | trees.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1042,8 +1042,9 @@ int _tr_tally (s, dist, lc) | |||
1042 | s->dyn_dtree[d_code(dist)].Freq++; | 1042 | s->dyn_dtree[d_code(dist)].Freq++; |
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | #ifdef TRUNCATE_BLOCK | ||
1045 | /* Try to guess if it is profitable to stop the current block here */ | 1046 | /* Try to guess if it is profitable to stop the current block here */ |
1046 | if (s->level > 2 && (s->last_lit & 0xfff) == 0) { | 1047 | if ((s->last_lit & 0x1fff) == 0 && s->level > 2) { |
1047 | /* Compute an upper bound for the compressed length */ | 1048 | /* Compute an upper bound for the compressed length */ |
1048 | ulg out_length = (ulg)s->last_lit*8L; | 1049 | ulg out_length = (ulg)s->last_lit*8L; |
1049 | ulg in_length = (ulg)((long)s->strstart - s->block_start); | 1050 | ulg in_length = (ulg)((long)s->strstart - s->block_start); |
@@ -1058,6 +1059,7 @@ int _tr_tally (s, dist, lc) | |||
1058 | 100L - out_length*100L/in_length)); | 1059 | 100L - out_length*100L/in_length)); |
1059 | if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; | 1060 | if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; |
1060 | } | 1061 | } |
1062 | #endif | ||
1061 | return (s->last_lit == s->lit_bufsize-1); | 1063 | return (s->last_lit == s->lit_bufsize-1); |
1062 | /* We avoid equality with lit_bufsize because of wraparound at 64K | 1064 | /* We avoid equality with lit_bufsize because of wraparound at 64K |
1063 | * on 16 bit machines and because stored blocks are restricted to | 1065 | * on 16 bit machines and because stored blocks are restricted to |