File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ type encoderOptions struct {
2424allLitEntropy bool
2525customWindow bool
2626customALEntropy bool
27+ customBlockSize bool
2728lowMem bool
2829dict * dict
2930}
@@ -33,7 +34,7 @@ func (o *encoderOptions) setDefault() {
3334concurrent : runtime .GOMAXPROCS (0 ),
3435crc : true ,
3536single : nil ,
36- blockSize : 1 << 16 ,
37+ blockSize : maxCompressedBlockSize ,
3738windowSize : 8 << 20 ,
3839level : SpeedDefault ,
3940allLitEntropy : true ,
@@ -106,6 +107,7 @@ func WithWindowSize(n int) EOption {
106107o .customWindow = true
107108if o .blockSize > o .windowSize {
108109o .blockSize = o .windowSize
110+ o .customBlockSize = true
109111}
110112return nil
111113}
@@ -222,6 +224,9 @@ func WithEncoderLevel(l EncoderLevel) EOption {
222224switch o .level {
223225case SpeedFastest :
224226o .windowSize = 4 << 20
227+ if ! o .customBlockSize {
228+ o .blockSize = 1 << 16
229+ }
225230case SpeedDefault :
226231o .windowSize = 8 << 20
227232case SpeedBetterCompression :
You can’t perform that action at this time.
0 commit comments