1. -- Just for fun, playing with the old Zip Reduce format... 
  2. -- 
  3. -- Reduce combines LZ77 with a probabilistic using a Markov chain. 
  4. -- The format has a single block for the whole file :-(. 
  5. -- 
  6. -- NB: this compressor works in two passes, the first one 
  7. --     serving to compute the exact Markov matrix for the whole 
  8. --     data to be compressed. Hence, it is slow. However, 
  9. --     we cache the last n=LZ_cache_size bytes compressed by LZ77. 
  10. --     The result is optimal - within the constraints of that format: 
  11. --     one block, poor encoding of compressed data and of the 
  12. --     compression structure (the Markov matrix). 
  13. -- 
  14. -- Author: G. de Montmollin, January 2009 
  15. -- 
  16.  
  17. private procedure Zip.Compress.Reduce( 
  18.   input, 
  19.   output          : Zip_Streams.Zipstream_Class; 
  20.   input_size_known: Boolean; 
  21.   input_size      : File_size_type; -- ignored if unknown 
  22.   feedback        : Feedback_proc; 
  23.   reduction_factor: Positive; 
  24.   CRC             : in out Interfaces.Unsigned_32; -- only updated here 
  25.   output_size     : out File_size_type; 
  26.   compression_ok  : out Boolean -- indicates compressed <= uncompressed 
  27. );