Subversion Repositories pentevo

Rev

Blame | Last modification | View Log | Download | RSS feed | ?url?

  1. #ifndef MHMT_LZ_H
  2. #define MHMT_LZ_H
  3.  
  4. #include "mhmt-types.h"
  5.  
  6.  
  7. // variety of LZ codes to support is:
  8. //
  9. // copybytes code, with lengths 1,12,14,16,...,42
  10. // 1-byte match looking back -1..-8
  11. // 2-byte up to -768 bytes back (-2176 for zx7)
  12. // 3-byte insert-in-the-middle match: byte from (offset), insertet byte, byte from (offset+2), -1..-79
  13. // 3-3839-byte matches up to -65536 bytes back
  14. //
  15. // we code it as follows:
  16. //
  17. // copybytes: length = +(number of bytes)
  18. //            disp   = 0
  19. // ordinary match: length = +(number of bytes in match)
  20. //                 disp   = negative displacement (-1..-65536 atm)
  21. // insert-in-the-middle match: length = -3 (only 3-byte match)
  22. //                             disp   = -1..-79 (atm)
  23. // end of codes list: length = 0 <= check it!
  24. //                    disp   = 0
  25.  
  26.  
  27.  
  28. struct lzcode
  29. {
  30.         LONG length;
  31.         LONG disp;
  32. };
  33.  
  34.  
  35.  
  36. void make_lz_codes(OFFSET position, ULONG actual_len, UBYTE * hash, struct lzcode * codes);
  37.  
  38. ULONG get_lz_price_megalz(OFFSET position, struct lzcode * lzcode);
  39. ULONG get_lz_price_hrum  (OFFSET position, struct lzcode * lzcode);
  40. ULONG get_lz_price_hrust (OFFSET position, struct lzcode * lzcode);
  41. ULONG get_lz_price_zx7   (OFFSET position, struct lzcode * lzcode);
  42.  
  43.  
  44.  
  45.  
  46. #endif
  47.  
  48.