?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. #ifndef MHMT_OPTIMAL_H
  2. #define MHMT_OPTIMAL_H
  3.  
  4. #include "mhmt-types.h"
  5. #include "mhmt-globals.h"
  6. #include "mhmt-lz.h"
  7.  
  8.  
  9.  
  10. // this structure exists in array for each input byte and used to build optimal code chain
  11. struct optchain
  12. {
  13.         struct lzcode code; // code of jumping here from previous position
  14.         ULONG price; // bitprice (bitlength) of the best chain of lzcodes going up to this point:
  15.                      // initialized as 0xFFFFFFFF (maximum price)
  16.         ULONG _just_a_filler_; // to make structure 8 bytes long (true for 32bit machines)
  17. };
  18.  
  19.  
  20.  
  21. // special opt-chain structure for hrust (8 paths)
  22. struct optch_hst
  23. {
  24.         struct lzcode code; // jumping here by code
  25.         BYTE          path; // jumping here from path (0..7)
  26.  
  27.         ULONG price; // bitprice
  28. };
  29.  
  30.  
  31.  
  32.  
  33. struct optchain * make_optch(ULONG actual_len);
  34.  
  35. // makes path of 8 optchains
  36. struct optch_hst ** make_optch_hst(ULONG actual_len);
  37.  
  38.  
  39. void update_optch(ULONG position, struct lzcode * codes, ULONG (*get_lz_price)(OFFSET position, struct lzcode * lzcode), struct optchain * optch);
  40.  
  41. void update_optch_hst(ULONG position, struct lzcode * codes, ULONG (*get_lz_price)(OFFSET position, struct lzcode * lzcode), struct optch_hst ** optch);
  42.  
  43.  
  44.  
  45. void reverse_optch(struct optchain * optch, ULONG actual_len);
  46.  
  47. void reverse_optch_hst(struct optch_hst ** optch, ULONG actual_len);
  48.  
  49.  
  50. //struct lzcode * scan_optch(ULONG start_flag);
  51.  
  52. void free_optch(struct optchain * optch);
  53.  
  54. void free_optch_hst(struct optch_hst ** optch);
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. #endif
  62.