summaryrefslogtreecommitdiffstats
path: root/fast_encoder.h
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 09:34:27 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 09:34:27 +0000
commite9eff495255f6597233d54ad40ac1efe3f4d416f (patch)
tree2c8b6b9c2fdaf9b520a076259e8868a192151b23 /fast_encoder.h
parentAdding debian version 1.13-4. (diff)
downloadlzip-e9eff495255f6597233d54ad40ac1efe3f4d416f.tar.xz
lzip-e9eff495255f6597233d54ad40ac1efe3f4d416f.zip
Merging upstream version 1.14.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'fast_encoder.h')
-rw-r--r--fast_encoder.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/fast_encoder.h b/fast_encoder.h
index 05c3ca8..5b5169f 100644
--- a/fast_encoder.h
+++ b/fast_encoder.h
@@ -1,5 +1,5 @@
/* Lzip - Data compressor based on the LZMA algorithm
- Copyright (C) 2008, 2009, 2010, 2011, 2012 Antonio Diaz Diaz.
+ Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,11 +17,13 @@
class Fmatchfinder : public Matchfinder_base
{
- enum { before = max_match_len + 1,
+ enum { before_size = max_match_len + 1,
dict_size = 65536,
+ // bytes to keep in buffer after pos
+ after_size = max_match_len,
dict_factor = 16,
len_limit = 16,
- num_prev_pos = 1 << 16,
+ num_prev_positions23 = 0,
pos_array_factor = 1 };
int key4; // key made from latest 4 bytes
@@ -29,14 +31,14 @@ class Fmatchfinder : public Matchfinder_base
public:
explicit Fmatchfinder( const int ifd )
:
- Matchfinder_base( before, dict_size, dict_factor, len_limit,
- num_prev_pos, ifd, pos_array_factor ),
+ Matchfinder_base( before_size, dict_size, after_size, dict_factor,
+ len_limit, num_prev_positions23, pos_array_factor, ifd ),
key4( 0 )
{}
void reset() { Matchfinder_base::reset(); key4 = 0; }
int longest_match_len( int * const distance );
- void longest_match_len();
+ void longest_match_len( int n );
};
@@ -47,15 +49,9 @@ class FLZ_encoder : public LZ_encoder_base
void move_pos( int n )
{
if( --n >= 0 ) fmatchfinder.move_pos();
- while( --n >= 0 )
- {
- fmatchfinder.longest_match_len();
- fmatchfinder.move_pos();
- }
+ fmatchfinder.longest_match_len( n );
}
- void sequence_optimizer( int reps[num_rep_distances], State & state );
-
public:
FLZ_encoder( Fmatchfinder & mf, const File_header & header, const int outfd )
:
@@ -63,5 +59,5 @@ public:
fmatchfinder( mf )
{}
- bool encode_member( const long long member_size );
+ bool encode_member( const unsigned long long member_size );
};