From 848010fbb5365276135b7b5e5d0e428012ad9e57 Mon Sep 17 00:00:00 2001 From: Moinak Ghosh Date: Wed, 5 Nov 2014 22:05:19 +0530 Subject: [PATCH] Tweak LZP and Dict to mostly avoid non-text files. --- pcompress.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pcompress.c b/pcompress.c index ad8e3ef..6a687f0 100644 --- a/pcompress.c +++ b/pcompress.c @@ -264,7 +264,8 @@ preproc_compress(pc_ctx_t *pctx, compress_func_ptr cmp_func, void *src, uint64_t } #ifndef _MPLV2_LICENSE_ - if (pctx->lzp_preprocess && stype != TYPE_BMP && stype != TYPE_TIFF) { + if (pctx->lzp_preprocess && stype != TYPE_BMP && stype != TYPE_TIFF && + PC_TYPE(btype) != TYPE_BINARY) { int hashsize; int64_t result; @@ -284,7 +285,7 @@ preproc_compress(pc_ctx_t *pctx, compress_func_ptr cmp_func, void *src, uint64_t if (pctx->enable_delta2_encode && props->delta2_span > 0 && stype != TYPE_DNA_SEQ && stype != TYPE_BMP && - stype != TYPE_TIFF && stype != TYPE_MP4) { + stype != TYPE_TIFF && stype != TYPE_MP4 && PC_TYPE(btype) != TYPE_TEXT) { _dstlen = fromlen; result = delta2_encode((uchar_t *)from, fromlen, to, &_dstlen, props->delta2_span, pctx->delta2_nstrides);