Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmilk committed May 29, 2020
1 parent 8b46a95 commit 256e464
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions CPP/7zip/Compress/ZstdEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,17 @@ STDMETHODIMP CEncoder::SetCoderProperties(const PROPID * propIDs, const PROPVARI
/* like --long in zstd cli program */
_Long = 1;
if (v == 0) {
// m0=zstd:long:tlen=x
// m0=zstd:long:tlen=x -> long=default
_WindowLog = 27;
} else if (v < 10) {
_WindowLog = 10;
} else if (v < ZSTD_WINDOWLOG_MIN) {
// m0=zstd:long=9 -> long=10
_WindowLog = ZSTD_WINDOWLOG_MIN;
} else if (v > ZSTD_WINDOWLOG_MAX) {
// m0=zstd:long=33 -> long=max
_WindowLog = ZSTD_WINDOWLOG_MAX;
} else {
// m0=zstd:long=15 -> long=value
_WindowLog = v;
}
break;
}
Expand Down

0 comments on commit 256e464

Please sign in to comment.