1
0
Fork 0

Merging upstream version 1.5.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-20 20:18:54 +01:00
parent ca780e91c2
commit 4658e04973
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
15 changed files with 80 additions and 85 deletions

View file

@ -1,6 +1,6 @@
2013-07-28 Antonio Diaz Diaz <antonio@gnu.org>
2013-09-15 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.5-rc1 released.
* Version 1.5 released.
* Removed decompression support for version 0 files.
* The LZ_compress_sync_flush mechanism has been fixed (again).
* Minor fixes.

View file

@ -68,8 +68,7 @@ $(VPATH)/doc/$(pkgname).info : $(VPATH)/doc/$(pkgname).texinfo
man : $(VPATH)/doc/$(progname).1
$(VPATH)/doc/$(progname).1 : $(progname)
help2man -n 'reduces the size of files' \
-o $@ --no-info ./$(progname)
help2man -n 'reduces the size of files' -o $@ --no-info ./$(progname)
Makefile : $(VPATH)/configure $(VPATH)/Makefile.in
./config.status

2
NEWS
View file

@ -5,4 +5,4 @@ Decompression support for deprecated version 0 files has been removed.
A bug has been fixed that would make an instance of "struct LZ_Encoder"
unresponsive if "LZ_compress_sync_flush" is called at the wrong moment.
Minor fixes.
Minor fixes have been made.

View file

