Adaptive compression supporting output size thresholds
View Patent ↗Methods and systems for adaptive compression include compressing input data according to a first compression ratio; pausing compression after a predetermined amount of input data is compressed; estimating which of a set of ranges a compressed output size will fall within using current settings; and performing compression on a remainder of the input data according to a second compression ratio based on the estimated range.
1. A system for adaptive compression, comprising:
a compression engine comprising a processor configured to compress input data according to a first compression ratio, to pause compression after a predetermined amount of input data is compressed, to estimate a plurality of ranges of a compressed output size using current settings, and to perform compression on a remainder of the input data according to a second compression ratio based on the estimated range.
2. The system of claim 1 , wherein the plurality of ranges correspond to integer multiples of a storage block size.
3. The system of claim 1 , wherein said step of performing compression comprises using a second compression ratio that is higher than the first compression ratio if the higher second compression ratio will produce an estimated compressed output size that is below a closest lower range threshold.
4. The system of claim 1 , wherein said step of performing compression comprises using a second compression ratio that is lower than the first compression ratio if a higher compression second compression ratio would not produce an estimated compressed output size that is below a closest lower range threshold.
5. The system of claim 4 , wherein the second compression ratio is set to produce a compressed output size that is below a closest higher range threshold.
6. The system of claim 1 , further comprising aborting compression if a current output size at pausing exceeds a maximum threshold.
7. The system of claim 1 , wherein the compression engine is further configured to repeat the pausing of compression, the estimation of the compressed output size, and the comparison of the estimated compressed output size to a plurality of thresholds after performing compression according to the second compression ratio.
8. A non-transitory computer readable storage medium comprising a computer readable program for adaptive compression, wherein the computer readable program when executed on a computer causes the computer to perform the steps of:
compressing input data according to a first compression ratio;
pausing compression after a predetermined amount of input data is compressed;
estimating a plurality of ranges of a compressed output size using current settings; and
performing compression on a remainder of the input data according to a second compression ratio based on the estimated range.