Use PPMd fallback for adapt2 if BSC is not enabled.

This commit is contained in:
Moinak Ghosh 2013-02-17 22:01:29 +05:30
parent f41ea40bb9
commit cb853821c7

View file

@ -227,22 +227,24 @@ adapt_compress(void *src, uint64_t srclen, void *dst,
bzip2_count++; bzip2_count++;
} else { } else {
#ifdef ENABLE_PC_LIBBSC
if (adat->bsc_data && tag1 > tag2 - 4 && tag1 < tag2 + 4 && tag3 > (double)tag1 * 0.40 && if (adat->bsc_data && tag1 > tag2 - 4 && tag1 < tag2 + 4 && tag3 > (double)tag1 * 0.40 &&
tagcnt > (double)srclen * 0.001) { tagcnt > (double)srclen * 0.001) {
#ifdef ENABLE_PC_LIBBSC
rv = libbsc_compress(src, srclen, dst, dstlen, level, chdr, adat->bsc_data); rv = libbsc_compress(src, srclen, dst, dstlen, level, chdr, adat->bsc_data);
if (rv < 0) if (rv < 0)
return (rv); return (rv);
rv = ADAPT_COMPRESS_BSC; rv = ADAPT_COMPRESS_BSC;
bsc_count++; bsc_count++;
#endif
} else { } else {
#endif
rv = ppmd_compress(src, srclen, dst, dstlen, level, chdr, adat->ppmd_data); rv = ppmd_compress(src, srclen, dst, dstlen, level, chdr, adat->ppmd_data);
if (rv < 0) if (rv < 0)
return (rv); return (rv);
rv = ADAPT_COMPRESS_PPMD; rv = ADAPT_COMPRESS_PPMD;
ppmd_count++; ppmd_count++;
#ifdef ENABLE_PC_LIBBSC
} }
#endif
} }
return (rv); return (rv);