Avoid Delta2,LZP for TIFF files. Negatively impacts compression.
This commit is contained in:
parent
306f145f22
commit
dfeea8c19b
6 changed files with 19 additions and 11 deletions
|
@ -237,7 +237,9 @@ preproc_compress(pc_ctx_t *pctx, compress_func_ptr cmp_func, void *src, uint64_t
|
|||
}
|
||||
}
|
||||
|
||||
if (pctx->lzp_preprocess && PC_SUBTYPE(btype) != TYPE_BMP) {
|
||||
if (pctx->lzp_preprocess &&
|
||||
PC_SUBTYPE(btype) != TYPE_BMP &&
|
||||
PC_SUBTYPE(btype) != TYPE_TIFF) {
|
||||
int hashsize;
|
||||
|
||||
hashsize = lzp_hash_size(level);
|
||||
|
@ -254,7 +256,8 @@ preproc_compress(pc_ctx_t *pctx, compress_func_ptr cmp_func, void *src, uint64_t
|
|||
}
|
||||
|
||||
if (pctx->enable_delta2_encode && props->delta2_span > 0 &&
|
||||
PC_SUBTYPE(btype) != TYPE_DNA_SEQ && PC_SUBTYPE(btype) != TYPE_BMP) {
|
||||
PC_SUBTYPE(btype) != TYPE_DNA_SEQ && PC_SUBTYPE(btype) != TYPE_BMP &&
|
||||
PC_SUBTYPE(btype) != TYPE_TIFF) {
|
||||
_dstlen = fromlen;
|
||||
result = delta2_encode((uchar_t *)from, fromlen, to,
|
||||
&_dstlen, props->delta2_span);
|
||||
|
|
|
@ -89,6 +89,8 @@ struct ext_entry {
|
|||
{"mom" , TYPE_TEXT, 3},
|
||||
{"tmac" , TYPE_TEXT, 4},
|
||||
{"pdf" , TYPE_BINARY, 3},
|
||||
{"tif" , TYPE_BINARY|TYPE_TIFF, 3},
|
||||
{"tiff" , TYPE_BINARY|TYPE_TIFF, 4},
|
||||
{"jpg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_JPEG, 3},
|
||||
{"jpeg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_JPEG, 4},
|
||||
{"mjpeg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_MJPEG, 5},
|
||||
|
|
|
@ -79,6 +79,8 @@ upp,TYPE_TEXT
|
|||
mom,TYPE_TEXT
|
||||
tmac,TYPE_TEXT
|
||||
pdf,TYPE_BINARY
|
||||
tif,TYPE_BINARY|TYPE_TIFF
|
||||
tiff,TYPE_BINARY|TYPE_TIFF
|
||||
jpg,TYPE_BINARY|TYPE_COMPRESSED|TYPE_JPEG
|
||||
jpeg,TYPE_BINARY|TYPE_COMPRESSED|TYPE_JPEG
|
||||
mjpeg,TYPE_BINARY|TYPE_COMPRESSED|TYPE_MJPEG
|
||||
|
|
|
@ -12,14 +12,14 @@
|
|||
|
||||
/* small adjustments to _a_ to make values distinct */
|
||||
ub1 tab[] = {
|
||||
125,0,0,87,7,113,82,120,113,0,0,113,0,0,113,125,
|
||||
0,0,7,113,0,113,0,0,0,7,0,131,0,85,0,22,
|
||||
125,0,0,82,125,113,82,87,113,0,0,113,0,0,113,125,
|
||||
0,0,7,113,0,113,0,0,0,125,0,131,0,85,125,22,
|
||||
0,113,0,0,85,0,0,113,0,113,125,113,0,7,22,0,
|
||||
82,0,0,113,125,125,0,0,0,0,0,113,22,0,0,125,
|
||||
0,87,0,0,113,0,125,183,82,0,124,88,40,125,0,0,
|
||||
124,0,168,125,0,125,0,40,0,82,125,113,113,125,116,0,
|
||||
0,0,113,85,0,88,0,0,42,27,0,0,0,40,183,61,
|
||||
0,0,0,0,0,111,0,0,87,125,0,0,127,91,0,0,
|
||||
82,0,0,113,125,125,0,0,0,0,113,7,74,0,0,125,
|
||||
0,87,0,0,113,0,125,183,82,0,124,40,40,183,0,0,
|
||||
124,0,55,85,0,125,0,32,0,82,125,74,0,125,0,0,
|
||||
0,0,113,113,0,40,0,0,42,27,0,0,0,40,183,4,
|
||||
0,0,0,0,0,24,0,0,114,124,0,0,103,200,0,0,
|
||||
};
|
||||
|
||||
/* The hash function */
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
extern ub1 tab[];
|
||||
#define PHASHLEN 0x80 /* length of hash mapping table */
|
||||
#define PHASHNKEYS 132 /* How many keys were hashed */
|
||||
#define PHASHNKEYS 134 /* How many keys were hashed */
|
||||
#define PHASHRANGE 256 /* Range any input might map to */
|
||||
#define PHASHSALT 0x9e3779b9 /* internal, initialize normal hash */
|
||||
|
||||
|
|
|
@ -271,7 +271,8 @@ typedef enum {
|
|||
TYPE_MJPEG = 176,
|
||||
TYPE_AUDIO_COMPRESSED = 184,
|
||||
TYPE_EXE64 = 192,
|
||||
TYPE_BMP = 200
|
||||
TYPE_BMP = 200,
|
||||
TYPE_TIFF = 208
|
||||
} data_type_t;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue