mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-04-05 06:15:28 +00:00
move compression overhead calcs out of main()
This commit is contained in:
parent
1c64dcfb31
commit
e85e4df0ef
3 changed files with 16 additions and 10 deletions
11
main.c
11
main.c
|
|
@ -540,16 +540,7 @@ int main(int argc, char *argv[])
|
|||
control->flags &= ~FLAG_UNLIMITED;
|
||||
}
|
||||
|
||||
/* Work out the compression overhead per compression thread for the
|
||||
* compression back-ends that need a lot of ram */
|
||||
if (LZMA_COMPRESS) {
|
||||
int level = control->compression_level * 7 / 9 ? : 1;
|
||||
i64 dictsize = (level <= 5 ? (1 << (level * 2 + 14)) :
|
||||
(level == 6 ? (1 << 25) : (1 << 26)));
|
||||
|
||||
control->overhead = (dictsize * 23 / 2) + (4 * 1024 * 1024);
|
||||
} else if (ZPAQ_COMPRESS)
|
||||
control->overhead = 112 * 1024 * 1024;
|
||||
setup_overhead(control);
|
||||
|
||||
/* Set the main nice value to half that of the backend threads since
|
||||
* the rzip stage is usually the rate limiting step */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue