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-17 20:29:57 +01:00
parent 267b8fafe7
commit b66d254488
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
12 changed files with 47 additions and 59 deletions

View file

@ -1,18 +1,8 @@
2013-08-01 Antonio Diaz Diaz <antonio@gnu.org>
2013-09-17 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.5-rc1 released.
* main.c (show_header): Do not show header version.
* Minor fixes.
2013-07-17 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.5-pre2 released.
* Version 1.5 released.
* Show progress of compression at verbosity level 2 (-vv).
2013-05-13 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.5-pre1 released.
* main.c (show_header): Show header version if verbosity >= 4.
* main.c (show_header): Do not show header version.
* Ignore option '-n, --threads' for compatibility with plzip.
* configure: Options now accept a separate argument.

View file

@ -44,8 +44,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 $@ ./$(progname)
help2man -n 'reduces the size of files' -o $@ ./$(progname)
Makefile : $(VPATH)/configure $(VPATH)/Makefile.in
./config.status

View file

@ -45,7 +45,7 @@ static char push_back_record( struct Arg_parser * const ap,
const int code, const char * const argument )
{
const int len = strlen( argument );
struct ap_Record *p;
struct ap_Record * p;
void * tmp = ap_resize_buffer( ap->data,
( ap->data_size + 1 ) * sizeof (struct ap_Record) );
if( !tmp ) return 0;
@ -222,12 +222,12 @@ 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 */
{
const char * const opt = argv[argind];
const char * const arg = (argind + 1 < argc) ? argv[argind+1] : 0;
const char * const arg = ( argind + 1 < argc ) ? argv[argind+1] : 0;
if( ch2 == '-' )
{
if( !argv[argind][2] ) { ++argind; break; } /* we found "--" */

2
configure vendored
View file

@ -6,7 +6,7 @@
# to copy, distribute and modify it.
pkgname=clzip
pkgversion=1.5-rc1
pkgversion=1.5
progname=clzip
srctrigger=doc/${pkgname}.texinfo

View file

@ -104,9 +104,9 @@ bool Rd_read_block( struct Range_decoder * const rdec )
void LZd_flush_data( struct LZ_decoder * const decoder )
{
const int size = decoder->pos - decoder->stream_pos;
if( size > 0 )
if( decoder->pos > decoder->stream_pos )
{
const int size = decoder->pos - decoder->stream_pos;
CRC32_update_buf( &decoder->crc, decoder->buffer + decoder->stream_pos, size );
if( decoder->outfd >= 0 &&
writeblock( decoder->outfd, decoder->buffer + decoder->stream_pos, size ) != size )
@ -223,9 +223,9 @@ int LZd_decode_member( struct LZ_decoder * const decoder,
else
{
int len;
if( Rd_decode_bit( rdec, &decoder->bm_rep[state] ) == 1 ) /* 2nd bit */
if( Rd_decode_bit( rdec, &decoder->bm_rep[state] ) != 0 ) /* 2nd bit */
{
if( Rd_decode_bit( rdec, &decoder->bm_rep0[state] ) == 1 ) /* 3rd bit */
if( Rd_decode_bit( rdec, &decoder->bm_rep0[state] ) != 0 ) /* 3rd bit */
{
unsigned distance;
if( Rd_decode_bit( rdec, &decoder->bm_rep1[state] ) == 0 ) /* 4th bit */
@ -255,7 +255,7 @@ int LZd_decode_member( struct LZ_decoder * const decoder,
int dis_slot;
const unsigned rep0_saved = rep0;
len = min_match_len + Rd_decode_len( rdec, &decoder->match_len_model, pos_state );
dis_slot = Rd_decode_tree6( rdec, decoder->bm_dis_slot[get_dis_state(len)] );
dis_slot = Rd_decode_tree6( rdec, decoder->bm_dis_slot[get_len_state(len)] );
if( dis_slot < start_dis_model ) rep0 = dis_slot;
else
{

View file

@ -245,7 +245,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[len_states][1<<dis_slot_bits];
Bit_model bm_dis[modeled_distances-end_dis_model];
Bit_model bm_align[dis_align_size];
@ -321,7 +321,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], len_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

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
.TH CLZIP "1" "August 2013" "Clzip 1.5-rc1" "User Commands"
.TH CLZIP "1" "September 2013" "Clzip 1.5" "User Commands"
.SH NAME
Clzip \- reduces the size of files
.SH SYNOPSIS

View file

@ -12,7 +12,7 @@ File: clzip.info, Node: Top, Next: Introduction, Up: (dir)
Clzip Manual
************
This manual is for Clzip (version 1.5-rc1, 1 August 2013).
This manual is for Clzip (version 1.5, 17 September 2013).
* Menu:
@ -281,7 +281,7 @@ The format for running clzip is:
`--verbose'
Verbose mode.
When compressing, show the compression ratio for each file
processed. A second -v shows the progress of compression.
processed. A second `-v' shows the progress of compression.
When decompressing or testing, further -v's (up to 4) increase the
verbosity level, showing status, compression ratio, dictionary
size, and trailer contents (CRC, data size, member size).
@ -484,7 +484,7 @@ file with a member size of 32 MiB.

File: clzip.info, Node: Problems, Next: Concept index, Prev: Examples, Up: Top
6 Reporting Bugs
6 Reporting bugs
****************
There are probably bugs in clzip. There are certainly errors and
@ -523,10 +523,10 @@ Node: Top212
Node: Introduction914
Node: Algorithm5091
Node: Invoking clzip7590
Node: File format13187
Node: Examples15692
Node: Problems17660
Node: Concept index18186
Node: File format13189
Node: Examples15694
Node: Problems17662
Node: Concept index18188

End Tag Table

View file

@ -6,8 +6,8 @@
@finalout
@c %**end of header
@set UPDATED 1 August 2013
@set VERSION 1.5-rc1
@set UPDATED 17 September 2013
@set VERSION 1.5
@dircategory Data Compression
@direntry
@ -301,7 +301,7 @@ Use it together with @samp{-v} to see information about the file.
@itemx --verbose
Verbose mode.@*
When compressing, show the compression ratio for each file processed. A
second -v shows the progress of compression.@*
second @samp{-v} shows the progress of compression.@*
When decompressing or testing, further -v's (up to 4) increase the
verbosity level, showing status, compression ratio, dictionary size,
and trailer contents (CRC, data size, member size).
@ -541,7 +541,7 @@ clzip -b 32MiB -S 650MB big_db
@node Problems
@chapter Reporting Bugs
@chapter Reporting bugs
@cindex bugs
@cindex getting help

View file

@ -317,7 +317,7 @@ static void LZe_fill_align_prices( struct LZ_encoder * const encoder )
static void LZe_fill_distance_prices( struct LZ_encoder * const encoder )
{
int dis, dis_state;
int dis, len_state;
for( dis = start_dis_model; dis < modeled_distances; ++dis )
{
const int dis_slot = dis_slots[dis];
@ -326,15 +326,15 @@ 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 )
encoder->dis_prices[dis_state][dis] = price;
for( len_state = 0; len_state < len_states; ++len_state )
encoder->dis_prices[len_state][dis] = price;
}
for( dis_state = 0; dis_state < max_dis_states; ++dis_state )
for( len_state = 0; len_state < len_states; ++len_state )
{
int * const dsp = encoder->dis_slot_prices[dis_state];
int * const dp = encoder->dis_prices[dis_state];
const Bit_model * const bmds = encoder->bm_dis_slot[dis_state];
int * const dsp = encoder->dis_slot_prices[len_state];
int * const dp = encoder->dis_prices[len_state];
const Bit_model * const bmds = encoder->bm_dis_slot[len_state];
int slot = 0;
for( ; slot < end_dis_model && slot < encoder->num_dis_slots; ++slot )
dsp[slot] = price_symbol( bmds, slot, dis_slot_bits );
@ -365,7 +365,7 @@ 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], len_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

@ -488,7 +488,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[len_states][1<<dis_slot_bits];
Bit_model bm_dis[modeled_distances-end_dis_model];
Bit_model bm_align[dis_align_size];
@ -501,8 +501,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[len_states][2*max_dictionary_bits];
int dis_prices[len_states][modeled_distances];
int align_prices[dis_align_size];
int align_price_count;
};
@ -568,12 +568,12 @@ static inline int LZe_price_rep0_len( const struct LZ_encoder * const encoder,
}
static inline int LZe_price_dis( const struct LZ_encoder * const encoder,
const int dis, const int dis_state )
const int dis, const int len_state )
{
if( dis < modeled_distances )
return encoder->dis_prices[dis_state][dis];
return encoder->dis_prices[len_state][dis];
else
return encoder->dis_slot_prices[dis_state][get_slot( dis )] +
return encoder->dis_slot_prices[len_state][get_slot( dis )] +
encoder->align_prices[dis & (dis_align_size - 1)];
}
@ -582,7 +582,7 @@ static inline int LZe_price_pair( const struct LZ_encoder * const encoder,
const int pos_state )
{
return Lee_price( &encoder->match_len_encoder, len, pos_state ) +
LZe_price_dis( encoder, dis, get_dis_state( len ) );
LZe_price_dis( encoder, dis, get_len_state( len ) );
}
static inline int LZe_price_literal( const struct LZ_encoder * const encoder,
@ -613,7 +613,7 @@ static inline void LZe_encode_pair( struct LZ_encoder * const encoder,
{
const int dis_slot = get_slot( dis );
Lee_encode( &encoder->match_len_encoder, &encoder->renc, len, pos_state );
Re_encode_tree( &encoder->renc, encoder->bm_dis_slot[get_dis_state(len)],
Re_encode_tree( &encoder->renc, encoder->bm_dis_slot[get_len_state(len)],
dis_slot, dis_slot_bits );
if( dis_slot >= start_dis_model )

9
lzip.h
View file

@ -54,6 +54,7 @@ enum {
pos_states = 1 << pos_state_bits,
pos_state_mask = pos_states - 1,
len_states = 4,
dis_slot_bits = 6,
start_dis_model = 4,
end_dis_model = 14,
@ -71,12 +72,10 @@ enum {
min_match_len = 2, /* must be 2 */
max_match_len = min_match_len + max_len_symbols - 1, /* 273 */
min_match_len_limit = 5,
min_match_len_limit = 5 };
max_dis_states = 4 };
static inline int get_dis_state( const int len )
{ return min( len - min_match_len, max_dis_states - 1 ); }
static inline int get_len_state( const int len )
{ return min( len - min_match_len, len_states - 1 ); }
static inline int get_lit_state( const uint8_t prev_byte )
{ return ( prev_byte >> ( 8 - literal_context_bits ) ); }