PackDef.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. namespace SharpCompress.Compressors.Rar.UnpackV1.Decode
  2. {
  3. internal static class PackDef
  4. {
  5. // 20171217 NOTE: these contants are gone from unrar src code
  6. // seems to be more dynamic
  7. public const int MAXWINSIZE = 0x400000;
  8. public const int MAXWINMASK = MAXWINSIZE - 1;
  9. public const uint MAX_LZ_MATCH = 0x1001;
  10. public const uint MAX3_LZ_MATCH = 0x101; // Maximum match length for RAR v3.
  11. public const int LOW_DIST_REP_COUNT = 16;
  12. public const int NC = 299; /* alphabet = {0, 1, 2, ..., NC - 1} */
  13. public const int DC = 60;
  14. public const int LDC = 17;
  15. public const int RC = 28;
  16. // 20171217: NOTE: these constants seem to have been updated in the unrar src code
  17. // at some unknown point. updating causes decompression failure, not sure why.
  18. // public const int NC = 306; /* alphabet = {0, 1, 2, ..., NC - 1} */
  19. // public const int DC = 64;
  20. // public const int LDC = 16;
  21. // public const int RC = 44;
  22. public const int HUFF_TABLE_SIZE = NC + DC + RC + LDC;
  23. public const int BC = 20;
  24. public const uint NC30 = 299; /* alphabet = {0, 1, 2, ..., NC - 1} */
  25. public const uint DC30 = 60;
  26. public const uint LDC30 = 17;
  27. public const uint RC30 = 28;
  28. public const uint BC30 = 20;
  29. public const uint HUFF_TABLE_SIZE30 = NC30 + DC30 + RC30 + LDC30;
  30. public const int NC20 = 298; /* alphabet = {0, 1, 2, ..., NC - 1} */
  31. public const int DC20 = 48;
  32. public const int RC20 = 28;
  33. public const int BC20 = 19;
  34. public const int MC20 = 257;
  35. // Largest alphabet size among all values listed above.
  36. public const uint LARGEST_TABLE_SIZE = 306;
  37. //public enum {
  38. // CODE_HUFFMAN, CODE_LZ, CODE_REPEATLZ, CODE_CACHELZ, CODE_STARTFILE,
  39. // CODE_ENDFILE, CODE_FILTER, CODE_FILTERDATA
  40. //}
  41. }
  42. }