Skip to content

Commit

Permalink
bsc 3.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaGrebnov committed Nov 24, 2022
1 parent a83504d commit 7497f2a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Changes in 3.2.5 (November, 23 2022)
- Fixed data corruption issue in LZP encoder.
- Due to these fix, an upgrade to this version is strongly recommended.

Changes in 3.2.4 (18 January, 18 2022)
- Improved performance for AArch64 (ARM64) platform.

Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ block-sorting data compression algorithms.
libbsc is a library based on bsc, it uses the same algorithms
as bsc and enables you to compress memory blocks.

Copyright (c) 2009-2021 Ilya Grebnov <ilya.grebnov@gmail.com>
Copyright (c) 2009-2022 Ilya Grebnov <ilya.grebnov@gmail.com>

See file AUTHORS for a full list of contributors.

Expand All @@ -21,7 +21,7 @@ See the bsc and libbsc web site:
Software License:
-----------------

Copyright (c) 2009-2021 Ilya Grebnov <ilya.grebnov@gmail.com>
Copyright (c) 2009-2022 Ilya Grebnov <ilya.grebnov@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.4
3.2.5
4 changes: 2 additions & 2 deletions bsc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,8 @@ void ProcessCommandline(int argc, char * argv[])

int main(int argc, char * argv[])
{
fprintf(stdout, "This is bsc, Block Sorting Compressor. Version 3.2.4. 18 January 2022.\n");
fprintf(stdout, "Copyright (c) 2009-2021 Ilya Grebnov <Ilya.Grebnov@gmail.com>.\n\n");
fprintf(stdout, "This is bsc, Block Sorting Compressor. Version 3.2.5. 23 November 2022.\n");
fprintf(stdout, "Copyright (c) 2009-2022 Ilya Grebnov <Ilya.Grebnov@gmail.com>.\n\n");

#if defined(_OPENMP) && defined(__INTEL_COMPILER)

Expand Down
17 changes: 10 additions & 7 deletions libbsc/lzp/lzp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,13 +541,16 @@ int bsc_lzp_encode_block(const unsigned char * input, const unsigned char * inpu
if (int * lookup = (int *)bsc_zero_malloc((int)(1 << hashSize) * sizeof(int)))
{
#if defined(LIBBSC_ALLOW_UNALIGNED_ACCESS) && (defined(__x86_64__) || defined(__aarch64__))
result = (minLen == 1 * (int)sizeof(unsigned int ) && result == LIBBSC_NOT_ENOUGH_MEMORY) ? bsc_lzp_encode_small <unsigned int >(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1) : result;
result = (minLen == 1 * (int)sizeof(unsigned long long) && result == LIBBSC_NOT_ENOUGH_MEMORY) ? bsc_lzp_encode_small <unsigned long long>(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1) : result;
result = (minLen == 2 * (int)sizeof(unsigned long long) && result == LIBBSC_NOT_ENOUGH_MEMORY) ? bsc_lzp_encode_small2x<unsigned long long>(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1) : result;
result = (minLen <= 2 * (int)sizeof(unsigned int ) && result == LIBBSC_NOT_ENOUGH_MEMORY) ? bsc_lzp_encode_medium <unsigned int >(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1, minLen) : result;
result = (minLen <= 2 * (int)sizeof(unsigned long long) && result == LIBBSC_NOT_ENOUGH_MEMORY) ? bsc_lzp_encode_medium <unsigned long long>(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1, minLen) : result;

result = result == LIBBSC_NOT_ENOUGH_MEMORY ? bsc_lzp_encode_large<unsigned long long>(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1, minLen) : result;
if (hashSize <= 17)
{
result = (minLen == 1 * (int)sizeof(unsigned int ) && result == LIBBSC_NOT_ENOUGH_MEMORY) ? bsc_lzp_encode_small <unsigned int >(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1) : result;
result = (minLen == 1 * (int)sizeof(unsigned long long) && result == LIBBSC_NOT_ENOUGH_MEMORY) ? bsc_lzp_encode_small <unsigned long long>(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1) : result;
result = (minLen == 2 * (int)sizeof(unsigned long long) && result == LIBBSC_NOT_ENOUGH_MEMORY) ? bsc_lzp_encode_small2x<unsigned long long>(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1) : result;
result = (minLen <= 2 * (int)sizeof(unsigned int ) && result == LIBBSC_NOT_ENOUGH_MEMORY) ? bsc_lzp_encode_medium <unsigned int >(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1, minLen) : result;
result = (minLen <= 2 * (int)sizeof(unsigned long long) && result == LIBBSC_NOT_ENOUGH_MEMORY) ? bsc_lzp_encode_medium <unsigned long long>(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1, minLen) : result;

result = result == LIBBSC_NOT_ENOUGH_MEMORY ? bsc_lzp_encode_large<unsigned long long>(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1, minLen) : result;
}
#endif

result = result == LIBBSC_NOT_ENOUGH_MEMORY ? bsc_lzp_encode_generic(input, inputEnd, output, outputEnd, lookup, (int)(1 << hashSize) - 1, minLen) : result;
Expand Down

0 comments on commit 7497f2a

Please sign in to comment.