mirror of
https://github.com/schnaader/precomp-cpp
synced 2026-08-23 00:23:04 -04:00
Check for "final compression found" improved
- identical compressed size must be the same, too - before, there were cases where everything was decompressed, but identical compressed size was smaller than it could be with other combinations - improves compression ratio for some files
This commit is contained in:
parent
2ed93fd799
commit
2fcb7fe896
1 changed files with 2 additions and 2 deletions
|
|
@ -6071,7 +6071,7 @@ void try_recompress(FILE* origfile, int comp_level, int mem_level, int windowbit
|
|||
printf ("Identical decompressed bytes: %i of %i\n", identical_bytes_decomp, decomp_bytes_total);
|
||||
}
|
||||
|
||||
final_compression_found = (identical_bytes_decomp == decomp_bytes_total) && (penalty_bytes_len < PENALTY_BYTES_TOLERANCE);
|
||||
final_compression_found = (identical_bytes_decomp == decomp_bytes_total) && (identical_bytes == compressed_stream_size) && (penalty_bytes_len < PENALTY_BYTES_TOLERANCE);
|
||||
}
|
||||
|
||||
best_identical_bytes_decomp = identical_bytes_decomp;
|
||||
|
|
@ -6102,7 +6102,7 @@ void try_recompress_bzip2(FILE* origfile, int level, int& compressed_stream_size
|
|||
printf ("Identical decompressed bytes: %i of %i\n", identical_bytes_decomp, decomp_bytes_total);
|
||||
}
|
||||
|
||||
final_compression_found = (identical_bytes_decomp == decomp_bytes_total) && (penalty_bytes_len < PENALTY_BYTES_TOLERANCE);
|
||||
final_compression_found = (identical_bytes_decomp == decomp_bytes_total) && (identical_bytes == compressed_stream_size) && (penalty_bytes_len < PENALTY_BYTES_TOLERANCE);
|
||||
}
|
||||
|
||||
best_identical_bytes_decomp = identical_bytes_decomp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue