@@ -124,7 +124,7 @@ CompressedOutputStream::CompressedOutputStream(OutputStream& os,
124124 _ctx.putInt (" bsVersion" , BITSTREAM_FORMAT_VERSION);
125125
126126 // Allocate first buffer and add padding for incompressible blocks
127- const int bufSize = max (_blockSize + (_blockSize >> 6 ), 65536 );
127+ const int bufSize = max (_blockSize + (_blockSize >> 3 ), 512 * 1024 );
128128 _buffers[0 ] = new SliceArray<byte>(new byte[bufSize], bufSize, 0 );
129129 _buffers[_jobs] = new SliceArray<byte>(new byte[0 ], 0 , 0 );
130130
@@ -208,7 +208,7 @@ CompressedOutputStream::CompressedOutputStream(OutputStream& os, Context& ctx, b
208208 _buffers = new SliceArray<byte>*[2 * _jobs];
209209
210210 // Allocate first buffer and add padding for incompressible blocks
211- const int bufSize = max (_blockSize + (_blockSize >> 6 ), 65536 );
211+ const int bufSize = max (_blockSize + (_blockSize >> 3 ), 512 * 1024 );
212212 _buffers[0 ] = new SliceArray<byte>(new byte[bufSize], bufSize, 0 );
213213 _buffers[_jobs] = new SliceArray<byte>(new byte[0 ], 0 , 0 );
214214
@@ -356,7 +356,7 @@ ostream& CompressedOutputStream::write(const char* data, streamsize length)
356356
357357 if (_bufferId + 1 < nbTasks) {
358358 _bufferId++;
359- const int bufSize = max (_blockSize + (_blockSize >> 6 ), 65536 );
359+ const int bufSize = max (_blockSize + (_blockSize >> 3 ), 512 * 1024 );
360360
361361 if (_buffers[_bufferId]->_length == 0 ) {
362362 delete[] _buffers[_bufferId]->_array ;
0 commit comments