@ -222,7 +222,7 @@ char ap_init( struct Arg_parser * const ap,
while( argind < argc )
{
const unsigned char ch1 = argv[argind][0];
const unsigned char ch2 = ( ch1 ? argv[argind][1] : 0 );
const unsigned char ch2 = ch1 ? argv[argind][1] : 0;
if( ch1 == '-' && ch2 ) /* we found an option */
{

2
configure vendored
View file

@ -6,7 +6,7 @@
# to copy, distribute and modify it.
pkgname=lzlib
pkgversion=1.5-rc1
pkgversion=1.5
soversion=1
progname=minilzip
progname_shared=

View file

@ -88,13 +88,7 @@ static int LZd_decode_member( struct LZ_decoder * const decoder )
int len;
if( Rd_decode_bit( rdec, &decoder->bm_rep[*state] ) == 1 ) /* 2nd bit */
{
if( Rd_decode_bit( rdec, &decoder->bm_rep0[*state] ) == 0 ) /* 3rd bit */
{
if( Rd_decode_bit( rdec, &decoder->bm_len[*state][pos_state] ) == 0 ) /* 4th bit */
{ *state = St_set_short_rep( *state );
LZd_put_byte( decoder, LZd_get_byte( decoder, decoder->rep0 ) ); continue; }
}
else
if( Rd_decode_bit( rdec, &decoder->bm_rep0[*state] ) == 1 ) /* 3rd bit */
{
unsigned distance;
if( Rd_decode_bit( rdec, &decoder->bm_rep1[*state] ) == 0 ) /* 4th bit */
@ -110,6 +104,12 @@ static int LZd_decode_member( struct LZ_decoder * const decoder )
decoder->rep1 = decoder->rep0;
decoder->rep0 = distance;
}
else
{
if( Rd_decode_bit( rdec, &decoder->bm_len[*state][pos_state] ) == 0 ) /* 4th bit */
{ *state = St_set_short_rep( *state );
LZd_put_byte( decoder, LZd_get_byte( decoder, decoder->rep0 ) ); continue; }
}
*state = St_set_rep( *state );
len = min_match_len + Rd_decode_len( rdec, &decoder->rep_len_model, pos_state );
}

View file

@ -326,7 +326,7 @@ struct LZ_decoder
Bit_model bm_rep1[states];
Bit_model bm_rep2[states];
Bit_model bm_len[states][pos_states];
Bit_model bm_dis_slot[max_dis_states][1<<dis_slot_bits];
Bit_model bm_dis_slot[dis_states][1<<dis_slot_bits];
Bit_model bm_dis[modeled_distances-end_dis_model];
Bit_model bm_align[dis_align_size];
@ -405,7 +405,7 @@ static inline bool LZd_init( struct LZ_decoder * const decoder,
Bm_array_init( decoder->bm_rep1, states );
Bm_array_init( decoder->bm_rep2, states );
Bm_array_init( decoder->bm_len[0], states * pos_states );
Bm_array_init( decoder->bm_dis_slot[0], max_dis_states * (1 << dis_slot_bits) );
Bm_array_init( decoder->bm_dis_slot[0], dis_states * (1 << dis_slot_bits) );
Bm_array_init( decoder->bm_dis, modeled_distances - end_dis_model );
Bm_array_init( decoder->bm_align, dis_align_size );

View file

@ -12,7 +12,7 @@ File: lzlib.info, Node: Top, Next: Introduction, Up: (dir)
Lzlib Manual
************
This manual is for Lzlib (version 1.5-rc1, 28 July 2013).
This manual is for Lzlib (version 1.5, 15 September 2013).
* Menu:
@ -192,9 +192,9 @@ calling `LZ_compress_errno' before using it.
should be freed with `LZ_compress_close' to avoid memory leaks.
DICTIONARY_SIZE sets the dictionary size to be used, in bytes.
Valid values range from 4KiB to 512MiB. Note that dictionary sizes
are quantized. If the specified size does not match one of the
valid sizes, it will be rounded upwards by adding up to
Valid values range from 4 KiB to 512 MiB. Note that dictionary
sizes are quantized. If the specified size does not match one of
the valid sizes, it will be rounded upwards by adding up to
(DICTIONARY_SIZE / 16) to it.
MATCH_LEN_LIMIT sets the match length limit in bytes. Valid values
@ -536,7 +536,7 @@ with no additional information before, between, or after them.
`ID string'
A four byte string, identifying the lzip format, with the value
"LZIP".
"LZIP" (0x4C, 0x5A, 0x49, 0x50).
`VN (version number, 1 byte)'
Just in case something needs to be modified in the future. 1 for
@ -551,7 +551,7 @@ with no additional information before, between, or after them.
Bits 4-0 contain the base 2 logarithm of the base size (12 to 29).
Bits 7-5 contain the number of wedges (0 to 7) to substract from
the base size to obtain the dictionary size.
Example: 0xD3 = (2^19 - 6 * 2^15) = (512KiB - 6 * 32KiB) = 320KiB
Example: 0xD3 = 2^19 - 6 * 2^15 = 512 KiB - 6 * 32 KiB = 320 KiB
Valid values for dictionary size range from 4 KiB to 512 MiB.
`Lzma stream'
@ -697,7 +697,7 @@ next member in case of data error.

File: lzlib.info, Node: Problems, Next: Concept index, Prev: Examples, Up: Top
11 Reporting Bugs
11 Reporting bugs
*****************
There are probably bugs in Lzlib. There are certainly errors and
@ -737,18 +737,18 @@ Concept index

Tag Table:
Node: Top217
Node: Introduction1322
Node: Library version3903
Node: Buffering4548
Node: Parameter limits5667
Node: Compression functions6624
Node: Decompression functions12834
Node: Error codes18995
Node: Error messages20934
Node: Data format21513
Node: Examples24136
Node: Problems28219
Node: Concept index28791
Node: Introduction1323
Node: Library version3904
Node: Buffering4549
Node: Parameter limits5672
Node: Compression functions6631
Node: Decompression functions12844
Node: Error codes19005
Node: Error messages20944
Node: Data format21523
Node: Examples24172
Node: Problems28255
Node: Concept index28827

End Tag Table

View file

@ -6,8 +6,8 @@
@finalout
@c %**end of header
@set UPDATED 28 July 2013
@set VERSION 1.5-rc1
@set UPDATED 15 September 2013
@set VERSION 1.5
@dircategory Data Compression
@direntry
@ -607,7 +607,8 @@ All multibyte values are stored in little endian order.
@table @samp
@item ID string
A four byte string, identifying the lzip format, with the value "LZIP".
A four byte string, identifying the lzip format, with the value "LZIP"
(0x4C, 0x5A, 0x49, 0x50).
@item VN (version number, 1 byte)
Just in case something needs to be modified in the future. 1 for now.
@ -620,7 +621,7 @@ wedges between 0 and 7. The size of a wedge is (base_size / 16).@*
Bits 4-0 contain the base 2 logarithm of the base size (12 to 29).@*
Bits 7-5 contain the number of wedges (0 to 7) to substract from the
base size to obtain the dictionary size.@*
Example: 0xD3 = (2^19 - 6 * 2^15) = (512KiB - 6 * 32KiB) = 320KiB@*
Example: 0xD3 = 2^19 - 6 * 2^15 = 512 KiB - 6 * 32 KiB = 320 KiB@*
Valid values for dictionary size range from 4 KiB to 512 MiB.
@item Lzma stream
@ -672,7 +673,6 @@ Example 1: Normal compression (@var{member_size} > total output).
8) LZ_compress_close
@end example
@sp 1
@noindent
Example 2: Normal compression using LZ_compress_write_size.
@ -687,7 +687,6 @@ Example 2: Normal compression using LZ_compress_write_size.
7) LZ_compress_close
@end example
@sp 1
@noindent
Example 3: Decompression.
@ -703,7 +702,6 @@ Example 3: Decompression.
8) LZ_decompress_close
@end example
@sp 1
@noindent
Example 4: Decompression using LZ_decompress_write_size.
@ -720,7 +718,6 @@ Example 4: Decompression using LZ_decompress_write_size.
7) LZ_decompress_close
@end example
@sp 1
@noindent
Example 5: Multi-member compression (@var{member_size} < total output).
@ -738,7 +735,6 @@ Example 5: Multi-member compression (@var{member_size} < total output).
10) LZ_compress_close
@end example
@sp 1
@noindent
Example 6: Multi-member compression (user-restarted members).
@ -758,7 +754,6 @@ Example 6: Multi-member compression (user-restarted members).
12) LZ_compress_close
@end example
@sp 1
@noindent
Example 7: Decompression with automatic removal of leading garbage.
@ -774,7 +769,6 @@ Example 7: Decompression with automatic removal of leading garbage.
8) LZ_decompress_close
@end example
@sp 1
@noindent
Example 8: Streamed decompression with automatic resynchronization to
@ -793,7 +787,7 @@ next member in case of data error.
@node Problems
@chapter Reporting Bugs
@chapter Reporting bugs
@cindex bugs
@cindex getting help

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
.TH MINILZIP "1" "July 2013" "Minilzip 1.5-rc1" "User Commands"
.TH MINILZIP "1" "September 2013" "Minilzip 1.5" "User Commands"
.SH NAME
Minilzip \- reduces the size of files
.SH SYNOPSIS
@ -70,7 +70,8 @@ Ki = KiB = 2^10 = 1024, M = 10^6, Mi = 2^20, G = 10^9, Gi = 2^30, etc...
The bidimensional parameter space of LZMA can't be mapped to a linear
scale optimal for all files. If your files are large, very repetitive,
etc, you may need to use the \fB\-\-match\-length\fR and \fB\-\-dictionary\-size\fR
options directly to achieve optimal performance.
options directly to achieve optimal performance. For example, \fB\-9m64\fR
usually compresses executables more (and faster) than \fB\-9\fR.
.PP
Exit status: 0 for a normal exit, 1 for environmental problems (file
not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or
@ -82,7 +83,7 @@ Report bugs to lzip\-bug@nongnu.org
Lzlib home page: http://www.nongnu.org/lzip/lzlib.html
.SH COPYRIGHT
Copyright \(co 2013 Antonio Diaz Diaz.
Using Lzlib 1.5\-rc1
Using Lzlib 1.5
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br
This is free software: you are free to change and redistribute it.

View file

@ -320,11 +320,11 @@ static void LZe_fill_distance_prices( struct LZ_encoder * const encoder )
const int price =
price_symbol_reversed( encoder->bm_dis + base - dis_slot - 1,
dis - base, direct_bits );
for( dis_state = 0; dis_state < max_dis_states; ++dis_state )
for( dis_state = 0; dis_state < dis_states; ++dis_state )
encoder->dis_prices[dis_state][dis] = price;
}
for( dis_state = 0; dis_state < max_dis_states; ++dis_state )
for( dis_state = 0; dis_state < dis_states; ++dis_state )
{
int * const dsp = encoder->dis_slot_prices[dis_state];
int * const dp = encoder->dis_prices[dis_state];
@ -361,7 +361,7 @@ static bool LZe_init( struct LZ_encoder * const encoder,
Bm_array_init( encoder->bm_rep1, states );
Bm_array_init( encoder->bm_rep2, states );
Bm_array_init( encoder->bm_len[0], states * pos_states );
Bm_array_init( encoder->bm_dis_slot[0], max_dis_states * (1 << dis_slot_bits) );
Bm_array_init( encoder->bm_dis_slot[0], dis_states * (1 << dis_slot_bits) );
Bm_array_init( encoder->bm_dis, modeled_distances - end_dis_model );
Bm_array_init( encoder->bm_align, dis_align_size );

View file

@ -591,7 +591,7 @@ struct LZ_encoder
Bit_model bm_rep1[states];
Bit_model bm_rep2[states];
Bit_model bm_len[states][pos_states];
Bit_model bm_dis_slot[max_dis_states][1<<dis_slot_bits];
Bit_model bm_dis_slot[dis_states][1<<dis_slot_bits];
Bit_model bm_dis[modeled_distances-end_dis_model];
Bit_model bm_align[dis_align_size];
@ -605,8 +605,8 @@ struct LZ_encoder
struct Pair pairs[max_match_len+1];
struct Trial trials[max_num_trials];
int dis_slot_prices[max_dis_states][2*max_dictionary_bits];
int dis_prices[max_dis_states][modeled_distances];
int dis_slot_prices[dis_states][2*max_dictionary_bits];
int dis_prices[dis_states][modeled_distances];
int align_prices[dis_align_size];
int align_price_count;
int fill_counter;

4
lzip.h
View file

@ -83,10 +83,10 @@ enum {
max_match_len = min_match_len + max_len_symbols - 1, /* 273 */
min_match_len_limit = 5,
max_dis_states = 4 };
dis_states = 4 };
static inline int get_dis_state( const int len )
{ return min( len - min_match_len, max_dis_states - 1 ); }
{ return min( len - min_match_len, dis_states - 1 ); }
static inline int get_lit_state( const uint8_t prev_byte )
{ return ( prev_byte >> ( 8 - literal_context_bits ) ); }

View file

@ -29,7 +29,7 @@
extern "C" {
#endif
static const char * const LZ_version_string = "1.5-rc1";
static const char * const LZ_version_string = "1.5";
enum LZ_Errno { LZ_ok = 0, LZ_bad_argument, LZ_mem_error,
LZ_sequence_error, LZ_header_error, LZ_unexpected_eof,

7
main.c
View file

@ -93,8 +93,6 @@ struct Lzma_options
};
enum Mode { m_compress, m_decompress, m_test };
const unsigned long long max_member_size = 0x1000000000000000ULL;
const unsigned long long max_volume_size = 0x7FFFFFFFFFFFFFFFULL;
char * output_filename = 0;
int outfd = -1;
@ -175,7 +173,8 @@ static void show_help( void )
"The bidimensional parameter space of LZMA can't be mapped to a linear\n"
"scale optimal for all files. If your files are large, very repetitive,\n"
"etc, you may need to use the --match-length and --dictionary-size\n"
"options directly to achieve optimal performance.\n"
"options directly to achieve optimal performance. For example, -9m64\n"
"usually compresses executables more (and faster) than -9.\n"
"\nExit status: 0 for a normal exit, 1 for environmental problems (file\n"
"not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or\n"
"invalid input file, 3 for an internal consistency error (eg, bug) which\n"
@ -839,6 +838,8 @@ int main( const int argc, const char * const argv[] )
{ 3 << 23, 132 }, /* -8 */
{ 1 << 25, 273 } }; /* -9 */
struct Lzma_options encoder_options = option_mapping[6]; /* default = "-6" */
const unsigned long long max_member_size = 0x0100000000000000ULL;
const unsigned long long max_volume_size = 0x4000000000000000ULL;
unsigned long long member_size = max_member_size;
unsigned long long volume_size = 0;
const char * input_filename = "";