diff options
author | obrien <obrien@FreeBSD.org> | 2005-05-16 18:31:55 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2005-05-16 18:31:55 +0000 |
commit | 344ba35988e53bba3654f363d1bdcc39430247df (patch) | |
tree | 1ab456aa9146f4b57bf41375952059b5cceae392 /contrib/bzip2/compress.c | |
parent | b718740c2fa9f3e14e09fba90eca26f829b7d43a (diff) | |
download | FreeBSD-src-344ba35988e53bba3654f363d1bdcc39430247df.zip FreeBSD-src-344ba35988e53bba3654f363d1bdcc39430247df.tar.gz |
Virgin import (trimmed) of Bzip2 version 1.0.3.
Diffstat (limited to 'contrib/bzip2/compress.c')
-rw-r--r-- | contrib/bzip2/compress.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/contrib/bzip2/compress.c b/contrib/bzip2/compress.c index 56501c1..7e0c291 100644 --- a/contrib/bzip2/compress.c +++ b/contrib/bzip2/compress.c @@ -8,7 +8,7 @@ This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. - Copyright (C) 1996-2002 Julian R Seward. All rights reserved. + Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -42,7 +42,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. - jseward@acm.org + jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: @@ -488,9 +488,11 @@ void sendMTFValues ( EState* s ) /*-- Recompute the tables based on the accumulated frequencies. --*/ + /* maxLen was changed from 20 to 17 in bzip2-1.0.3. See + comment in huffman.c for details. */ for (t = 0; t < nGroups; t++) BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]), - alphaSize, 20 ); + alphaSize, 17 /*20*/ ); } @@ -527,7 +529,7 @@ void sendMTFValues ( EState* s ) if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; if (s->len[t][i] < minLen) minLen = s->len[t][i]; } - AssertH ( !(maxLen > 20), 3004 ); + AssertH ( !(maxLen > 17 /*20*/ ), 3004 ); AssertH ( !(minLen < 1), 3005 ); BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), minLen, maxLen, alphaSize ); @@ -651,8 +653,8 @@ void BZ2_compressBlock ( EState* s, Bool is_last_block ) if (s->blockNo > 1) s->numZ = 0; if (s->verbosity >= 2) - VPrintf4( " block %d: crc = 0x%8x, " - "combined CRC = 0x%8x, size = %d\n", + VPrintf4( " block %d: crc = 0x%08x, " + "combined CRC = 0x%08x, size = %d\n", s->blockNo, s->blockCRC, s->combinedCRC, s->nblock ); BZ2_blockSort ( s ); @@ -703,7 +705,7 @@ void BZ2_compressBlock ( EState* s, Bool is_last_block ) bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 ); bsPutUInt32 ( s, s->combinedCRC ); if (s->verbosity >= 2) - VPrintf1( " final combined CRC = 0x%x\n ", s->combinedCRC ); + VPrintf1( " final combined CRC = 0x%08x\n ", s->combinedCRC ); bsFinishWrite ( s ); } } |